126
126
import jdk .internal .access .JavaLangReflectAccess ;
127
127
import jdk .internal .misc .Unsafe ;
128
128
import jdk .internal .reflect .CallerSensitive ;
129
+ import jdk .internal .reflect .CallerSensitiveAdapter ;
129
130
import jdk .internal .reflect .FieldAccessor ;
130
131
import jdk .internal .reflect .Reflection ;
131
132
import jdk .internal .reflect .ReflectionFactory ;
@@ -1346,24 +1347,28 @@ private static Constructor<?>[] copyConstructors(Constructor<?>[] original) {
1346
1347
1347
1348
@ Substitute
1348
1349
@ Platforms (InternalPlatform .NATIVE_ONLY .class )
1350
+ @ CallerSensitive
1349
1351
private static Class <?> forName (String className ) throws Throwable {
1350
1352
return forName (className , Reflection .getCallerClass ());
1351
1353
}
1352
1354
1353
1355
@ Substitute
1354
1356
@ Platforms (InternalPlatform .NATIVE_ONLY .class )
1357
+ @ CallerSensitiveAdapter
1355
1358
private static Class <?> forName (String className , Class <?> caller ) throws Throwable {
1356
1359
return forName (className , true , caller .getClassLoader (), caller );
1357
1360
}
1358
1361
1359
1362
@ Substitute
1360
1363
@ Platforms (InternalPlatform .NATIVE_ONLY .class )
1364
+ @ CallerSensitive
1361
1365
private static Class <?> forName (Module module , String className ) throws Throwable {
1362
1366
return forName (module , className , Reflection .getCallerClass ());
1363
1367
}
1364
1368
1365
1369
@ Substitute
1366
1370
@ Platforms (InternalPlatform .NATIVE_ONLY .class )
1371
+ @ CallerSensitiveAdapter
1367
1372
private static Class <?> forName (@ SuppressWarnings ("unused" ) Module module , String className , Class <?> caller ) throws Throwable {
1368
1373
/*
1369
1374
* The module system is not supported for now, therefore the module parameter is ignored and
@@ -1377,11 +1382,13 @@ private static Class<?> forName(@SuppressWarnings("unused") Module module, Strin
1377
1382
}
1378
1383
1379
1384
@ Substitute
1385
+ @ CallerSensitive
1380
1386
private static Class <?> forName (String name , boolean initialize , ClassLoader loader ) throws Throwable {
1381
1387
return forName (name , initialize , loader , Reflection .getCallerClass ());
1382
1388
}
1383
1389
1384
1390
@ Substitute
1391
+ @ CallerSensitiveAdapter
1385
1392
private static Class <?> forName (String name , boolean initialize , ClassLoader loader , @ SuppressWarnings ("unused" ) Class <?> caller ) throws Throwable {
1386
1393
if (name == null ) {
1387
1394
throw new NullPointerException ();
0 commit comments