trying the example from
http://findbugs.sourceforge.net/manual/datamining.html#antexample with
setting the class location to a path containing wildcards pointing to several classes will not result
in the expected behaviour.
Version used:
findbugs-1.3.4
Example:
...
<findbugs home="${findbugs.home}"
output="xml:withMessages"
timeout="90000000"
reportLevel="experimental"
workHard="true"
effort="max"
adjustExperimental="true"
jvmargs="${jvmargs}"
failOnError="true"
outputFile="out.xml"
projectName="Findbugs"
debug="false">
<class location="generated/mypackage/*.class" />
</findbugs>
...
Result:
Exception in thread "main" java.io.IOException: IOException while scanning codebases
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:226)
at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:1531)
at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1012)
Caused by: edu.umd.cs.findbugs.classfile.ResourceNotFoundException: Resource not found: generated\mypackage\*.class
at edu.umd.cs.findbugs.classfile.impl.SingleFileCodeBase.getClassDescriptor(SingleFileCodeBase.java:225)
at edu.umd.cs.findbugs.classfile.impl.SingleFileCodeBaseEntry.getClassDescriptor(SingleFileCodeBaseEntry.java:63)
at edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:221)
at edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:576)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:175)
... 2 more
Expected:
instead of calling SingleFileCodeBase the ClassPathBuilder should notice that he need to load several files or at least throw an error message that only single files or complete directories are allowed
Note:
-
Origin:
see Stacktrace
Repro/test case committed, reassigning for further investigation.
We do not support the use of wildcards in <class ...> elements for the FindBugs task