Skip to content
Permalink
Browse files
8280594: Refactor annotation invocation handler handling to use Objec…
…ts.toIdentityString

Reviewed-by: bpb
  • Loading branch information
jddarcy committed Apr 20, 2022
1 parent b4a85cd commit e6c5f28
Showing 1 changed file with 1 addition and 10 deletions.
@@ -666,7 +666,7 @@ private void readObject(java.io.ObjectInputStream s)
if (!(memberType.isInstance(value) ||
value instanceof ExceptionProxy)) {
value = new AnnotationTypeMismatchExceptionProxy(
objectToString(value))
Objects.toIdentityString(value))
.setMember(annotationType.members().get(name));
}
}
@@ -677,15 +677,6 @@ private void readObject(java.io.ObjectInputStream s)
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 final jdk.internal.misc.Unsafe unsafe
= jdk.internal.misc.Unsafe.getUnsafe();

1 comment on commit e6c5f28

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.