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/06/12 12:34:57 UTC

DO NOT REPLY [Bug 45190] New: Cannot typedef from a file with a # in the path

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

           Summary: Cannot typedef from a file with a # in the path
           Product: Ant
           Version: 1.7Alpha (nightly)
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: stevel@apache.org


reported on ant-user
------------------------

Error occurs on 1.7 and 1.7.1 beta2.

If I define a typedef with a # in the path ant won't run.

I have included a patch and have not created an error, is this a known
issue or already fixed?

<typedef
file="C:\USERS\helium\helium-dev-forbuilds#\helium\tools\compile\compile
.antlib.xml"/>

BUILD FAILED
C:\USERS\helium\helium-dev-forbuilds#\helium\build.xml:15: The following
error o
ccurred while executing this line:
C:\USERS\helium\helium-dev-forbuilds#\helium\helium.ant.xml:13:
java.lang.Illega
lArgumentException: URI has a fragment component
        at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
        at
org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:148)

        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
140)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:96)
        at org.apache.tools.ant.Main.runBuild(Main.java:683)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by:
C:\USERS\helium\helium-dev-forbuilds#\helium\helium.ant.xml:13: java.
lang.IllegalArgumentException: URI has a fragment component
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:115)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
129)
        at
org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:146)

        ... 14 more
Caused by: java.lang.IllegalArgumentException: URI has a fragment
component
        at java.io.File.<init>(File.java:370)
        at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
Source)

        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:165)
        at
org.apache.tools.ant.util.FileUtils.fromURI(FileUtils.java:1158)
        at org.apache.tools.ant.Location.<init>(Location.java:90)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
211)
        at
org.apache.tools.ant.helper.ProjectHelper2.parseUnknownElement(Projec
tHelper2.java:86)
        at nokia.ant.Antlib.createAntlib(Antlib.java:76)
        at nokia.ant.TypedefURIFix.loadAntlib(TypedefURIFix.java:460)
        at nokia.ant.TypedefURIFix.execute(TypedefURIFix.java:312)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
        ... 18 more


-- 
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 45190] Cannot typedef from a file with a # in the path

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


Simon Steiner <ex...@nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ext-simon.steiner@nokia.com




-- 
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 45190] Cannot typedef from a file with a # in the path

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





--- Comment #3 from Simon Steiner <ex...@nokia.com>  2008-06-17 04:02:11 PST ---
Created an attachment (id=22132)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22132)
Here is new patch using fileutils


-- 
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 45190] Cannot typedef from a file with a # in the path

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


Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org




--- Comment #6 from Jesse Glick <jg...@netbeans.org>  2008-06-18 12:47:17 PST ---
Any particular reason you're deprecating a private method rather than simply
removing it?


-- 
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 45190] Cannot typedef from a file with a # in the path

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





--- Comment #5 from Simon Steiner <ex...@nokia.com>  2008-06-17 05:03:27 PST ---
Its working with your change, can this not go to 1.7.1?


-- 
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 45190] Cannot typedef from a file with a # in the path

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #7 from Stefan Bodewig <bo...@apache.org>  2008-06-19 00:18:33 PST ---
Whether this can go into 1.7.1 is under discussion, but it's pretty unlikely
since we are already too close to the release.  1.7.2 may work.

Jesse, I've already committed a different patch which doesn't deprecate
anything.

The Definer.fileToUrl method performs some additional checks like whether the
file actually exists and is a file that the FileUtils method doesn't (for good
reasons), I've only replaced the File.toURL call.


-- 
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 45190] Cannot typedef from a file with a # in the path

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





--- Comment #2 from Stefan Bodewig <bo...@apache.org>  2008-06-17 03:00:35 PST ---
patch is JDK 1.4+, Ant is not.

Definer.fileToURL should probably use FileUtils.getFileURL anyway ...


-- 
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 45190] Cannot typedef from a file with a # in the path

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





--- Comment #1 from Steve Loughran <st...@apache.org>  2008-06-12 03:35:07 PST ---
Patch is:

--- Definer.java.org    Wed Jun 11 16:24:17 2008
+++ Definer.java        Wed Jun 11 17:05:15 2008
@@ -331,7 +331,7 @@
         }
         try {
             if (message == null) {
-                return file.toURL();
+                return file.toURI().toURL();
             }
         } catch (Exception ex) {
             message =


-- 
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 45190] Cannot typedef from a file with a # in the path

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.8.0
            Version|1.7Alpha (nightly)          |1.7.0RC1




--- Comment #4 from Stefan Bodewig <bo...@apache.org>  2008-06-17 04:56:32 PST ---
I was more thinking along the lines of
http://svn.apache.org/viewvc?rev=668624&view=rev

Can you confirm that this fixes the problem for you?


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