|
85 | 85 | import org.graalvm.nativeimage.Platform;
|
86 | 86 | import org.graalvm.nativeimage.Platforms;
|
87 | 87 | import org.graalvm.nativeimage.c.function.CFunctionPointer;
|
88 |
| -import org.graalvm.nativeimage.impl.InternalPlatform; |
89 | 88 |
|
90 | 89 | import com.oracle.svm.core.BuildPhaseProvider.AfterHostedUniverse;
|
91 | 90 | import com.oracle.svm.core.BuildPhaseProvider.CompileQueueFinished;
|
@@ -1567,28 +1566,24 @@ private static Constructor<?>[] copyConstructors(Constructor<?>[] original) {
|
1567 | 1566 | private native Constructor<?> getEnclosingConstructor();
|
1568 | 1567 |
|
1569 | 1568 | @Substitute
|
1570 |
| - @Platforms(InternalPlatform.NATIVE_ONLY.class) |
1571 | 1569 | @CallerSensitive
|
1572 | 1570 | private static Class<?> forName(String className) throws Throwable {
|
1573 | 1571 | return forName(className, Reflection.getCallerClass());
|
1574 | 1572 | }
|
1575 | 1573 |
|
1576 | 1574 | @Substitute
|
1577 |
| - @Platforms(InternalPlatform.NATIVE_ONLY.class) |
1578 | 1575 | @CallerSensitiveAdapter
|
1579 | 1576 | private static Class<?> forName(String className, Class<?> caller) throws Throwable {
|
1580 |
| - return forName(className, true, caller.getClassLoader(), caller); |
| 1577 | + return forName(className, true, caller == null ? ClassLoader.getSystemClassLoader() : caller.getClassLoader(), caller); |
1581 | 1578 | }
|
1582 | 1579 |
|
1583 | 1580 | @Substitute
|
1584 |
| - @Platforms(InternalPlatform.NATIVE_ONLY.class) |
1585 | 1581 | @CallerSensitive
|
1586 | 1582 | private static Class<?> forName(Module module, String className) throws Throwable {
|
1587 | 1583 | return forName(module, className, Reflection.getCallerClass());
|
1588 | 1584 | }
|
1589 | 1585 |
|
1590 | 1586 | @Substitute
|
1591 |
| - @Platforms(InternalPlatform.NATIVE_ONLY.class) |
1592 | 1587 | @CallerSensitiveAdapter
|
1593 | 1588 | @TargetElement(onlyWith = JDK21OrEarlier.class)
|
1594 | 1589 | private static Class<?> forName(@SuppressWarnings("unused") Module module, String className, Class<?> caller) throws Throwable {
|
|
0 commit comments