I get a warning from an eclipse and I know that I can remove it with a warning about suppression, but I would rather understand what makes it a thing that can be null.
package-info.java
@ParametersAreNonnullByDefault package test; import javax.annotation.ParametersAreNonnullByDefault;
test.java
package test; public class Test { public static void main( final String[ ] args ) { System.out.println( new Test( "a" ).getS( ) ); } private final String s; public Test( final String s ) { this.s = s; } public String getS( ) { return this.s;
I do not understand why I get this warning ...
PS:
public Test( @Nonnull final String s ) { β public Test( @Nonnull final String s ) { value annotations are redundant by default, which apply to this location
@Nonnull private final String s; β nothing changes
xavierm02
source share