cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/modules/input BaseLinkModule.java RequestURIModule.java
Date Mon, 09 Jun 2003 16:30:20 GMT
haul        2003/06/09 09:30:19

  Modified:    src/java/org/apache/cocoon/components/modules/input
                        BaseLinkModule.java RequestURIModule.java
  Log:
  Replace List.add().toArray() with Object[1]
     Spotted by volker.schmitt.at.basf-it-services.com
  Make sure to return null instead of { null }
  
  Revision  Changes    Path
  1.4       +1 -1      cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/BaseLinkModule.java
  
  Index: BaseLinkModule.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/BaseLinkModule.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseLinkModule.java	8 Jun 2003 18:07:11 -0000	1.3
  +++ BaseLinkModule.java	9 Jun 2003 16:30:19 -0000	1.4
  @@ -124,7 +124,7 @@
   
           Object[] result = new Object[1];
           result[0] = getAttribute(name, modeConf, objectModel);
  -        return result;
  +        return (result == null? null : result);
   
       }
   
  
  
  
  1.2       +4 -6      cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java
  
  Index: RequestURIModule.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestURIModule.java	9 Mar 2003 00:09:03 -0000	1.1
  +++ RequestURIModule.java	9 Jun 2003 16:30:19 -0000	1.2
  @@ -57,8 +57,6 @@
   import org.apache.cocoon.environment.ObjectModelHelper;
   
   import java.util.Iterator;
  -import java.util.LinkedList;
  -import java.util.List;
   import java.util.Map;
   import java.util.Vector;
   
  @@ -99,10 +97,10 @@
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel
)
           throws ConfigurationException {
   
  -            List values = new LinkedList();
  -            values.add( this.getAttribute(name, modeConf, objectModel) );
  +            Object[] values = new Object[1];
  +            values[0] = this.getAttribute(name, modeConf, objectModel);
   
  -            return values.toArray();
  +            return (values[0] == null? null : values);
               
       }
   
  
  
  

Mime
View raw message