Re: FileUtilsTest jdk 1.3 vs 1.5
Hi, I have just modified the conversions to reflect the JDK 1.4 behavior. Let me know if this raises other issues. Regards, Antoine Stefan Bodewig wrote: On Mon, 13 Nov 2006, Peter Reilly [EMAIL PROTECTED] wrote: it may be that the conversion needs to be modifed to reflect the 1.4 behaviour. Agreed, even if it means a small scale break of backwards compatibility. The behavior we see on JDK 1.3 has been there for any JDK in earlier versions of Ant. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUtilsTest jdk 1.3 vs 1.5
One could argue that a path without a drive letter is not absolute but relative and therefore the drive letter should not be inserted at all. I agree on principles, although I don't mind either way in practice, as long as we document it accurately. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUtilsTest jdk 1.3 vs 1.5
On 11/13/06, Dominique Devienne [EMAIL PROTECTED] wrote: One could argue that a path without a drive letter is not absolute but relative and therefore the drive letter should not be inserted at all. The assumption in ant for a long time is that /x/y/z is an absolute file name, and thus should not be prepended by ${basedir}. Is the test that is failing: assertEqualsIgnoreDriveCase(dosRoot + File.separator + foo, FILE_UTILS.fromURI(file:///foo)); ? We should investigate why this fails in jdk1.3 and not in (I assume) jdk1.4 or higher. One thing I can see that is different is Locator#fromURI(String), this explicitly checks for jdk 1.4 and uses the new File(new java.net.URI#fromURI(String)).getAbsolutePath() to do the conversion. for jdk1.3 or lower it does the conversion by hand, it may be that the conversion needs to be modifed to reflect the 1.4 behaviour. Peter I agree on principles, although I don't mind either way in practice, as long as we document it accurately. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUtilsTest jdk 1.3 vs 1.5
Hi, I applied a patch in this Locator method which is responsible for these slightly dissounding behaviors. The corresponding commit was : http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?r1=350068r2=357131 The JDK does not behave consistently for these URI to File conversions between versions. Antoine Original-Nachricht Datum: Mon, 13 Nov 2006 14:08:00 + Von: Peter Reilly [EMAIL PROTECTED] An: Ant Developers List dev@ant.apache.org Betreff: Re: FileUtilsTest jdk 1.3 vs 1.5 On 11/13/06, Dominique Devienne [EMAIL PROTECTED] wrote: One could argue that a path without a drive letter is not absolute but relative and therefore the drive letter should not be inserted at all. The assumption in ant for a long time is that /x/y/z is an absolute file name, and thus should not be prepended by ${basedir}. Is the test that is failing: assertEqualsIgnoreDriveCase(dosRoot + File.separator + foo, FILE_UTILS.fromURI(file:///foo)); ? We should investigate why this fails in jdk1.3 and not in (I assume) jdk1.4 or higher. One thing I can see that is different is Locator#fromURI(String), this explicitly checks for jdk 1.4 and uses the new File(new java.net.URI#fromURI(String)).getAbsolutePath() to do the conversion. for jdk1.3 or lower it does the conversion by hand, it may be that the conversion needs to be modifed to reflect the 1.4 behaviour. Peter I agree on principles, although I don't mind either way in practice, as long as we document it accurately. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUtilsTest jdk 1.3 vs 1.5
On Mon, 13 Nov 2006, Peter Reilly [EMAIL PROTECTED] wrote: it may be that the conversion needs to be modifed to reflect the 1.4 behaviour. Agreed, even if it means a small scale break of backwards compatibility. The behavior we see on JDK 1.3 has been there for any JDK in earlier versions of Ant. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FileUtilsTest jdk 1.3 vs 1.5
Hi On jdk 1.3 the test testFromURI() will fail because with jdk 1.3 no drive letter is inserted for a path that does not contain a drive letter. with jdk 1.5 the drive letter is inserted for a path that is drive absolute the fromURI method has javadoc claiming the following: /** * Constructs a file path from a codefile:/code URI. * * pWill be an absolute path if the given URI is absolute./p * * pSwallows '%' that are not followed by two characters, * doesn't deal with non-ASCII characters./p * * @param uri the URI designating a file in the local filesystem. * @return the local file system path for the file. * @since Ant 1.6 */ One could argue that a path without a drive letter is not absolute but relative and therefore the drive letter should not be inserted at all. (And the test should fail for jdk 1.5 and not jdk 1.3.) Definitely the behaviour should be the same. What is your opinion on the required behaviour? Martijn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]