cvs commit: ant/src/testcases/org/apache/tools/ant/util ClasspathUtilsTest.java

2004-12-10 Thread peterreilly
peterreilly2004/12/10 07:18:57

  Modified:.WHATSNEW
   src/main/org/apache/tools/ant/util ClasspathUtils.java
  Added:   src/testcases/org/apache/tools/ant/util
ClasspathUtilsTest.java
  Log:
  with the bugzilla change 30161 it is not necessary to place
   Path.systemClasspath in the antclassloader
  Doing so causes resources to appear twice
  
  Revision  ChangesPath
  1.693 +4 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.692
  retrieving revision 1.693
  diff -u -r1.692 -r1.693
  --- WHATSNEW  7 Dec 2004 10:29:32 -   1.692
  +++ WHATSNEW  10 Dec 2004 15:18:57 -  1.693
  @@ -174,6 +174,10 @@
   * Incorrect classloader parent in junittask when using with ant-junit.jar 
and junit.jar
 not in the project classloader. Bugzilla report 28474.
   
  +* getResources() on the classloader returned by ClasspathUtils would see 
each resource
  +  twice - if the resource is in the project classpath and if the classloader 
is requested
  +  with a null path.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===
   
  
  
  
  1.13  +7 -9  
ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java
  
  Index: ClasspathUtils.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ClasspathUtils.java   14 Apr 2004 15:42:08 -  1.12
  +++ ClasspathUtils.java   10 Dec 2004 15:18:57 -  1.13
  @@ -156,13 +156,13 @@
* 'ant.reuse.loader' this will try to reuse the perviously
* created loader with that id, and of course store it there upon
* creation./p
  - * @param path Path object to be used as classpath for this classloader
  - * @param loaderId identification for this Loader,
  + * @param path  Path object to be used as classpath for this 
classloader
  + * @param loaderId  identification for this Loader,
* @param reverseLoader if set to true this new loader will take
  - * precedence over it's parent (which is contra the regular
  - * @param p Ant Project where the handled components are living in.
  - * classloader behaviour)
  - * @return ClassLoader that uses the Path as its classpath.
  + *  precedence over it's parent (which is contra the 
regular
  + *  classloader behaviour)
  + * @param p Ant Project where the handled components are 
living in.
  + * @return  ClassLoader that uses the Path as its classpath.
*/
   public static ClassLoader getClassLoaderForPath(
   Project p, Path path, String loaderId, boolean reverseLoader,
  @@ -205,9 +205,7 @@
   Project p,
   Path path,
   boolean reverseLoader) {
  -
  -AntClassLoader acl = p.createClassLoader(path != null
  - ? path : 
Path.systemClasspath);
  +AntClassLoader acl = p.createClassLoader(path);
   if (reverseLoader) {
   acl.setParentFirst(false);
   acl.addJavaLibraries();
  
  
  
  1.1  
ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java
  
  Index: ClasspathUtilsTest.java
  ===
  /*
   * Copyright  2000-2002,2004 The Apache Software Foundation
   *
   *  Licensed under the Apache License, Version 2.0 (the License);
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *  http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an AS IS BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   *
   */
  
  package org.apache.tools.ant.util;
  
  import java.io.File;
  import java.io.IOException;
  import java.util.Enumeration;
  import junit.framework.TestCase;
  
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Project;
  import org.apache.tools.ant.types.Path;
  
  
  /**
   * Test case for ClasspathUtils
   *
   */
  public class ClasspathUtilsTest extends TestCase {
  
  private Project p;
  
  public ClasspathUtilsTest(String name) {
  super(name);
  }
  
  public void setUp() {
  p = new Project();
  p.init();
  }
  
  
  public void testOnlyOneInstance() {
  Enumeration enumeration;
  String list 

cvs commit: ant/src/testcases/org/apache/tools/ant/util ClasspathUtilsTest.java

2004-12-10 Thread peterreilly
peterreilly2004/12/10 07:20:11

  Modified:.Tag: ANT_16_BRANCH WHATSNEW
   src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH
ClasspathUtils.java
  Added:   src/testcases/org/apache/tools/ant/util Tag: ANT_16_BRANCH
ClasspathUtilsTest.java
  Log:
  sync
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.503.2.147 +4 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.146
  retrieving revision 1.503.2.147
  diff -u -r1.503.2.146 -r1.503.2.147
  --- WHATSNEW  7 Dec 2004 10:30:35 -   1.503.2.146
  +++ WHATSNEW  10 Dec 2004 15:20:10 -  1.503.2.147
  @@ -75,6 +75,10 @@
   * Incorrect classloader parent in junittask when using with ant-junit.jar 
and junit.jar
 not in the project classloader. Bugzilla report 28474.
   
  +* getResources() on the classloader returned by ClasspathUtils would see 
each resource
  +  twice - if the resource is in the project classpath and if the classloader 
is requested
  +  with a null path.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===
   
  
  
  
  No   revision
  No   revision
  1.8.2.5   +7 -9  
ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java
  
  Index: ClasspathUtils.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java,v
  retrieving revision 1.8.2.4
  retrieving revision 1.8.2.5
  diff -u -r1.8.2.4 -r1.8.2.5
  --- ClasspathUtils.java   14 Apr 2004 15:42:41 -  1.8.2.4
  +++ ClasspathUtils.java   10 Dec 2004 15:20:11 -  1.8.2.5
  @@ -156,13 +156,13 @@
* 'ant.reuse.loader' this will try to reuse the perviously
* created loader with that id, and of course store it there upon
* creation./p
  - * @param path Path object to be used as classpath for this classloader
  - * @param loaderId identification for this Loader,
  + * @param path  Path object to be used as classpath for this 
classloader
  + * @param loaderId  identification for this Loader,
* @param reverseLoader if set to true this new loader will take
  - * precedence over it's parent (which is contra the regular
  - * @param p Ant Project where the handled components are living in.
  - * classloader behaviour)
  - * @return ClassLoader that uses the Path as its classpath.
  + *  precedence over it's parent (which is contra the 
regular
  + *  classloader behaviour)
  + * @param p Ant Project where the handled components are 
living in.
  + * @return  ClassLoader that uses the Path as its classpath.
*/
   public static ClassLoader getClassLoaderForPath(
   Project p, Path path, String loaderId, boolean reverseLoader,
  @@ -205,9 +205,7 @@
   Project p,
   Path path,
   boolean reverseLoader) {
  -
  -AntClassLoader acl = p.createClassLoader(path != null
  - ? path : 
Path.systemClasspath);
  +AntClassLoader acl = p.createClassLoader(path);
   if (reverseLoader) {
   acl.setParentFirst(false);
   acl.addJavaLibraries();
  
  
  
  No   revision
  No   revision
  1.1.2.1   +0 -0  
ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java
  
  Index: ClasspathUtilsTest.java
  ===
  RCS file: 
/home/cvs/ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]