cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r1127999 - in /cocoon/cocoon3/trunk/cocoon-sitemap: ./ src/main/java/org/apache/cocoon/sitemap/expression/
Date Thu, 26 May 2011 17:35:48 GMT
Author: reinhard
Date: Thu May 26 17:35:48 2011
New Revision: 1127999

URL: http://svn.apache.org/viewvc?rev=1127999&view=rev
Log:
formatting
improve names
get rid of compiler warnings

Modified:
    cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreterFactory.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/PrototypeLanguageInterpreterFactory.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml?rev=1127999&r1=1127998&r2=1127999&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml Thu May 26 17:35:48 2011
@@ -59,6 +59,10 @@
       <groupId>commons-jexl</groupId>
       <artifactId>commons-jexl</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-spring-configurator</artifactId>
+    </dependency>
 
     <!-- Test dependencies -->
     <dependency>
@@ -71,12 +75,5 @@
       <artifactId>junit-addons</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-    	<groupId>org.apache.cocoon</groupId>
-    	<artifactId>cocoon-spring-configurator</artifactId>
-    	<version>2.1.0</version>
-    	<type>jar</type>
-    	<scope>compile</scope>
-    </dependency>
   </dependencies>
 </project>

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java?rev=1127999&r1=1127998&r2=1127999&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java
Thu May 26 17:35:48 2011
@@ -28,17 +28,17 @@ public class JexlLanguageInterpreter imp
 
     @SuppressWarnings("unchecked")
     public String resolve(String expression, ObjectModel objectModel) {
-        Object o = null;
+        Object result = null;
         try {
             Expression e = ExpressionFactory.createExpression(expression);
             JexlContext jc = JexlHelper.createContext();
             jc.getVars().putAll(objectModel.getParameters());
 
-            o = e.evaluate(jc);
+            result = e.evaluate(jc);
         } catch (Exception e1) {
             e1.printStackTrace();
         }
 
-        return o != null ? o.toString() : "";
+        return result != null ? result.toString() : "";
     }
 }

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreterFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreterFactory.java?rev=1127999&r1=1127998&r2=1127999&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreterFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreterFactory.java
Thu May 26 17:35:48 2011
@@ -21,5 +21,4 @@ package org.apache.cocoon.sitemap.expres
 public interface LanguageInterpreterFactory {
 
     LanguageInterpreter getLanguageInterpreter(String language);
-
 }

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/PrototypeLanguageInterpreterFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/PrototypeLanguageInterpreterFactory.java?rev=1127999&r1=1127998&r2=1127999&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/PrototypeLanguageInterpreterFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/PrototypeLanguageInterpreterFactory.java
Thu May 26 17:35:48 2011
@@ -27,12 +27,11 @@ public class PrototypeLanguageInterprete
     private ApplicationContext applicationContext;
 
     public LanguageInterpreter getLanguageInterpreter(String language) {
-        return (LanguageInterpreter) this.applicationContext.getBean("expression-language:"
+ language,
+        return this.applicationContext.getBean("expression-language:" + language,
                 LanguageInterpreter.class);
     }
 
     public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
         this.applicationContext = applicationContext;
     }
-
 }

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java?rev=1127999&r1=1127998&r2=1127999&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java
Thu May 26 17:35:48 2011
@@ -23,22 +23,24 @@ import org.apache.cocoon.sitemap.objectm
 import org.springframework.beans.factory.annotation.Autowired;
 
 /**
- * Interpreter that will look up the properties with help of the spring configurator.
- * This is the cocoon 2.2 correspondent of {global:...} input module. 
+ * Interpreter that will look up the properties with help of the spring configurator. This
is the cocoon 2.2
+ * correspondent of {global:...} input module.
  */
 public class SettingsInterpreter implements LanguageInterpreter {
-    
+
     @Autowired
-    Settings settings;
+    private Settings settings;
 
     public String resolve(String expression, ObjectModel objectModel) {
-        Object o = null;
+        Object result = null;
+
         try {
-            o=settings.getProperty(expression);
-        } catch (Exception e1) {
-            e1.printStackTrace();
+            result = this.settings.getProperty(expression);
+        } catch (Exception e) {
+            e.printStackTrace();
         }
-        return o != null ? o.toString() : "";
+
+        return result != null ? result.toString() : "";
     }
 
 }



Mime
View raw message