roterdam / checker-framework

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

@NotNull(message = "...") from Bean Validation causes "error: cannot find symbol" #308

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm having source code with Java EE 7 and JDK 8. There are fragments like:

@NotNull(message = "{artikel.bezeichnung.notNull}")
...
private String bezeichnung;

When I'm compiling via the Maven Compiler plugin and enable the Checker 
Framework, then I get errors like this one:

symbol:   method message()
location: @interface javax.validation.constraints.NotNull
[ERROR] diagnostic: C:\...\Artikel.java:88: error: cannot find symbol
@NotNull(message = "{artikel.bezeichnung.notNull}") 

Original issue reported on code.google.com by Juergen....@HS-Karlsruhe.de on 27 Mar 2014 at 4:36

GoogleCodeExporter commented 9 years ago
Thanks for your report!

The clean-room implementation of @NotNull that comes with the Checker Framework 
is at:

https://code.google.com/p/checker-framework/source/browse/checker/src/javax/vali
dation/constraints/NotNull.java

and doesn't take a string element.
We should change that class to also accept the optional elements as documented 
at

http://docs.oracle.com/javaee/6/api/javax/validation/constraints/NotNull.html

The Nullness Checker would ignore these elements, but this would ensure source 
compatibility.
Thoughts on this?

Original comment by wdi...@gmail.com on 28 Mar 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Just for completeness:
Meanwhile there is Java EE 7 and @NotNull is documented at 
http://docs.oracle.com/javaee/7/api/javax/validation/constraints/NotNull.html

Original comment by Juergen....@HS-Karlsruhe.de on 30 Mar 2014 at 1:55

GoogleCodeExporter commented 9 years ago
I've implemented these changes and sent them out for review.

Original comment by wdi...@gmail.com on 30 Mar 2014 at 4:42

GoogleCodeExporter commented 9 years ago

Original comment by wdi...@gmail.com on 31 Mar 2014 at 5:14

GoogleCodeExporter commented 9 years ago

Original comment by Jonathan...@gmail.com on 3 Apr 2014 at 12:59