cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r416663 - in /cocoon/trunk/blocks: cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/ cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ cocoon-forms/cocoon-forms-impl/src/main/...
Date Fri, 23 Jun 2006 10:22:42 GMT
Author: cziegeler
Date: Fri Jun 23 03:22:31 2006
New Revision: 416663

URL: http://svn.apache.org/viewvc?rev=416663&view=rev
Log:
Cleanup

Modified:
    cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModelDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/JavaScriptAspectWeaver.java
    cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/ws/EndpointDefinition.java
    cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
    cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/generation/RequestParameterGenerator.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java

Modified: cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
(original)
+++ cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
Fri Jun 23 03:22:31 2006
@@ -47,7 +47,6 @@
 import org.apache.cocoon.components.sax.XMLByteStreamCompiler;
 import org.apache.cocoon.components.sax.XMLByteStreamInterpreter;
 import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.transformation.helpers.TextRecorder;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
 
 import org.apache.commons.lang.StringEscapeUtils;

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
Fri Jun 23 03:22:31 2006
@@ -21,7 +21,6 @@
 
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.cocoon.forms.binding.library.Library;
-import org.apache.cocoon.forms.formmodel.Form;
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.util.jxpath.DOMFactory;
 import org.apache.commons.jxpath.JXPathContext;

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java
Fri Jun 23 03:22:31 2006
@@ -17,11 +17,11 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.avalon.framework.CascadingRuntimeException;
-import org.apache.cocoon.matching.helpers.WildcardHelper;
+import org.apache.cocoon.util.WildcardMatcherHelper;
 import org.apache.excalibur.source.SourceException;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.source.TraversableSource;
@@ -35,10 +35,10 @@
     
     private TreeModelHelper helper = new TreeModelHelper(this);
     
-    private int[][] fileIncludePatterns = SourceTreeModelDefinition.NO_PATTERNS;
-    private int[][] fileExcludePatterns = SourceTreeModelDefinition.NO_PATTERNS;
-    private int[][] dirIncludePatterns = SourceTreeModelDefinition.NO_PATTERNS;
-    private int[][] dirExcludePatterns = SourceTreeModelDefinition.NO_PATTERNS;
+    private List fileIncludePatterns;
+    private List fileExcludePatterns;
+    private List dirIncludePatterns;
+    private List dirExcludePatterns;
     
     /** optimization hint: don't filter child collections if there are no patterns */
     private boolean hasPatterns = false;
@@ -116,19 +116,15 @@
         return result;
     }
     
-    private boolean matches(TraversableSource src, int[][]include, int[][]exclude) {
+    private boolean matches(TraversableSource src, List includes, List excludes) {
         boolean matches = true;
-        String name = src.getName();
-        
-        //FIXME: match allowed a null Map very recently. Replace it by null once 2.1.8 is
out,
-        // we will gain a few cycles.
-        HashMap junk = new HashMap();
+        final String name = src.getName();
         
         // check include patterns
-        if (include != null && include.length > 0) {
+        if (includes != null && includes.size() > 0) {
             matches = false;
-            check: for (int i = 0; i < include.length; i++) {
-                if (WildcardHelper.match(junk, name, include[i])) {
+            check: for (int i = 0; i < includes.size(); i++) {
+                if (WildcardMatcherHelper.match((String)includes.get(i), name) != null) {
                     matches = true;
                     break check;
                 }
@@ -136,9 +132,9 @@
         }
         
         // check exclude patterns
-        if (matches && exclude != null && exclude.length > 0) {
-            check: for (int i = 0; i < exclude.length; i++) {
-                if (WildcardHelper.match(junk, name, exclude[i])) {
+        if (matches && excludes != null && excludes.size() > 0) {
+            check: for (int i = 0; i < excludes.size(); i++) {
+                if (WildcardMatcherHelper.match((String)excludes.get(i), name) != null) {
                     matches = false;
                     break check;
                 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModelDefinition.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModelDefinition.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModelDefinition.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModelDefinition.java
Fri Jun 23 03:22:31 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.cocoon.forms.formmodel.tree;
 
+import java.util.List;
+
 import org.apache.excalibur.source.SourceResolver;
 
 /**
@@ -24,45 +26,44 @@
  */
 public class SourceTreeModelDefinition implements TreeModelDefinition {
 
-    public static final int[][] NO_PATTERNS = new int[0][];
     private String url;
-    private int[][] fileIncludePatterns = NO_PATTERNS;
-    private int[][] fileExcludePatterns = NO_PATTERNS;
-    private int[][] dirIncludePatterns = NO_PATTERNS;
-    private int[][] dirExcludePatterns = NO_PATTERNS;
+    private List fileIncludePatterns;
+    private List fileExcludePatterns;
+    private List dirIncludePatterns;
+    private List dirExcludePatterns;
     private SourceResolver resolver;
 
     public void setURL(String url) {
         this.url = url;
     }
 
-    public void setFilePatterns(int[][] include, int[][] exclude) {
-        this.fileIncludePatterns = include;
-        this.fileExcludePatterns = exclude;
+    public void setFilePatterns(List includes, List excludes) {
+        this.fileIncludePatterns = includes;
+        this.fileExcludePatterns = excludes;
     }
 
-    public void setDirectoryPatterns(int[][] include, int[][] exclude) {
-        this.dirIncludePatterns = include;
-        this.dirExcludePatterns = exclude;
+    public void setDirectoryPatterns(List includes, List excludes) {
+        this.dirIncludePatterns = includes;
+        this.dirExcludePatterns = excludes;
     }
     
     public TreeModel createInstance() {
         return new SourceTreeModel(this);
     }
 
-    public int[][] getDirectoryExcludePatterns() {
+    public List getDirectoryExcludePatterns() {
         return dirExcludePatterns;
     }
 
-    public int[][] getDirectoryIncludePatterns() {
+    public List getDirectoryIncludePatterns() {
         return dirIncludePatterns;
     }
 
-    public int[][] getFileExcludePatterns() {
+    public List getFileExcludePatterns() {
         return fileExcludePatterns;
     }
 
-    public int[][] getFileIncludePatterns() {
+    public List getFileIncludePatterns() {
         return fileIncludePatterns;
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java
Fri Jun 23 03:22:31 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.cocoon.forms.formmodel.tree.builder;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
@@ -23,7 +26,6 @@
 import org.apache.cocoon.forms.formmodel.tree.SourceTreeModelDefinition;
 import org.apache.cocoon.forms.formmodel.tree.TreeModelDefinition;
 import org.apache.cocoon.forms.util.DomHelper;
-import org.apache.cocoon.matching.helpers.WildcardHelper;
 import org.apache.excalibur.source.SourceResolver;
 import org.w3c.dom.Element;
 
@@ -37,12 +39,17 @@
 
     private ServiceManager manager;
 
+    /**
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     */
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
     }
 
+    /**
+     * @see org.apache.cocoon.forms.formmodel.tree.builder.TreeModelDefinitionBuilder#build(org.w3c.dom.Element)
+     */
     public TreeModelDefinition build(Element modelElt) throws Exception {
-        
         SourceTreeModelDefinition definition = new SourceTreeModelDefinition();
         
         definition.setURL(DomHelper.getAttribute(modelElt, "src"));
@@ -64,17 +71,17 @@
         return definition;
     }
     
-    int[][] getPatterns(Element parent, String name) throws Exception {
+    protected List getPatterns(Element parent, String name) throws Exception {
         Element[] children = DomHelper.getChildElements(parent, FormsConstants.DEFINITION_NS,
name);
 
         if (children.length == 0) {
             return null;
         }
 
-        int[][] result = new int[children.length][];
+        final List result = new ArrayList();
         for (int i = 0; i < children.length; i++) {
-            String pattern = DomHelper.getAttribute(children[i], "pattern");
-            result[i] = WildcardHelper.compilePattern(pattern);
+            final String pattern = DomHelper.getAttribute(children[i], "pattern");
+            result.add(pattern);
         }
         return result;
     }

Modified: cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/JavaScriptAspectWeaver.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/JavaScriptAspectWeaver.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/JavaScriptAspectWeaver.java
(original)
+++ cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/JavaScriptAspectWeaver.java
Fri Jun 23 03:22:31 2006
@@ -25,7 +25,6 @@
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
@@ -37,7 +36,7 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
-import org.apache.cocoon.matching.helpers.WildcardHelper;
+import org.apache.cocoon.util.WildcardMatcherHelper;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 
@@ -664,9 +663,8 @@
                 while( li.hasNext() ) {
                     Interceptor interceptor = (Interceptor) li.next();
                     interceptor.setBaseScript( interceptionList.getSourceScript() );    
           
-                    boolean success = WildcardHelper.match( 
-                        new HashMap(), functionName + Interceptor.DELIMITER + eventType,

-                        WildcardHelper.compilePattern( interceptor.getName() ));
+                    boolean success = WildcardMatcherHelper.match( 
+                            interceptor.getName(), functionName + Interceptor.DELIMITER +
eventType) != null;
                     if( success ) {
                         matchingInterceptors.add( interceptor );                        
                     }

Modified: cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/ws/EndpointDefinition.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/ws/EndpointDefinition.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/ws/EndpointDefinition.java
(original)
+++ cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/ws/EndpointDefinition.java
Fri Jun 23 03:22:31 2006
@@ -131,7 +131,6 @@
      * Returns an object representation of the named service.
      *
      * @param serviceName
-     * @return
      */
     private Service getServiceNamed(String serviceName) {
         return wsdlDef.getService(new QName(namespaceURI, serviceName));
@@ -165,7 +164,6 @@
      * Returns an object representation of the named port.
      *
      * @param portName
-     * @return
      */
     private Port getPortNamed(String portName) {
         Map serviceMap = wsdlDef.getServices();
@@ -210,7 +208,6 @@
      * Tests if a port has a SOAP binding.
      *
      * @param port
-     * @return
      */
     private boolean hasSoapBinding(Port port) {
         Iterator it = port.getExtensibilityElements().iterator();

Modified: cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl/DelayRefresher.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
(original)
+++ cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
Fri Jun 23 03:22:31 2006
@@ -298,7 +298,7 @@
 	}
 
 	/**
-	 * @return
+	 *
 	 */
 	private Configuration readRefreshJobConfiguration() {
 		SAXConfigurationHandler b = new SAXConfigurationHandler();

Modified: cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/generation/RequestParameterGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/generation/RequestParameterGenerator.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/generation/RequestParameterGenerator.java
(original)
+++ cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/generation/RequestParameterGenerator.java
Fri Jun 23 03:22:31 2006
@@ -300,26 +300,26 @@
          * to the pipeline.</p>
          *
          * <p>In this case, then the validity of this instance, by itself, is always
-         * {@link SourceValidity.VALID}, as (in theory) Cocoon always accesses us
+         * {@link SourceValidity#VALID}, as (in theory) Cocoon always accesses us
          * with the correct uniquely identifying key.</p>
          *
          * @see SourceValidity#isValid()
          */
         public int isValid() {
-            return(SourceValidity.VALID);
+            return SourceValidity.VALID;
         }
 
         /**
          * <p>Compare the validity against another {@link SourceValidity}.</p>
          *
-         * <p>This method will return {@link SourceValidity.VALID} if and only if
+         * <p>This method will return {@link SourceValidity#VALID} if and only if
          * this instance {@link #equals equals} the specified validity, and
-         * {@link SourceValidity.INVALID} in all other cases.</p>
+         * {@link SourceValidity#INVALID} in all other cases.</p>
          *
          * @see SourceValidity#isValid(SourceValidity)
          */
         public int isValid(SourceValidity validity) {
-            return(this.equals(validity)? VALID: INVALID);
+            return (this.equals(validity)? VALID: INVALID);
         }
 
         /**

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java?rev=416663&r1=416662&r2=416663&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
Fri Jun 23 03:22:31 2006
@@ -25,7 +25,6 @@
 import org.apache.cocoon.components.expression.ExpressionException;
 import org.apache.cocoon.components.expression.jexl.JSIntrospector;
 import org.apache.cocoon.components.flow.FlowHelper;
-import org.apache.cocoon.environment.TemplateObjectModelHelper;
 import org.apache.cocoon.template.environment.FlowObjectModelHelper;
 import org.apache.commons.jexl.util.introspection.Info;
 import org.mozilla.javascript.Context;



Mime
View raw message