< prev index next >

test/jdk/java/lang/reflect/AccessFlag/VersionedLocationsTest.java

Print this page
*** 50,11 ***
   * PUBLIC       step
   * PRIVATE      step
   * PROTECTED    step
   * STATIC       step
   * FINAL        two-step
!  * SUPER        invariant
   * OPEN         step
   * TRANSITIVE   step
   * SYNCHRONIZED invariant
   * STATIC_PHASE step
   * VOLATILE     invariant
--- 50,11 ---
   * PUBLIC       step
   * PRIVATE      step
   * PROTECTED    step
   * STATIC       step
   * FINAL        two-step
!  * SUPER        step
   * OPEN         step
   * TRANSITIVE   step
   * SYNCHRONIZED invariant
   * STATIC_PHASE step
   * VOLATILE     invariant

*** 88,11 ***
       * Invariant access flags have the same set of locations for each
       * class file format version.
       */
      private static void testInvariantAccessFlags() {
          Set<AccessFlag> invariantAccessFlags =
!             Set.of(SUPER, SYNCHRONIZED, VOLATILE, TRANSIENT, NATIVE);
          for(var accessFlag : invariantAccessFlags) {
              Set<AccessFlag.Location> expected = accessFlag.locations();
  
              for(var cffv : ClassFileFormatVersion.values()) {
                  compareLocations(accessFlag.locations(), accessFlag, cffv);
--- 88,11 ---
       * Invariant access flags have the same set of locations for each
       * class file format version.
       */
      private static void testInvariantAccessFlags() {
          Set<AccessFlag> invariantAccessFlags =
!             Set.of(SYNCHRONIZED, VOLATILE, TRANSIENT, NATIVE);
          for(var accessFlag : invariantAccessFlags) {
              Set<AccessFlag.Location> expected = accessFlag.locations();
  
              for(var cffv : ClassFileFormatVersion.values()) {
                  compareLocations(accessFlag.locations(), accessFlag, cffv);

*** 116,10 ***
--- 116,14 ---
  
              new StepFunctionTC(STATIC,
                                 removeInnerClass(STATIC.locations()),
                                 ClassFileFormatVersion.RELEASE_1),
  
+             new StepFunctionTC(SUPER,
+                                Set.of(AccessFlag.Location.CLASS),
+                                ClassFileFormatVersion.RELEASE_22),
+ 
              new StepFunctionTC(OPEN,
                                 Set.of(),
                                 ClassFileFormatVersion.RELEASE_9),
  
              new StepFunctionTC(TRANSITIVE,

*** 292,20 ***
      private static void testFlagVersionConsistency() {
          for (var flag : AccessFlag.values()) {
              for (var location : AccessFlag.Location.values()) {
                  if (location.flags().contains(flag) != flag.locations().contains(location)) {
                      throw new RuntimeException(String.format("AccessFlag and Location inconsistency:" +
!                             "flag %s and location %s are inconsistent for the latest version"));
                  }
              }
          }
          for (var cffv : ClassFileFormatVersion.values()) {
              for (var flag : AccessFlag.values()) {
                  for (var location : AccessFlag.Location.values()) {
                      if (location.flags(cffv).contains(flag) != flag.locations(cffv).contains(location)) {
                          throw new RuntimeException(String.format("AccessFlag and Location inconsistency:" +
!                                 "flag %s and location %s are inconsistent for class file version %s"));
                      }
                  }
              }
          }
      }
--- 296,20 ---
      private static void testFlagVersionConsistency() {
          for (var flag : AccessFlag.values()) {
              for (var location : AccessFlag.Location.values()) {
                  if (location.flags().contains(flag) != flag.locations().contains(location)) {
                      throw new RuntimeException(String.format("AccessFlag and Location inconsistency:" +
!                             "flag %s and location %s are inconsistent for the latest version", flag, location));
                  }
              }
          }
          for (var cffv : ClassFileFormatVersion.values()) {
              for (var flag : AccessFlag.values()) {
                  for (var location : AccessFlag.Location.values()) {
                      if (location.flags(cffv).contains(flag) != flag.locations(cffv).contains(location)) {
                          throw new RuntimeException(String.format("AccessFlag and Location inconsistency:" +
!                                 "flag %s and location %s are inconsistent for class file version %s", flag, location, cffv));
                      }
                  }
              }
          }
      }
< prev index next >