lovubuntu / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

Quiet failure when run from maven #348

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It took me a while to create a small repro for this, see 
https://github.com/trask/checker-quiet-failure-repro

"mvn clean compile" fails with "Compilation failure" but no details on what the 
checker failures were, e.g.

    [INFO] Compiling 1 source file to d:\git\trask\checker-quiet-failure-repro\target\classes
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.059 s
    [INFO] Finished at: 2014-08-27T00:03:46-07:00
    [INFO] Final Memory: 8M/432M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project example: Compilation failure -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.

If you uncomment the jsr305 dependency in the pom file, then "mvn clean 
compile" succeeds, though even this seems a bit strange, since the jsr305 jar 
is not needed for checker framework to succeed when run directly, e.g. this 
succeeds:

export CLASSPATH=guava-18.0.jar
~/checker-framework-1.8.4/checker/bin/javac -processor 
org.checkerframework.checker.nullness.NullnessChecker src/main/java/Test.java

Here is my local environment details:

$ mvn -v
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 
2014-08-11T13:58:10-07:00)
Maven home: d:\tools\apache-maven-3.2.3
Java version: 1.8.0_11, vendor: Oracle Corporation
Java home: d:\tools\java\jdk1.8.0_11\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

Original issue reported on code.google.com by trask.st...@gmail.com on 27 Aug 2014 at 7:11

GoogleCodeExporter commented 9 years ago
I was able to capture the error being thrown by checker framework:

error: SourceChecker.typeProcess: unexpected Throwable (CompletionFailure) 
while processing 
c:\git\trask\checker-quiet-failure-repro\src\main\java\Test.java; message: 
class file for javax.annotation.Nullable not found
  Compilation unit: d:\git\trask\checker-quiet-failure-repro\src\main\java\Test.java
  Exception: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for javax.annotation.Nullable not found; no stack trace available.

Original comment by trask.st...@gmail.com on 24 Dec 2014 at 3:54

GoogleCodeExporter commented 9 years ago
This appears to be the same as issue 309, but dealing with inheriting 
declaration annotations. 

AnnotatedTypeFactory 2320 will throw a CompletionFailure exception when trying 
to look up the annotations for javax.annotations.Nullable.

Attached is a repro.

unzip repro.zip
javac lib/*.java
jar -cvf lib.jar lib/MyLibrary.class lib/MyLibrarySuper.class
javac -processor org.checkerframework.checker.nullness.NullnessChecker 
MyTests.java

Original comment by mcart...@cs.washington.edu on 21 Jan 2015 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Suzanne....@gmail.com on 26 Jan 2015 at 11:38

GoogleCodeExporter commented 9 years ago
Fixed by this commit:
https://code.google.com/p/checker-framework/source/detail?r=4852b48ace83

Original comment by Suzanne....@gmail.com on 26 Jan 2015 at 11:40

GoogleCodeExporter commented 9 years ago
Fixed in release 1.8.10 of the Checker Framework.

Original comment by mcart...@cs.washington.edu on 30 Jan 2015 at 10:57