ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/extension Extension.java Specification.java
Date Tue, 09 Aug 2005 15:24:52 GMT
mbenson     2005/08/09 08:24:52

  Modified:    src/main/org/apache/tools/ant/launch Launcher.java
               src/main/org/apache/tools/ant/taskdefs PathConvert.java
               src/main/org/apache/tools/ant/taskdefs/optional Javah.java
               src/main/org/apache/tools/ant/taskdefs/optional/extension
                        Extension.java Specification.java
  Log:
  remove reflective toArray calls
  PR: 36092
  Obtained from: Dave Brosius
  
  Revision  Changes    Path
  1.32      +2 -2      ant/src/main/org/apache/tools/ant/launch/Launcher.java
  
  Index: Launcher.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/launch/Launcher.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Launcher.java	6 Jun 2005 19:45:32 -0000	1.31
  +++ Launcher.java	9 Aug 2005 15:24:52 -0000	1.32
  @@ -174,7 +174,7 @@
           if (libPaths.size() == 0 && cpString == null) {
               newArgs = args;
           } else {
  -            newArgs = (String[]) argList.toArray(new String[0]);
  +            newArgs = (String[]) argList.toArray(new String[argList.size()]);
           }
   
           List libPathURLs = new ArrayList();
  @@ -188,7 +188,7 @@
               addPath(libPath, true, libPathURLs);
           }
   
  -        URL[] libJars = (URL[]) libPathURLs.toArray(new URL[0]);
  +        URL[] libJars = (URL[]) libPathURLs.toArray(new URL[libPathURLs.size()]);
   
           // Now try and find JAVA_HOME
           File toolsJar = Locator.getToolsJar();
  
  
  
  1.43      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
  
  Index: PathConvert.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- PathConvert.java	12 Jun 2005 15:54:14 -0000	1.42
  +++ PathConvert.java	9 Aug 2005 15:24:52 -0000	1.43
  @@ -341,7 +341,7 @@
                           ret.add(mapped[m]);
                       }
                   }
  -                elems = (String[]) ret.toArray(new String[] {});
  +                elems = (String[]) ret.toArray(new String[ret.size()]);
               }
               for (int i = 0; i < elems.length; i++) {
                   String elem = mapElement(elems[i]); // Apply the path prefix map
  
  
  
  1.37      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Javah.java	29 Jun 2005 11:14:19 -0000	1.36
  +++ Javah.java	9 Aug 2005 15:24:52 -0000	1.37
  @@ -149,7 +149,7 @@
               ClassArgument arg = (ClassArgument) e.nextElement();
               al.add(arg.getName());
           }
  -        return (String[]) al.toArray(new String[0]);
  +        return (String[]) al.toArray(new String[al.size()]);
       }
   
       /**
  
  
  
  1.17      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/Extension.java
  
  Index: Extension.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/Extension.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Extension.java	9 Mar 2005 00:20:38 -0000	1.16
  +++ Extension.java	9 Aug 2005 15:24:52 -0000	1.17
  @@ -209,7 +209,7 @@
               }
           }
   
  -        return (Extension[]) results.toArray(new Extension[0]);
  +        return (Extension[]) results.toArray(new Extension[results.size()]);
       }
   
       /**
  @@ -580,7 +580,7 @@
               getExtension(attributes, results, listKey);
           }
   
  -        return (Extension[]) results.toArray(new Extension[ 0 ]);
  +        return (Extension[]) results.toArray(new Extension[results.size()]);
       }
   
       /**
  
  
  
  1.15      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/Specification.java
  
  Index: Specification.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/Specification.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Specification.java	9 Mar 2005 00:20:38 -0000	1.14
  +++ Specification.java	9 Aug 2005 15:24:52 -0000	1.15
  @@ -183,7 +183,7 @@
           }
   
           final ArrayList trimmedResults = removeDuplicates(results);
  -        return (Specification[]) trimmedResults.toArray(new Specification[0]);
  +        return (Specification[]) trimmedResults.toArray(new Specification[trimmedResults.size()]);
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message