--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java Mon Apr 21 16:32:41 2014 +0400
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java Mon Apr 21 20:59:59 2014 +0400
@@ -162,6 +162,16 @@
: null;
}
+ private static Method resolve(Method oldMethod, Method newMethod) {
+ if (oldMethod == null) {
+ return newMethod;
+ }
+ if (newMethod == null) {
+ return oldMethod;
+ }
+ return !oldMethod.isSynthetic() && newMethod.isSynthetic() ? oldMethod : newMethod;
+ }
+
/*
* Package-private constructor
* Merge two method descriptors. Where they conflict, give the
@@ -173,8 +183,7 @@
MethodDescriptor(MethodDescriptor x, MethodDescriptor y) {
super(x, y);
- Method method = y.methodRef.get();
- this.methodRef.set(null != method ? method : x.methodRef.get());
+ this.methodRef.set(resolve(x.methodRef.get(), y.methodRef.get()));
params = x.params;
if (y.params != null) {
params = y.params;