You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/04/23 16:01:46 UTC
svn commit: r937304 -
/pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
Author: gbrown
Date: Fri Apr 23 14:01:46 2010
New Revision: 937304
URL: http://svn.apache.org/viewvc?rev=937304&view=rev
Log:
Update implementation of BeanAdapter.isReadOnly() to be consistent with the Javadoc for that method, which states that it will not throw if the property is not found.
Modified:
pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
Modified: pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java?rev=937304&r1=937303&r2=937304&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java Fri Apr 23 14:01:46 2010
@@ -526,19 +526,15 @@ public class BeanAdapter implements Map<
if (key.startsWith(FIELD_PREFIX)) {
Field field = getField(type, key.substring(1));
- if (field == null) {
- throw new PropertyNotFoundException();
+ if (field != null) {
+ isReadOnly = ((field.getModifiers() & Modifier.FINAL) != 0);
}
-
- isReadOnly = ((field.getModifiers() & Modifier.FINAL) != 0);
} else {
Method getterMethod = getGetterMethod(type, key);
- if (getterMethod == null) {
- throw new PropertyNotFoundException();
+ if (getterMethod != null) {
+ Method setterMethod = getSetterMethod(type, key, getType(type, key));
+ isReadOnly = (setterMethod == null);
}
-
- Method setterMethod = getSetterMethod(type, key, getType(type, key));
- isReadOnly = (setterMethod == null);
}
return isReadOnly;