java - @NonNull triggers warning in Eclispse although constant value used -


i have got following method definition:

public static @nullable string getfile(@nonnull final path path, @nonnull final charset charset) 

and invoking method somewhere else following statement:

final string filestring = fileutil.getfile(filepath, standardcharsets.utf_8); 

however, i'm using import org.eclipse.jdt.annotation.nonnull annotation eclipse triggers warning:

eclipse warning

why warning triggered although i'm using constant (i.e. standardcharsets.utf8)?

the declaration standardcharsets.utf_8 is:

public static final charset utf_8 = charset.forname("utf-8"); 

as far eclipse null analysis concerned possible charset.forname might return null @notnull can't guaranteed.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -