Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Method invocation 'fab.setOnClickListener(new View.OnClickListener() { @Override public void on...' may produce 'java.lang.NullPointerException' less... (Ctrl+F1)
  2.  
  3. This inspection analyzes method control and data flow to report possible conditions that are always true or false, expressions whose value is statically proven to be constant, and situations that can lead to nullability contract violations.
  4.  
  5. Variables, method parameters and return values marked as @Nullable or @NotNull are treated as nullable (or not-null, respectively) and used during the analysis to check nullability contracts, e.g. report possible NullPointerException errors.
  6.  
  7. More complex contracts can be defined using @Contract annotation, for example:
  8.  
  9. @Contract("_, null -> null") — method returns null if its second argument is null
  10. @Contract("_, null -> null; _, !null -> !null") — method returns null if its second argument is null and not-null otherwise @Contract("true -> fail") — a typical assertFalse method which throws an exception if true is passed to it
  11.  
  12. The inspection can be configured to use custom @Nullable
  13. @NotNull annotations (by default the ones from annotations.jar will be used)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement