< prev index next >

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

Print this page
@@ -21,18 +21,19 @@
   * questions.
   */
  
  /*
   * @test
-  * @bug 8266670 8293626
+  * @bug 8266670 8281463 8293626
   * @summary Basic tests of AccessFlag
   */
  
  import java.lang.reflect.AccessFlag;
  import java.lang.reflect.Field;
  import java.lang.reflect.Modifier;
  import java.util.EnumSet;
+ import java.util.List;
  import java.util.Map;
  import java.util.LinkedHashMap;
  import java.util.HashSet;
  import java.util.Set;
  

@@ -110,10 +111,12 @@
                  continue;
              }
  
              Set<AccessFlag.Location> locations = new HashSet<>();
              for (var accessFlag : value) {
+                 if (accessFlag.equals(AccessFlag.SUPER))
+                     continue;       // SUPER is defined to overlap with IDENTITY
                  for (var location : accessFlag.locations()) {
                      boolean added = locations.add(location);
                      if (!added) {
                          reportError(location, accessFlag,
                                      entry.getKey(), value);

@@ -139,11 +142,13 @@
          for (var accessFlag : AccessFlag.values()) {
              Set<AccessFlag> expectedSet = EnumSet.of(accessFlag);
              for (var location : accessFlag.locations()) {
                  Set<AccessFlag> computedSet =
                      AccessFlag.maskToAccessFlags(accessFlag.mask(), location);
-                 if (!expectedSet.equals(computedSet)) {
+                 if (!computedSet.containsAll(expectedSet)) {
+                     System.out.println("expected: " + expectedSet);
+                     System.out.println("computed: " + computedSet);
                      throw new RuntimeException("Bad set computation on " +
                                                 accessFlag + ", " + location);
                  }
              }
          }
< prev index next >