cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r558340 - in /cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src: main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java
Date Sat, 21 Jul 2007 16:27:05 GMT
Author: gkossakowski
Date: Sat Jul 21 09:27:04 2007
New Revision: 558340

URL: http://svn.apache.org/viewvc?view=rev&rev=558340
Log:
COCOON-2086: Added special handling for "this" map key and test case for it.

Modified:
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java?view=diff&rev=558340&r1=558339&r2=558340
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/ObjectModelImpl.java
Sat Jul 21 09:27:04 2007
@@ -59,6 +59,13 @@
         }
     }
     
+    public Object get(Object key) {
+        //FIXME: This should be done more elegantly
+        if ("this".equals(key))
+            return this;
+        return super.get(key);
+    }
+    
     public Map getAll() {
         return UnmodifiableMap.decorate(multiValueMap);
     }

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java?view=diff&rev=558340&r1=558339&r2=558340
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/objectmodel/ObjectModelImplTestCase.java
Sat Jul 21 09:27:04 2007
@@ -105,4 +105,9 @@
         assertTrue(objectModel.getAll().isEmpty());
     }
     
+    public void testThis() {
+        ObjectModel objectModel = new ObjectModelImpl();
+        assertEquals(objectModel, objectModel.get("this"));
+    }
+    
 }



Mime
View raw message