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/30 13:41:37 UTC

DO NOT REPLY [Bug 45916] New: Depend task may remove (inner) classes without source files

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

           Summary: Depend task may remove (inner) classes without source
                    files
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Optional Tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: lahoda@gmail.com


Created an attachment (id=22647)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22647)
Test case.

The depend task
(src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java) tries not
to delete classes for which it cannot find the source file (Depend.java:481).
When deleting an inner class, it also tries to delete the top-level class
(Depend.java:494 and further). But, in some cases, it deletes an inner classes
without either of these checks (Depend.java:451). As the top-level class may be
preserved, the following javac task may consider the classfile to be
up-to-date, and may not compile the source, leading into a missing classfile
for the inner class after compile.

I am attaching a test case. Unpack the attachment, and execute the
"broken-depend.xml" build script in the "broken-depend" directory (default
target "test-depend"). The execution of the script fails because of a missing
inner-class file.

Tested on ant 1.7.1:
$ ant -version
Apache Ant version 1.7.1 compiled on June 27 2008

NetBeans bug:
http://www.netbeans.org/issues/show_bug.cgi?id=134606


-- 
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 45916] Depend task may remove (inner) classes without source files

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         OS/Version|Linux                       |All
           Platform|PC                          |All




--- Comment #2 from Stefan Bodewig <bo...@apache.org>  2008-10-06 09:20:16 PST ---
after fixing bug 45955 I can confirm that the problem doesn't show up on JDK
1.4.2, but this is because b.Main$1 doesn't seem to know that it depends on a.B
at all.

Am looking into fixing it for Java5+.


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

DO NOT REPLY [Bug 45916] Depend task may remove (inner) classes without source files

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |notifications@ant.apache.org
         AssignedTo|notifications@ant.apache.org|bodewig@apache.org
   Target Milestone|---                         |1.8.0




--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2008-10-06 08:26:18 PST ---
OK, it seems it depends on the JDK since the test seems to pass on JDK 1.4 (but
to be totally sure I need to fix what looks like a JAR handle leak in <depend>
first).

"the test" is a modified version of your test that I committed as svn revision
702176.


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

DO NOT REPLY [Bug 45916] Depend task may remove (inner) classes without source files

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


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

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




-- 
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 45916] Depend task may remove (inner) classes without source files

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


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

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




--- Comment #3 from Stefan Bodewig <bo...@apache.org>  2008-10-08 08:05:10 PST ---
fixed with svn revision 702901


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