< prev index next >

src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java

Print this page
*** 623,11 ***
          List<EnumDesc<?>> enumDescs = new ArrayList<>();
          List<Class<?>> extraClassLabels = new ArrayList<>();
  
          byte[] classBytes = ClassFile.of().build(ClassDesc.of(typeSwitchClassName(caller.lookupClass())),
                  clb -> {
!                     clb.withFlags(AccessFlag.FINAL, AccessFlag.SUPER, AccessFlag.SYNTHETIC)
                         .withMethodBody("typeSwitch",
                                         TYPES_SWITCH_DESCRIPTOR,
                                         ClassFile.ACC_FINAL | ClassFile.ACC_PUBLIC | ClassFile.ACC_STATIC,
                                         generateTypeSwitchSkeleton(selectorType, labelConstants, enumDescs, extraClassLabels));
          });
--- 623,11 ---
          List<EnumDesc<?>> enumDescs = new ArrayList<>();
          List<Class<?>> extraClassLabels = new ArrayList<>();
  
          byte[] classBytes = ClassFile.of().build(ClassDesc.of(typeSwitchClassName(caller.lookupClass())),
                  clb -> {
!                     clb.withFlags(AccessFlag.FINAL, (PreviewFeatures.isEnabled())  ? AccessFlag.IDENTITY : AccessFlag.SUPER, AccessFlag.SYNTHETIC)
                         .withMethodBody("typeSwitch",
                                         TYPES_SWITCH_DESCRIPTOR,
                                         ClassFile.ACC_FINAL | ClassFile.ACC_PUBLIC | ClassFile.ACC_STATIC,
                                         generateTypeSwitchSkeleton(selectorType, labelConstants, enumDescs, extraClassLabels));
          });
< prev index next >