mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8206240: java.lang.Class.newInstance() is causing caller to leak
Reviewed-by: alanb
This commit is contained in:
parent
609d90e98a
commit
46f0fa8c20
10 changed files with 198 additions and 71 deletions
|
@ -159,4 +159,10 @@ class ReflectAccess implements jdk.internal.reflect.LangReflectAccess {
|
|||
public <T extends AccessibleObject> T getRoot(T obj) {
|
||||
return (T) obj.getRoot();
|
||||
}
|
||||
|
||||
public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
|
||||
throws IllegalAccessException, InstantiationException, InvocationTargetException
|
||||
{
|
||||
return ctor.newInstanceWithCaller(args, true, caller);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue