You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2004/08/30 04:16:38 UTC
cvs commit: jakarta-commons/jelly/src/java/org/apache/commons/jelly JellyContext.java
dion 2004/08/29 19:16:38
Modified: jelly/src/java/org/apache/commons/jelly JellyContext.java
Log:
Apply fix for Jelly-78
Revision Changes Path
1.54 +7 -0 jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java
Index: JellyContext.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- JellyContext.java 12 Aug 2004 05:34:34 -0000 1.53
+++ JellyContext.java 30 Aug 2004 02:16:37 -0000 1.54
@@ -161,6 +161,10 @@
*/
public Object findVariable(String name) {
Object answer = variables.get(name);
+ boolean definedHere = answer != null || variables.containsKey(name);
+
+ if (definedHere) return answer;
+
if ( answer == null && parent != null ) {
answer = parent.findVariable(name);
}
@@ -184,7 +188,10 @@
/** @return the value of the given variable name */
public Object getVariable(String name) {
Object value = variables.get(name);
+ boolean definedHere = value != null || variables.containsKey(name);
+ if (definedHere) return value;
+
if ( value == null && isInherit() ) {
JellyContext parent = getParent();
if (parent != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org