4585 4586 if (is_interface) { 4587 if (major_gte_8) { 4588 // Class file version is JAVA_8_VERSION or later Methods of 4589 // interfaces may set any of the flags except ACC_PROTECTED, 4590 // ACC_FINAL, ACC_NATIVE, and ACC_SYNCHRONIZED; they must 4591 // have exactly one of the ACC_PUBLIC or ACC_PRIVATE flags set. 4592 if ((is_public == is_private) || /* Only one of private and public should be true - XNOR */ 4593 (is_native || is_protected || is_final || is_synchronized) || 4594 // If a specific method of a class or interface has its 4595 // ACC_ABSTRACT flag set, it must not have any of its 4596 // ACC_FINAL, ACC_NATIVE, ACC_PRIVATE, ACC_STATIC, 4597 // ACC_STRICT, or ACC_SYNCHRONIZED flags set. No need to 4598 // check for ACC_FINAL, ACC_NATIVE or ACC_SYNCHRONIZED as 4599 // those flags are illegal irrespective of ACC_ABSTRACT being set or not. 4600 (is_abstract && (is_private || is_static || is_strict))) { 4601 is_illegal = true; 4602 } 4603 } else if (major_gte_15) { 4604 // Class file version in the interval [JAVA_1_5_VERSION, JAVA_8_VERSION) 4605 if (!is_public || is_static || is_final || is_synchronized || 4606 is_native || !is_abstract || is_strict) { 4607 is_illegal = true; 4608 } 4609 } else { 4610 // Class file version is pre-JAVA_1_5_VERSION 4611 if (!is_public || is_static || is_final || is_native || !is_abstract) { 4612 is_illegal = true; 4613 } 4614 } 4615 } else { // not interface 4616 if (has_illegal_visibility(flags)) { 4617 is_illegal = true; 4618 } else { 4619 if (is_initializer) { 4620 if (is_static || is_final || is_synchronized || is_native || 4621 is_abstract || (major_gte_15 && is_bridge)) { 4622 is_illegal = true; 4623 } 4624 } else { // not initializer 4625 if (is_abstract) { 4626 if ((is_final || is_native || is_private || is_static || | 4585 4586 if (is_interface) { 4587 if (major_gte_8) { 4588 // Class file version is JAVA_8_VERSION or later Methods of 4589 // interfaces may set any of the flags except ACC_PROTECTED, 4590 // ACC_FINAL, ACC_NATIVE, and ACC_SYNCHRONIZED; they must 4591 // have exactly one of the ACC_PUBLIC or ACC_PRIVATE flags set. 4592 if ((is_public == is_private) || /* Only one of private and public should be true - XNOR */ 4593 (is_native || is_protected || is_final || is_synchronized) || 4594 // If a specific method of a class or interface has its 4595 // ACC_ABSTRACT flag set, it must not have any of its 4596 // ACC_FINAL, ACC_NATIVE, ACC_PRIVATE, ACC_STATIC, 4597 // ACC_STRICT, or ACC_SYNCHRONIZED flags set. No need to 4598 // check for ACC_FINAL, ACC_NATIVE or ACC_SYNCHRONIZED as 4599 // those flags are illegal irrespective of ACC_ABSTRACT being set or not. 4600 (is_abstract && (is_private || is_static || is_strict))) { 4601 is_illegal = true; 4602 } 4603 } else if (major_gte_15) { 4604 // Class file version in the interval [JAVA_1_5_VERSION, JAVA_8_VERSION) 4605 if (!is_public || is_private || is_protected || is_static || is_final || 4606 is_synchronized || is_native || !is_abstract || is_strict) { 4607 is_illegal = true; 4608 } 4609 } else { 4610 // Class file version is pre-JAVA_1_5_VERSION 4611 if (!is_public || is_static || is_final || is_native || !is_abstract) { 4612 is_illegal = true; 4613 } 4614 } 4615 } else { // not interface 4616 if (has_illegal_visibility(flags)) { 4617 is_illegal = true; 4618 } else { 4619 if (is_initializer) { 4620 if (is_static || is_final || is_synchronized || is_native || 4621 is_abstract || (major_gte_15 && is_bridge)) { 4622 is_illegal = true; 4623 } 4624 } else { // not initializer 4625 if (is_abstract) { 4626 if ((is_final || is_native || is_private || is_static || |