< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodHandles.java

Print this page
rev 58768 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: alanb, cjplummer, coleenp, dholmes, dlong, forax, jlahoda, psandoz, plevart, vromero
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com, jan.lahoda@oracle.com, amy.lu@oracle.com
rev 58769 : [mq]: type-descriptor-name


1791          *
1792          * <p> Let {@code L} be the defining class loader of the lookup class of this {@code Lookup}.
1793          *
1794          * <p> {@code C} is derived with name {@code CN}, class loader {@code L}, and
1795          * purported representation {@code newBytes} as if by the rules of JVMS {@jvms 5.3.5},
1796          * with the following adjustments:
1797          * <ul>
1798          * <li> The constant indicated by {@code this_class} is permitted to specify a name
1799          * that includes a single {@code "."} character, even though this is not a valid
1800          * binary class or interface name in internal form.</li>
1801          *
1802          * <li> The Java Virtual Machine marks {@code L} as the defining class loader of {@code C},
1803          * but no class loader is recorded as an initiating class loader of {@code C}.</li>
1804          *
1805          * <li> {@code C} is considered to have the same runtime
1806          * {@linkplain Class#getPackage() package}, {@linkplain Class#getModule() module}
1807          * and {@linkplain java.security.ProtectionDomain protection domain}
1808          * as the lookup class of this {@code Lookup}.
1809          * <li> Let {@code GN} be the binary name obtained by taking {@code N}
1810          * (a binary name encoded in internal form) and replacing ASCII forward slashes with
1811          * ASCII periods. For the instance of {@link java.lang.Class} representing {@code C},
1812          * {@link Class#getName()} returns the string {@code GN + "/" + <suffix>}, even though
1813          * this is not a valid binary class or interface name.</li>







1814          * </ul>
1815          * </li>
1816          * </ol>
1817          *
1818          * <p> After {@code C} is derived, it is linked by the Java Virtual Machine.
1819          * Linkage occurs as specified in JVMS {@jvms 5.4.3}, with the following adjustments:
1820          * <ul>
1821          * <li> During verification, whenever it is necessary to load the class named
1822          * {@code CN}, the attempt succeeds, producing class {@code C}. No request is
1823          * made of any class loader.</li>
1824          *
1825          * <li> On any attempt to resolve the entry in the run-time constant pool indicated
1826          * by {@code this_class}, the symbolic reference is considered to be resolved to
1827          * {@code C} and resolution always succeeds immediately.</li>
1828          * </ul>
1829          *
1830          * <p> If the {@code initialize} parameter is {@code true},
1831          * then {@code C} is initialized by the Java Virtual Machine.
1832          *
1833          * <p> The newly created class or interface {@code C} serves as the




1791          *
1792          * <p> Let {@code L} be the defining class loader of the lookup class of this {@code Lookup}.
1793          *
1794          * <p> {@code C} is derived with name {@code CN}, class loader {@code L}, and
1795          * purported representation {@code newBytes} as if by the rules of JVMS {@jvms 5.3.5},
1796          * with the following adjustments:
1797          * <ul>
1798          * <li> The constant indicated by {@code this_class} is permitted to specify a name
1799          * that includes a single {@code "."} character, even though this is not a valid
1800          * binary class or interface name in internal form.</li>
1801          *
1802          * <li> The Java Virtual Machine marks {@code L} as the defining class loader of {@code C},
1803          * but no class loader is recorded as an initiating class loader of {@code C}.</li>
1804          *
1805          * <li> {@code C} is considered to have the same runtime
1806          * {@linkplain Class#getPackage() package}, {@linkplain Class#getModule() module}
1807          * and {@linkplain java.security.ProtectionDomain protection domain}
1808          * as the lookup class of this {@code Lookup}.
1809          * <li> Let {@code GN} be the binary name obtained by taking {@code N}
1810          * (a binary name encoded in internal form) and replacing ASCII forward slashes with
1811          * ASCII periods. For the instance of {@link java.lang.Class} representing {@code C}:
1812          * <ul>
1813          * <li> {@link Class#getName()} returns the string {@code GN + "/" + <suffix>},
1814          *      even though this is not a valid binary class or interface name.</li>
1815          * <li> {@link Class#descriptorString()} returns the string
1816          *      {@code "L" + N + "." + <suffix> + ";"},
1817          *      even though this is not a valid type descriptor name.</li>
1818          * <li> {@link Class#describeConstable()} returns an empty optional as {@code C}
1819          *      cannot be described in {@linkplain java.lang.constant.ClassDesc nominal form}.</li>
1820          * </ul>
1821          * </ul>
1822          * </li>
1823          * </ol>
1824          *
1825          * <p> After {@code C} is derived, it is linked by the Java Virtual Machine.
1826          * Linkage occurs as specified in JVMS {@jvms 5.4.3}, with the following adjustments:
1827          * <ul>
1828          * <li> During verification, whenever it is necessary to load the class named
1829          * {@code CN}, the attempt succeeds, producing class {@code C}. No request is
1830          * made of any class loader.</li>
1831          *
1832          * <li> On any attempt to resolve the entry in the run-time constant pool indicated
1833          * by {@code this_class}, the symbolic reference is considered to be resolved to
1834          * {@code C} and resolution always succeeds immediately.</li>
1835          * </ul>
1836          *
1837          * <p> If the {@code initialize} parameter is {@code true},
1838          * then {@code C} is initialized by the Java Virtual Machine.
1839          *
1840          * <p> The newly created class or interface {@code C} serves as the


< prev index next >