mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8280035: Use Class.isInstance instead of Class.isAssignableFrom where applicable
Reviewed-by: prr, rriggs
This commit is contained in:
parent
9f562ef754
commit
de74e0e25a
10 changed files with 22 additions and 25 deletions
|
@ -481,7 +481,7 @@ public class AccessibleObject implements AnnotatedElement {
|
|||
}
|
||||
// if this object is an instance member, the given object
|
||||
// must be a subclass of the declaring class of this reflected object
|
||||
if (!declaringClass.isAssignableFrom(obj.getClass())) {
|
||||
if (!declaringClass.isInstance(obj)) {
|
||||
throw new IllegalArgumentException("object is not an instance of "
|
||||
+ declaringClass.getName());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue