cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r178779 - /cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java
Date Fri, 27 May 2005 14:09:31 GMT
Author: vgritsenko
Date: Fri May 27 07:09:30 2005
New Revision: 178779

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

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

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java?rev=178779&r1=178778&r2=178779&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java Fri May 27 07:09:30
2005
@@ -15,21 +15,11 @@
  */
 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.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.ServiceSelector;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.ResourceNotFoundException;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
@@ -39,6 +29,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;
@@ -59,6 +50,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.
  *
@@ -80,7 +82,7 @@
     }
 
     /** Avoid instantiation */
-    protected SourceUtil() {
+    private SourceUtil() {
     }
 
     /**
@@ -510,27 +512,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",
@@ -705,8 +698,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