cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r579022 - /cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
Date Tue, 25 Sep 2007 00:12:12 GMT
Author: vgritsenko
Date: Mon Sep 24 17:11:55 2007
New Revision: 579022

URL: http://svn.apache.org/viewvc?rev=579022&view=rev
Log:
minor cleanup

Modified:
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java?rev=579022&r1=579021&r2=579022&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
Mon Sep 24 17:11:55 2007
@@ -34,8 +34,8 @@
  */
 public class Substitutions {
 
-    final private List substitutions;
-    final private boolean hasSubstitutions;
+    private final List substitutions;
+    private final boolean hasSubstitutions;
 
     public Substitutions(StringTemplateParser stringTemplateParser, Locator location, String
stringTemplate) throws SAXException {
         this(stringTemplateParser, location, new StringReader(stringTemplate));
@@ -47,7 +47,7 @@
     }
 
     private Substitutions(StringTemplateParser stringTemplateParser, Locator location, Reader
in) throws SAXException {
-        this.substitutions = stringTemplateParser.parseSubstitutions( in, "", location );
+        this.substitutions = stringTemplateParser.parseSubstitutions(in, "", location);
         this.hasSubstitutions = !substitutions.isEmpty();
     }
 
@@ -69,9 +69,11 @@
 
     public String toString(Locator location, ObjectModel objectModel) throws SAXException
{
         StringBuffer buf = new StringBuffer();
-        Iterator iterSubst = iterator();
-        while (iterSubst.hasNext()) {
-            Subst subst = (Subst) iterSubst.next();
+
+        Iterator i = iterator();
+        while (i.hasNext()) {
+            Subst subst = (Subst) i.next();
+
             Object val;
             try {
                 val = subst.getValue(objectModel);
@@ -81,8 +83,12 @@
             //} catch (Error err) {
             //    throw new SAXParseException(err.getMessage(), location, new ErrorHolder(err));
             }
-            buf.append(val != null ? val.toString() : "");
+
+            if (val != null) {
+                buf.append(val.toString());
+            }
         }
+
         return buf.toString();
     }
 }



Mime
View raw message