mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8302791: Add specific ClassLoader object to Proxy IllegalArgumentException message
Reviewed-by: alanb, mchung
This commit is contained in:
parent
b5b5cba7fe
commit
9f9d678591
4 changed files with 15 additions and 1 deletions
|
@ -407,6 +407,11 @@ public abstract class ClassLoader {
|
|||
return nid;
|
||||
}
|
||||
|
||||
// Returns nameAndId string for exception message printing
|
||||
String nameAndId() {
|
||||
return nameAndId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new class loader of the specified name and using the
|
||||
* specified parent class loader for delegation.
|
||||
|
|
|
@ -2663,6 +2663,10 @@ public final class System {
|
|||
Continuation continuation) {
|
||||
return StackWalker.newInstance(options, null, contScope, continuation);
|
||||
}
|
||||
|
||||
public String getLoaderNameID(ClassLoader loader) {
|
||||
return loader.nameAndId();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -878,7 +878,7 @@ public class Proxy implements java.io.Serializable {
|
|||
}
|
||||
if (type != c) {
|
||||
throw new IllegalArgumentException(c.getName() +
|
||||
" referenced from a method is not visible from class loader");
|
||||
" referenced from a method is not visible from class loader: " + JLA.getLoaderNameID(ld));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue