I am using Sonar and I have got this kind of violation from it for a peace of my code:
Correctness - Possible null pointer dereference
Has a
a sample code is something like this.
String s = null ; if (today is monday){ s = "Monday" ; else if (today is tuesday){ s = "Tuesday" ; } System.out.println(s.length()); //Will throw a null pointer if today is not monday or tuesday.