-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
public Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches) {
is used in a few areas to define anonymous classes such as LambdaMetaFactory (although only one use leverages the constant pool patch ing).
The defining of a class (anonymous or otherwise) within the context of a hosted class can be referred to as defining a "nest mate" class.
A subset of such functionality could be supported as a method on MethodHandle.Lookup:
public Class<?> defineNestmate(boolean anonymous, byte[] bytes)
Where the lookup class is the context for the nest, and where the method only functions if the lookup supports private access.
Code in LambdaMethodFactory and StringConcatFactory could be updated to use the public method.
- duplicates
-
JDK-8238358 Implementation of JEP 371: Hidden Classes
- Resolved
- is blocked by
-
JDK-8227415 [nestmates] IllegalAccessError using a protected method reference declared in super class in different package
- Resolved
- relates to
-
JDK-8098817 Adjust access checks for VM anonymous classes
- Closed
-
JDK-8230501 Class data support for hidden classes
- Resolved
-
JDK-8243287 Removal of Unsafe::defineAnonymousClass
- Resolved
-
JDK-6653858 dynamic languages need to be able to load anonymous classes
- Closed
-
JDK-8209676 Dynamic nestmate injection in the VM
- Closed
-
JDK-8219612 [TESTBUG] compiler.codecache.stress.Helper.TestCaseImpl can't be defined in different runtime package as its nest host
- Resolved
-
JDK-8213465 Type variable information is not always maintained for anonymous classes
- Closed
-
JDK-8212620 Provide a mechanism to allow a class/method to request filtering from the stack trace
- Open
-
JDK-8213402 [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship
- Resolved
-
JDK-8235521 Replacement API for Unsafe::ensureClassInitialized
- Resolved
-
JDK-8230502 Add support in JVM TI, JDI, and Instrumentation for hidden classes
- Closed
-
JDK-8172672 Unsafe.defineAnonymousClass should not require non-null host class argument
- Closed