Re: Patch for ClassPath.getClassPath()

Rohan Lloyd <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
On 8 Oct 2004, at 2:14 PM, Rohan Lloyd wrote:

>
> While running Findbugs (which uses bcel) on Mac OS X, I noticed that  
> the class path returned from ClassPath.getClassPath() was incorrect.
>
> The problem is that on Mac OS X, java.ext.dirs contains 3 different  
> directories. The code searches all 3 directories for .jar/.zip files  
> to add to path, but then appends each filename to the entire  
> java.ext.dirs string, rather than appending it to the directory the  
> file was found in.
>
> Attached is a one line patch that fixes the problem.

Looks like the attachment was stripped, here it is inline...

Index: src/java/org/apache/bcel/util/ClassPath.java
===================================================================
RCS file:  
/home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/util/ 
ClassPath.java,v
retrieving revision 1.8
diff -u -r1.8 ClassPath.java
--- src/java/org/apache/bcel/util/ClassPath.java        23 May 2003  
07:55:32 -0000      1.8
+++ src/java/org/apache/bcel/util/ClassPath.java        8 Oct 2004  
02:08:27 -0000
@@ -174,7 +174,7 @@

        if(extensions != null)
         for(int i=0; i < extensions.length; i++)
-         list.add(ext_path + File.separatorChar + extensions[i]);
+         list.add(ext_dir.getPath() + File.separatorChar +  
extensions[i]);
      }

      StringBuffer buf = new StringBuffer();


-- 
Rohan Lloyd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.