mirror of
https://github.com/openjdk/jdk7u.git
synced 2025-12-10 10:13:47 -06:00
8277672: Better invocation handler handling
Reviewed-by: yan Backport-of: 0691804665559f1935b7361d5f1207ac46f823f0
This commit is contained in:
parent
ee04280526
commit
f7b710fcb3
@ -457,8 +457,8 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
|
||||
if (!(memberType.isInstance(value) ||
|
||||
value instanceof ExceptionProxy)) {
|
||||
value = new AnnotationTypeMismatchExceptionProxy(
|
||||
value.getClass() + "[" + value + "]").setMember(
|
||||
annotationType.members().get(name));
|
||||
objectToString(value))
|
||||
.setMember(annotationType.members().get(name));
|
||||
}
|
||||
}
|
||||
mv.put(name, value);
|
||||
@ -468,6 +468,15 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
|
||||
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 sun.misc.Unsafe unsafe;
|
||||
private static final long typeOffset;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user