You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2003/06/09 19:16:10 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/modules/input RequestURIModule.java BaseLinkModule.java

haul        2003/06/09 10:16:10

  Modified:    src/java/org/apache/cocoon/components/modules/input
                        RequestURIModule.java BaseLinkModule.java
  Log:
  Error spotted by joerg and further optimization by volker
  saves creating Object[1] if null
  
  Revision  Changes    Path
  1.3       +4 -5      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RequestURIModule.java	9 Jun 2003 16:30:19 -0000	1.2
  +++ RequestURIModule.java	9 Jun 2003 17:16:09 -0000	1.3
  @@ -97,11 +97,10 @@
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
  -            Object[] values = new Object[1];
  -            values[0] = this.getAttribute(name, modeConf, objectModel);
  +            Object values = new Object[1];
  +            values = this.getAttribute(name, modeConf, objectModel);
   
  -            return (values[0] == null? null : values);
  -            
  +            return (values == null? null : new Object[]{values});            
       }
   
   }
  
  
  
  1.5       +3 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BaseLinkModule.java	9 Jun 2003 16:30:19 -0000	1.4
  +++ BaseLinkModule.java	9 Jun 2003 17:16:09 -0000	1.5
  @@ -122,10 +122,9 @@
           final Map objectModel)
           throws ConfigurationException {
   
  -        Object[] result = new Object[1];
  -        result[0] = getAttribute(name, modeConf, objectModel);
  -        return (result == null? null : result);
  -
  +        Object result = new Object[1];
  +        result = getAttribute(name, modeConf, objectModel);
  +        return (result == null? null : new Object[]{result});        
       }
   
   }