You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/08/09 15:57:04 UTC
cvs commit: jakarta-commons-sandbox/jexl/src/java/org/apache/commons/jexl/util/introspection UberspectImpl.java
jstrachan 2002/08/09 06:57:04
Modified: jexl/src/java/org/apache/commons/jexl/util/introspection
UberspectImpl.java
Log:
Patch so that boolean property getters are found first, before a get("foo") is called.
So for a given property foo the order of priority is to look for
* getFoo()
* isFoo()
* get("foo")
So this change just makes boolean getters (isFoo()) of equal priority as other types of getters, like getFoo().
It also has a nice side effect of making the unit tests work as I'd reused Foo for the isSimple() test which also had a get(String) method.
Revision Changes Path
1.2 +7 -7 jakarta-commons-sandbox/jexl/src/java/org/apache/commons/jexl/util/introspection/UberspectImpl.java
Index: UberspectImpl.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jexl/src/java/org/apache/commons/jexl/util/introspection/UberspectImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UberspectImpl.java 5 Aug 2002 05:04:53 -0000 1.1
+++ UberspectImpl.java 9 Aug 2002 13:57:04 -0000 1.2
@@ -193,21 +193,21 @@
executor = new PropertyExecutor(rlog,introspector, claz, identifier);
/*
- * if that didn't work, look for get("foo")
+ * look for boolean isFoo()
*/
- if (executor.isAlive() == false)
+ if( executor.isAlive() == false)
{
- executor = new GetExecutor(rlog, introspector, claz, identifier);
+ executor = new BooleanPropertyExecutor(rlog, introspector, claz, identifier);
}
/*
- * finally, look for boolean isFoo()
+ * if that didn't work, look for get("foo")
*/
- if( executor.isAlive() == false)
+ if (executor.isAlive() == false)
{
- executor = new BooleanPropertyExecutor(rlog, introspector, claz, identifier);
+ executor = new GetExecutor(rlog, introspector, claz, identifier);
}
return (executor != null) ? new VelGetterImpl(executor) : null;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>