cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r178777 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
Date Fri, 27 May 2005 14:02:11 GMT
Author: vgritsenko
Date: Fri May 27 07:02:09 2005
New Revision: 178777

URL: http://svn.apache.org/viewcvs?rev=178777&view=rev
Log:
remove unreachable code

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java?rev=178777&r1=178776&r2=178777&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
Fri May 27 07:02:09 2005
@@ -15,17 +15,6 @@
  */
 package org.apache.cocoon.components.source;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.transform.OutputKeys;
-
 import org.apache.avalon.framework.component.Component;
 import org.apache.avalon.framework.component.ComponentException;
 import org.apache.avalon.framework.component.ComponentManager;
@@ -33,6 +22,7 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.ResourceNotFoundException;
 import org.apache.cocoon.components.CocoonComponentManager;
@@ -42,6 +32,7 @@
 import org.apache.cocoon.xml.XMLUtils;
 import org.apache.cocoon.xml.dom.DOMBuilder;
 import org.apache.cocoon.xml.dom.DOMStreamer;
+
 import org.apache.excalibur.source.ModifiableSource;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
@@ -62,6 +53,17 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
+import javax.xml.transform.OutputKeys;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
 /**
  * This class contains some utility methods for the source resolving.
  *
@@ -83,7 +85,7 @@
     }
 
     /** Avoid instantiation */
-    protected SourceUtil() {
+    private SourceUtil() {
     }
 
     /**
@@ -586,27 +588,18 @@
                 resourceParameters.hasParameters()) {
             int pos = uri.indexOf(";jsessionid=");
 
-            if (!uri.startsWith("cocoon:")) {
-                // It looks like this block is never called (JT)
-                if (pos!=-1) {
-                    uri = uri.substring(0, pos);
-                }
-                uri = org.apache.excalibur.source.SourceUtil.appendParameters(uri, resourceParameters);
+            StringBuffer buf;
+            if (pos == -1) {
+                buf = new StringBuffer(uri);
             } else {
-                StringBuffer buf;
-
-                if (pos == -1) {
-                    buf = new StringBuffer(uri);
-                } else {
-                    buf = new StringBuffer(uri.substring(0, pos));
-                }
-                buf.append(((uri.indexOf('?') == -1) ? '?' : '&'));
-                buf.append(resourceParameters.getEncodedQueryString());
-                uri = buf.toString();
+                buf = new StringBuffer(uri.substring(0, pos));
             }
+            buf.append(((uri.indexOf('?') == -1) ? '?' : '&'));
+            buf.append(resourceParameters.getEncodedQueryString());
+            uri = buf.toString();
         }
-        Map resolverParameters = new java.util.HashMap();
 
+        Map resolverParameters = new HashMap();
         resolverParameters.put(SourceResolver.METHOD, method);
         if (typeParameters != null) {
             String encoding = typeParameters.getParameter("encoding",
@@ -780,8 +773,7 @@
 
         Source source = null;
         try {
-            source = SourceUtil.getSource(location, typeParameters,
-                                          parameters, resolver);
+            source = SourceUtil.getSource(location, typeParameters, parameters, resolver);
             Document doc = SourceUtil.toDOM(source);
 
             DocumentFragment fragment = doc.createDocumentFragment();



Mime
View raw message