use of java.lang.invoke.MethodHandles.lookup in project openj9 by eclipse.
the class LookupInTests method testLookup_PublicNestedInnerClassLookup_Level2.
/**
* Validates access restrictions stored in a new Lookup object created from an old Lookup object
* where the new lookup class is a second level inner class under the old lookup class which is the top level outer class.
* Basically we validate that a top level class C can access private members within a nested class C.D.E.
* @throws Throwable
*/
@Test(groups = { "level.sanity" })
public void testLookup_PublicNestedInnerClassLookup_Level2() throws Throwable {
Lookup inObj = samePackageExampleLookup.in(SamePackageInnerClass_Nested_Level2.class);
assertClassAndMode(inObj, SamePackageInnerClass_Nested_Level2.class, FULL_ACCESS_MODE);
}
use of java.lang.invoke.MethodHandles.lookup in project openj9 by eclipse.
the class LookupInTests method testLookup_PublicNestedOuterClassLookup_Level2.
/**
* Validates access restrictions stored in a new Lookup object created from an old Lookup object
* where the new lookup class is a first level inner class on top of the old lookup class which is the second
* level inner class. Basically we validate that a nested class C.D.E can access private members within
* another nested class C.D.
* @throws Throwable
*/
@Test(groups = { "level.sanity" })
public void testLookup_PublicNestedOuterClassLookup_Level2() throws Throwable {
Lookup inObj = samePackageInnerClass_Nested_Level2Lookup.in(SamePackageInnerClass.class);
assertClassAndMode(inObj, SamePackageInnerClass.class, FULL_ACCESS_MODE);
}
use of java.lang.invoke.MethodHandles.lookup in project openj9 by eclipse.
the class LookupInTests method testLookup_PrivateOuterClassLookup.
/**
* Validates access restrictions stored in a new Lookup object created from an old Lookup object
* where the new lookup class is a non-public outer class in the same Java source file as the old lookup class
* @throws Throwable
*/
@Test(groups = { "level.sanity" })
public void testLookup_PrivateOuterClassLookup() throws Throwable {
Lookup inObj = localLookup.in(PackageClass.class);
assertClassAndMode(inObj, PackageClass.class, FULL_ACCESS_MODE);
}
use of java.lang.invoke.MethodHandles.lookup in project openj9 by eclipse.
the class LookupInTests method testLookup_ProtectedInnerClassLookup_CrossPackage.
/**
* Validates access restrictions stored in a new Lookup object created from an old Lookup object
* where the new lookup class is a protected inner class inside a top level class belonging to a different
* package than the old lookup class.
* @throws Throwable
*/
@Test(groups = { "level.sanity" })
public void testLookup_ProtectedInnerClassLookup_CrossPackage() throws Throwable {
Lookup inObj = packageExamplesLookup.in(SamePackageInnerClass_Protected.class);
assertClassAndMode(inObj, SamePackageInnerClass_Protected.class, MODULE_PUBLIC_MODE);
}
use of java.lang.invoke.MethodHandles.lookup in project openj9 by eclipse.
the class LookupInTests method testLookup_SamePackageLookup_Subclass.
/**
* Validates that, if a new lookup class differs from the old one, protected members will not be
* accessible by virtue of inheritance. The test creates a new Lookup object from an old Lookup object
* where the new Lookup class is a subclass of the original lookup class.
* @throws Throwable
*/
@Test(groups = { "level.sanity" })
public void testLookup_SamePackageLookup_Subclass() throws Throwable {
Lookup inObject = samePackageExampleLookup.in(SamePackageExampleSubclass.class);
assertClassAndMode(inObject, SamePackageExampleSubclass.class, MODULE_PUBLIC_PACKAGE_MODE);
}
Aggregations