Jochen Wiedmann created MCOMPILER-453:
-----------------------------------------

             Summary: Support null-analysis configuration in the Maven POM
                 Key: MCOMPILER-453
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-453
             Project: Maven Compiler Plugin
          Issue Type: Wish
    Affects Versions: 3.8.1
            Reporter: Jochen Wiedmann


The commons-lang project intends to start using the @Nullable, and @NonNull 
annotations,

both as a guidance for static code analysis, and for the purpose of 
documentation.

 

Experience shows, that IDE's are already supporting these kind of things. (See, 
for example, 
[https://wiki.eclipse.org/JDT_Core/Null_Analysis|[http://example.com].)|http://example.com].%29/]

Ideally, an IDE importing the commons-lang should be able to detect

  a) the fact, that the Maven project is using Null Analysis, and

  b) It does so using the namespace "javax.annotation" (and not, for example, 
"edu.umd.cs.findbugs.annotations", or "com.github.spotbugs.annotation).

 

For that to happen, there are two obvious choices:

 

1.) We start adding IDE specific configuration files to the project. (Not 
desirable,

     for any number of reasons.)

2.) We teach the IDE's to read this information from the Maven POM. For example,

      have the following in the Compile goal:

 

        @Parameter(property="compiler:nullAnalysisEnabled", default="false")

         private boolean nullAnalysisEnabled;

 

        @Parameter(property="compiler:nullAnalysisNullableAnnotation",

                             default="javax.annotation.Nullable")

         private String nullAnalysisNullableAnnotation;

 

        @Parameter(property="compiler:nullAnalysisNonNullAnnotation",

                             default="javax.annotation.NonNull")

         private String nullAnalysisNonNullAnnotation;

 

If we had that, then we could teach the IDE specific Maven adapter (like M2E) 
to recognize these parameters, and behave accordingly.

 

*Note:* At least initially, these parameters could very well be no-ops. It is 
completely sufficient to have them for documentation purposes.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to