tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@m64.com>
Subject use of NT drive specifier in Javac classpath
Date Sun, 26 Dec 1999 14:38:52 GMT
Hi,

I think there has been some discussion about how classpaths are handled in
the Javac taskdef with regard to platform specific behaviour. I don't know
what the latest word is but the current implementation causes me a few
problems.

As I understand the current behaviour, the Javac classpath can contain
either ':' or ';' as path separators and '/' or '\' as file separators.
These are translated on the fly to the platform specific path and file
separators. In general I like this behaviour, since you can use either
Windows or Unix style paths and it will work (don't know what Mac users do).
Unfortunately this scheme does not support the Windows drive specifier
format such as E:\tomcat\lib\servlet.jar.

I have added a quick patch to Project.java to change the translation
behaviour. Now ':' is only considered a path separator if it is not followed
immediately by a '\' character. This essentially retains the current
behaviour but also accepts the drive specifier format.

I guess this might warrant some discussion before the patch is applied.

Cheers
Conor

===================================================================
RCS file:
/home/cvspublic/jakarta-tools/ant/src/main/org/apache/tools/ant/Project.java
,v
retrieving revision 1.21
diff -r1.21 Project.java
441a442,443
>
>         int processLength = to_process.length();
443c445
<         StringBuffer bs = new StringBuffer(to_process.length() + 50);
---
>         StringBuffer bs = new StringBuffer(processLength + 50);
448c450,451
<         for (char c = sci.first(); c != CharacterIterator.DONE; c =
sci.next()) {
---
>         int index = 0;
>         for (char c = sci.first(); c != CharacterIterator.DONE; c =
sci.next(), ++index) {
451c454,455
<             if (tmp.equals(":") || tmp.equals(";"))
---
>             if (tmp.equals(":") && (index == processLength - 1 ||
to_process.charAt(index+1) != '\\')
>                 || tmp.equals(";"))


--
Conor MacNeill
conor@m64.com
M64 Pty Limited


Mime
View raw message