Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven checkersplugin result in compile errors despite using "-Awarns" flag #177

Closed
GoogleCodeExporter opened this issue Jul 3, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Add the following configuration to maven project pom.xml

<plugin>
   <groupId>types.checkers</groupId>
      <artifactId>checkersplugin</artifactId>
      <version>0.4</version>
      <executions>
         <execution>
            <phase>process-classes</phase>
            <goals>
               <goal>check</goal>
            </goals>
         </execution>
      </executions>
      <configuration>
      <javacParams>-Awarns -Xmaxwarns 10000</javacParams>
      <processors>
         <processor>checkers.interning.InterningChecker</processor>
         <processor>checkers.nullness.NullnessChecker</processor>
      </processors>
   </configuration>
</plugin>

2. Make sure that there is at least one concern in the Java code that will be 
caught by the Checker Framework.

3. Execute "mvn test"


What is the expected output? 

The project should build successfully with compiler warnings for the problems 
that are detected by the Checker Framework.

What do you see instead?

[INFO] --- checkersplugin:0.4:check (default) @ inject ---
[INFO] Running JSR308 checkers version: 1.4.3
[INFO] Running processor(s): 
checkers.interning.InterningChecker,checkers.nullness.NullnessChecker
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Test Project ....................................... FAILURE [3.018s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[...]
[ERROR] Failed to execute goal types.checkers:checkersplugin:0.4:check 
(default) on project inject: error: Unexpected InvocationTargetException for 
class name checkers.interning.InterningVisitor when invoking the constructor; 
parameter types: [class checkers.interning.InterningChecker, interface 
com.sun.source.tree.CompilationUnitTree] -> [Help 1]


What version of the product are you using? On what operating system?

<groupId>types.checkers</groupId>
<artifactId>checkersplugin</artifactId>
<version>0.4</version>

<groupId>types.checkers</groupId>
<artifactId>checkers-quals</artifactId>
<version>1.4.3</version>

Java: 1.7.0_09
Mac OS X: 10.8.2

Please provide any additional information below.

Original issue reported on code.google.com by mat...@gmail.com on 19 Nov 2012 at 8:28

@GoogleCodeExporter
Copy link
Author

I have reproduced this with the code sent to Werner.  I am looking into it now.

Original comment by Jonathan...@gmail.com on 19 Nov 2012 at 5:45

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by Jonathan...@gmail.com on 5 Dec 2012 at 7:23

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Original comment by Jonathan...@gmail.com on 5 Dec 2012 at 7:23

@GoogleCodeExporter
Copy link
Author

Original comment by michael.ernst@gmail.com on 26 Feb 2013 at 6:49

  • Added labels: Maven

@GoogleCodeExporter
Copy link
Author

So this particular issue is a bit old and I am not sure that it ever got a 
proper response in any other channel.  So at the moment this works as intended 
though we may want to change the intent.  

There are 2 options:
1.  failOnError - an option in the Maven plugin
2.  -Awarns     - have checker framework report errors as warnings
At the moment if failOnError is set to false then all errors will be reported 
as warnings and the build will succeed.  Perhaps the right action here is to 
set failOnError based on whether or not -Awarns can be found in javacParams?   
We could then remove failOnError as a Maven parameter and -Awarns would be the 
only setting that truly mattered.  

Does anyone have any suggestions or comments?

Original comment by Jonathan...@gmail.com on 27 Feb 2013 at 12:03

@GoogleCodeExporter
Copy link
Author

I think there is good precedence for the failOnError option, e.g.

http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#failOnEr
ror
http://maven.apache.org/plugins/maven-pmd-plugin/check-mojo.html#failOnViolation
http://maven.apache.org/plugins/maven-checkstyle-plugin/checkstyle-mojo.html#fai
lsOnError
http://mojo.codehaus.org/findbugs-maven-plugin/check-mojo.html#failOnError

I wouldn't mind if -Awarns overrides failOnError though.

Original comment by trask.st...@gmail.com on 27 Feb 2013 at 12:17

@GoogleCodeExporter
Copy link
Author

Perhaps I will leave it as is for now.   If there seems to be a number of 
people confused by this option then we can change it in the future.  

Original comment by Jonathan...@gmail.com on 27 Feb 2013 at 12:29

@GoogleCodeExporter
Copy link
Author

Original comment by Jonathan...@gmail.com on 27 Feb 2013 at 9:00

  • Changed state: WontFix

mernst pushed a commit to mernst/checker-framework that referenced this issue Oct 19, 2020
d367wang pushed a commit to lnsun/checker-framework that referenced this issue Jun 18, 2021
flo2702 pushed a commit to flo2702/checker-framework that referenced this issue May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants