1

Topic: Check @NotNull during time

It would be desirable compile-time check of a correctness of summaries. Especially @NotNull / NonNull. While the maximum that found - Intellij IDEA can show in the editor resetting null as an error. But it no more than illumination of a piece of a line in the editor, it can easily not note or ignore. It would be desirable it is direct rigid check. That at attempt to return null  produced an error. It is clear, what the compiler such most likely does not support, but probably static analyzers are able? FindBugs, for example? Somebody adjusted the such? Prompt where to dig and what to smoke?

2

Re: Check @NotNull during time

AK> It would be desirable it is direct rigid check. That at attempt to return null  produced an error. It is clear, what the compiler such most likely does not support, but probably static analyzers are able? FindBugs, for example?  is able, but he is able only the predetermined summaries. The IDEA can be adjusted on any.

3

Re: Check @NotNull during time

Hello, bzig, you wrote: B> FajndBags is able, but he is able only the predetermined summaries. The IDEA can be adjusted on any. IDEA here does not help. Adjustments IDEA do not stop  on such errors, because  in maven, instead of in IDEA. FindBugs at me for some reason at all did not earn with such summaries. Today felt SpotBugs - developers SpotBugs  FindBugs and develop the project further. On most FindBugs something motions is not strong much. SpotBugs easily could find "naive" violation - attempt to return null, but did not see anything suspicious in such code: @NonNull String foo () {Map <String, String> map = new HashMap <String, String> (); if (map.contains ("")) {return map.get (new Object ());} return "";} And here other project, ErrorProne together with plug-in NullAway from Uber found at once a problem - told that the result of performance get () can return null so this code breaks the summary. While ErrorProne + NullAway speed of the analysis so-so looks the most efficient variant, but. Time  at me increased since two minutes to ten. Plus, not so is pleasant to me them (NullAway) the approach when all is declared NotNull by default - if somewhere can theoretically return null the summary is required. So, it is necessary to change fairly source codes to begin with it to work. Tomorrow I will try all the same FindBugs to force it to check up - it seems, I understood, why it did not check. It checks only already compiled code, instead of a source code. And I simply changed the code and launched the analysis. It was necessary at first "mvn compile" to make.

4

Re: Check @NotNull during time

AK> Tomorrow I will try all the same FindBugs to force it to check up - it seems, I understood, why it did not check. It checks only already compiled code, instead of a source code. And I simply changed the code and launched the analysis. It was necessary at first "mvn compile" to make.  it is normal in Continious Integration drive, but it is possible, probably, and in  on compile to hang, only what for? AK> FindBugs at me for some reason at all did not earn with such summaries.  is able only javax.annotations which are suddenly spread in a packet com.google.code.findbugs:jsr AK> Plus, not so it is pleasant to me them (NullAway) the approach when all is declared NotNull by default - if somewhere can theoretically return null the summary is required. It, by the way, good approach AK> So, it is necessary to change fairly source codes to begin with it to work. Once  also it is ready.