Skip to content

Commit

Permalink
ant task silently ignores empty excludeFilter
Browse files Browse the repository at this point in the history
Logging a warning will prevent confusion.

Also see question on StackOverflow:
FindBugs Exclude filter with Ant
http://stackoverflow.com/questions/24275252/findbugs-exclude-filter-with-ant/35222903
  • Loading branch information
Kristof Neirynck authored and Crydust committed Apr 9, 2016
1 parent 264ae7b commit 4b7e93f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions findbugs/src/antTask/edu/umd/cs/findbugs/anttask/FindBugsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,28 +389,40 @@ public void setExcludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
this.excludeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: exclude filter file " + filterFile
+ (filterFile.exists() ? " is empty" : " does not exist"));
}
this.excludeFile = null;
}
}

/**
* Set the exclude filter file
* Set the include filter file
*/
public void setIncludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
this.includeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: include filter file " + filterFile
+ (filterFile.exists() ? " is empty" : " does not exist"));
}
this.includeFile = null;
}
}

/**
* Set the exclude filter file
* Set the baseline bugs file
*/
public void setBaselineBugs(File baselineBugs) {
if (baselineBugs != null && baselineBugs.length() > 0) {
this.baselineBugs = baselineBugs;
} else {
if (baselineBugs != null) {
log("Warning: baseline bugs file " + baselineBugs
+ (baselineBugs.exists() ? " is empty" : " does not exist"));
}
this.baselineBugs = null;
}
}
Expand Down

0 comments on commit 4b7e93f

Please sign in to comment.