8147070: Dynalink GuardedInvocation must check the Class object passed
Reviewed-by: hannesw, mhaupt, attila
This commit is contained in:
parent
1689985910
commit
e267b166cb
@ -202,6 +202,9 @@ public class GuardedInvocation {
|
||||
this.invocation = Objects.requireNonNull(invocation);
|
||||
this.guard = guard;
|
||||
this.switchPoints = switchPoint == null ? null : new SwitchPoint[] { switchPoint };
|
||||
if (exception != null && !Throwable.class.isAssignableFrom(exception)) {
|
||||
throw new IllegalArgumentException(exception.getName() + " is not assignable from Throwable");
|
||||
}
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
@ -228,6 +231,9 @@ public class GuardedInvocation {
|
||||
this.invocation = Objects.requireNonNull(invocation);
|
||||
this.guard = guard;
|
||||
this.switchPoints = switchPoints == null ? null : switchPoints.clone();
|
||||
if (exception != null && !Throwable.class.isAssignableFrom(exception)) {
|
||||
throw new IllegalArgumentException(exception.getName() + " is not assignable from Throwable");
|
||||
}
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user