cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevend...@apache.org
Subject svn commit: r770136 - in /cocoon/cocoon3/trunk/cocoon-stax/src: main/java/org/apache/cocoon/stax/component/ test/java/org/apache/cocoon/stax/sample/src/
Date Thu, 30 Apr 2009 09:53:16 GMT
Author: stevendolg
Date: Thu Apr 30 09:53:16 2009
New Revision: 770136

URL: http://svn.apache.org/viewvc?rev=770136&view=rev
Log:
Fixed some minor warnings and coding issues.

Modified:
    cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/component/StAXCleaningTransformer.java
    cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/DaisyLinkRewriteTransformer.java
    cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/SubSetTransformer.java

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/component/StAXCleaningTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/component/StAXCleaningTransformer.java?rev=770136&r1=770135&r2=770136&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/component/StAXCleaningTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/component/StAXCleaningTransformer.java
Thu Apr 30 09:53:16 2009
@@ -17,6 +17,7 @@
 package org.apache.cocoon.stax.component;
 
 import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.StartElement;
 import javax.xml.stream.events.XMLEvent;
@@ -53,7 +54,7 @@
                     }
                 }
                 continue;
-            } else if (event.getEventType() == XMLEvent.COMMENT) {
+            } else if (event.getEventType() == XMLStreamConstants.COMMENT) {
                 // remove comments
                 continue;
             } else if (event.isStartElement()) {

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/DaisyLinkRewriteTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/DaisyLinkRewriteTransformer.java?rev=770136&r1=770135&r2=770136&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/DaisyLinkRewriteTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/DaisyLinkRewriteTransformer.java
Thu Apr 30 09:53:16 2009
@@ -77,12 +77,11 @@
      */
     protected String getAttributeValue(StartElement element, QName attributeName) {
         Attribute attribute = element.getAttributeByName(attributeName);
-
-        if (attribute != null) {
-            return attribute.getValue();
-        } else {
+        if (attribute == null) {
             return "";
         }
+        
+        return attribute.getValue();
     }
 
     protected String getAttributeValue(StartElement element, String attributeName) {
@@ -155,10 +154,12 @@
      * @return the expression with the correct values.
      */
     protected String replaceVariables(String expression, LinkInfo linkInfo) {
-        expression = expression.replace("{id}", linkInfo.getDocumentId());
-        expression = expression.replace("{filename}", linkInfo.getFileName());
+        String result = expression;
+        
+        result = result.replace("{id}", linkInfo.getDocumentId());
+        result = result.replace("{filename}", linkInfo.getFileName());
 
-        return expression;
+        return result;
     }
 
     /**
@@ -334,9 +335,10 @@
 
         public void setNavigationPath(String navigationPath) {
             if (navigationPath != null && navigationPath.startsWith("/")) {
-                navigationPath = navigationPath.substring(1);
+                this.navigationPath = navigationPath.substring(1);
+            } else {
+                this.navigationPath = navigationPath;
             }
-            this.navigationPath = navigationPath;
         }
 
         public void setSource(String source) {

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/SubSetTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/SubSetTransformer.java?rev=770136&r1=770135&r2=770136&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/SubSetTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/test/java/org/apache/cocoon/stax/sample/src/SubSetTransformer.java
Thu Apr 30 09:53:16 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.cocoon.stax.sample.src;
 
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.XMLEvent;
@@ -56,7 +57,7 @@
         XMLEvent event = null;
         while (this.getParent().hasNext()) {
             event = this.getParent().nextEvent();
-            if (event.isStartDocument() || event.isEndDocument() || event.getEventType()
== XMLEvent.COMMENT) {
+            if (event.isStartDocument() || event.isEndDocument() || event.getEventType()
== XMLStreamConstants.COMMENT) {
                 XMLEvent actualOld = this.lastEvent;
                 this.lastEvent = event;
                 if (!this.started) {



Mime
View raw message