jdk/src/share/classes/java/beans/PropertyDescriptor.java
changeset 13356 89a34c00fd8c
parent 11668 138b661e3841
child 13547 508a6b13f804
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Fri Jul 27 22:39:44 2012 -0700
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Mon Jul 30 13:35:10 2012 +0400
@@ -210,12 +210,13 @@
                 // The read method was explicitly set to null.
                 return null;
             }
+            String nextMethodName = Introspector.GET_PREFIX + getBaseName();
             if (readMethodName == null) {
                 Class<?> type = getPropertyType0();
                 if (type == boolean.class || type == null) {
                     readMethodName = Introspector.IS_PREFIX + getBaseName();
                 } else {
-                    readMethodName = Introspector.GET_PREFIX + getBaseName();
+                    readMethodName = nextMethodName;
                 }
             }
 
@@ -225,8 +226,8 @@
             // methods.  If an "is" method exists, this is the official
             // reader method so look for this one first.
             readMethod = Introspector.findMethod(cls, readMethodName, 0);
-            if (readMethod == null) {
-                readMethodName = Introspector.GET_PREFIX + getBaseName();
+            if ((readMethod == null) && !readMethodName.equals(nextMethodName)) {
+                readMethodName = nextMethodName;
                 readMethod = Introspector.findMethod(cls, readMethodName, 0);
             }
             try {