mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8280594: Refactor annotation invocation handler handling to use Objects.toIdentityString
Reviewed-by: bpb
This commit is contained in:
parent
b4a85cdae1
commit
e6c5f2886c
1 changed files with 1 additions and 10 deletions
|
@ -666,7 +666,7 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
|
||||||
if (!(memberType.isInstance(value) ||
|
if (!(memberType.isInstance(value) ||
|
||||||
value instanceof ExceptionProxy)) {
|
value instanceof ExceptionProxy)) {
|
||||||
value = new AnnotationTypeMismatchExceptionProxy(
|
value = new AnnotationTypeMismatchExceptionProxy(
|
||||||
objectToString(value))
|
Objects.toIdentityString(value))
|
||||||
.setMember(annotationType.members().get(name));
|
.setMember(annotationType.members().get(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -677,15 +677,6 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
|
||||||
UnsafeAccessor.setMemberValues(this, mv);
|
UnsafeAccessor.setMemberValues(this, mv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Create a textual representation of the argument without calling
|
|
||||||
* any overridable methods of the argument.
|
|
||||||
*/
|
|
||||||
private static String objectToString(Object value) {
|
|
||||||
return value.getClass().getName() + "@" +
|
|
||||||
Integer.toHexString(System.identityHashCode(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class UnsafeAccessor {
|
private static class UnsafeAccessor {
|
||||||
private static final jdk.internal.misc.Unsafe unsafe
|
private static final jdk.internal.misc.Unsafe unsafe
|
||||||
= jdk.internal.misc.Unsafe.getUnsafe();
|
= jdk.internal.misc.Unsafe.getUnsafe();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue