changeset 49034:b00f667fb5a6 nestmates

8187698: [Nestmates][Testbug] Test java/lang/invoke/AccessControlTest.java needs updating for nestmates Reviewed-by: dholmes
author mchung
date Wed, 21 Feb 2018 18:40:05 -0800
parents 2df42bea77a4
children 2e7699825bab
files test/jdk/ProblemList.txt test/jdk/java/lang/invoke/AccessControlTest.java
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/ProblemList.txt	Tue Feb 13 23:51:28 2018 -0500
+++ b/test/jdk/ProblemList.txt	Wed Feb 21 18:40:05 2018 -0800
@@ -278,8 +278,6 @@
 
 # jdk_lang
 
-java/lang/invoke/AccessControlTest.java                         8187698 generic-all
-
 java/lang/StringCoding/CheckEncodings.sh                        7008363 generic-all
 
 java/lang/String/nativeEncoding/StringPlatformChars.java        8182569 windows-all,solaris-all
--- a/test/jdk/java/lang/invoke/AccessControlTest.java	Tue Feb 13 23:51:28 2018 -0500
+++ b/test/jdk/java/lang/invoke/AccessControlTest.java	Wed Feb 21 18:40:05 2018 -0800
@@ -241,8 +241,10 @@
             LookupCase lc = this.in(c2);
             int m1 = lc.lookupModes();
             int m2 = fixMods(m.getModifiers());
-            // privacy is strictly enforced on lookups
-            if (c1 != c2)  m1 &= ~PRIVATE;
+            // allow private lookup on nestmates. Otherwise, privacy is strictly enforced
+            if (c1 != c2 && ((m2 & PRIVATE) == 0 || !c1.isNestmateOf(c2))) {
+                m1 &= ~PRIVATE;
+            }
             // protected access is sometimes allowed
             if ((m2 & PROTECTED) != 0) {
                 int prev = m2;
@@ -252,7 +254,7 @@
                     m2 |= PUBLIC;  // from a subclass, it acts like a public method also
             }
             if (verbosity >= 2)
-                System.out.println(this+" willAccess "+lc+" m1="+m1+" m2="+m2+" => "+((m2 & m1) != 0));
+                System.out.format("%s willAccess %s m1=0x%h m2=0x%h => %s%n", this, lc, m1, m2, ((m2 & m1) != 0));
             return (m2 & m1) != 0;
         }