You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/09/19 18:58:13 UTC

DO NOT REPLY [Bug 45847] New: Classloader task - duplicate path elements added

https://issues.apache.org/bugzilla/show_bug.cgi?id=45847

           Summary: Classloader task - duplicate path elements added
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: robert.flaherty@oracle.com


This cropped up for me when trying:

                <classloader
classpath="${user.dir}/commons-net-1.4.1.jar;${user.dir}/jakarta-oro-2.0.8.jar;${user.dir}/ant-commons-net.jar"
parentFirst="false" />

which does this in execute():

                acl = new AntClassLoader((ClassLoader) parent,
                         getProject(), classpath, parentFirst);

and then:

            if (classpath != null) {
                String[] list = classpath.list();
                for (int i = 0; i < list.length; i++) {
                    File f = new File(list[i]);
                    if (f.exists()) {
                        acl.addPathElement(f.getAbsolutePath());
                        log("Adding to class loader " +  acl + " " +
f.getAbsolutePath(),
                                Project.MSG_DEBUG);
                    }
                }
            }

adding twice, and yielded debugging:

[classloader] Adding to class loader
AntClassLoader[...\commons-net-1.4.1.jar;...\jakarta-oro-2.0.8.jar;...\ant-commons-net.jar;...\commons-net-1.4.1.jar]
...\commons-net-1.4.1.jar
[classloader] Adding to class loader
AntClassLoader[...\commons-net-1.4.1.jar;...\jakarta-oro-2.0.8.jar;...\ant-commons-net.jar;...\commons-net-1.4.1.jar;...\jakarta-oro-2.0.8.jar]
...\jakarta-oro-2.0.8.jar
[classloader] Adding to class loader
AntClassLoader[...\commons-net-1.4.1.jar;...\jakarta-oro-2.0.8.jar;...\ant-commons-net.jar;...\commons-net-1.4.1.jar;...\jakarta-oro-2.0.8.jar;...\ant-commons-net.jar]
...\ant-commons-net.jar

The classpath is set when the AntClassLoader is created, so the second block
isn't needed.  Since the second block was doing logging, may want to add loggin
into AntClassLoader for addPathComponent() and addPathFile().


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45847] Classloader task - duplicate path elements added

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45847


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.0




--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2008-09-25 05:26:50 PST ---
the second block only isn't needed if the task isn't modifying an existing
classloader.

fixed in svn rev 698943.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.