Closed andrewda closed 6 years ago
Thanks for the bug report and sorry that there is an issue.
I can reproduce the crash.
The issue is that the project is using -source 1.4
. Java 1.4 doesn't support type parameters. When the stub parser then parses a file with type parameters, in this case flow.astub
, something unexpected happens and we get an IndexOutOfBoundsException.
To get rid of this exception, you can increase the source version to at least 1.5, as done in the patch at the end of this comment. We can look whether we can make stub parsing more resilient against such a mismatch, but I expect similar errors could arise anywhere in our code. So maybe we should more explicitly document our minimum source assumption.
diff --git a/build.xml b/build.xml
index 660ab72a..b8734add 100644
--- a/build.xml
+++ b/build.xml
@@ -106,8 +106,8 @@
<!-- Directory for temporary files. -->
<property name="dist.tmp" value="${dist.dir}/tmp"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
<!-- destination for generated documentation on Apache web host -->
<property name="apache.javadoc_dest" value="/www/logging.apache.org/log4j/docs"/>
Upping the source and target to 1.5 worked great, thank you! And yeah, I think making it more explicitly documented that the source version must be at least 1.5 would be great.
Thanks for pointing out this limitation of our documentation. I have fixed it.
Description
After following the manual's instructions on how to add Checker Framework to an Ant project (in this case, log4j, the program crashes when running
ant check-nullness
. The standardant build
works fine without any errors. In addition, runningjavacheck -processor org.checkerframework.checker.nullness.NullnessChecker
from the command-line also works as expected. The crash can be viewed in the command-line output below.A simple test case can be used with my additions to log4j as seen here. The
check-nullness
target is copied from thebuild.core
target and changed to usejsr308.javac
as specified in the Checker Framework manual.I expect
ant check-nullness
to output the nullness issues present in the code, but instead it is crashing with the output shown below.System Information
Command-line output