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.invocation = Objects.requireNonNull(invocation);
|
||||||
this.guard = guard;
|
this.guard = guard;
|
||||||
this.switchPoints = switchPoint == null ? null : new SwitchPoint[] { switchPoint };
|
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;
|
this.exception = exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +231,9 @@ public class GuardedInvocation {
|
|||||||
this.invocation = Objects.requireNonNull(invocation);
|
this.invocation = Objects.requireNonNull(invocation);
|
||||||
this.guard = guard;
|
this.guard = guard;
|
||||||
this.switchPoints = switchPoints == null ? null : switchPoints.clone();
|
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;
|
this.exception = exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user