Browse Source

don't delete classes if the source is not there. PR 45916

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@702901 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
0afd945293
3 changed files with 9 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
  3. +1
    -1
      src/tests/antunit/taskdefs/optional/depend/depend-test.xml

+ 4
- 0
WHATSNEW View File

@@ -232,6 +232,10 @@ Fixed bugs:
* <depend> didn't close JARs that were part of the classpath.
Bugzilla Report 45955.

* in some cases <depend> would delete class files even if it didn't
find the corresponding source files.
Bugzilla Report 45916.

Other changes:
--------------



+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java View File

@@ -451,8 +451,12 @@ public class Depend extends MatchingTask {
ClassFileInfo classInfo
= (ClassFileInfo) classFileInfoMap.get(className);
if (classInfo != null && classInfo.absoluteFile.exists()) {
if (classInfo.sourceFile == null) {
warnOutOfDateButNotDeleted(classInfo, className, className);
} else {
classInfo.absoluteFile.delete();
count++;
}
}
}
return count;


+ 1
- 1
src/tests/antunit/taskdefs/optional/depend/depend-test.xml View File

@@ -24,7 +24,7 @@
<delete dir="${src1}"/>
</target>

<target name="xtestBug45916">
<target name="testBug45916">
<mkdir dir="${src1}"/>
<mkdir dir="${output}"/>
<mkdir dir="${src1}/a"/>


Loading…
Cancel
Save