@ExpectWarning(value="NP_NULL_ON_SOME_PATH_EXCEPTION") @NoWarning(value="NP_ALWAYS_NULL,NP_NULL_ON_SOME_PATH") public static void falsePositive(){
  String str=null;
  for (int i=0; i < 2; i++) {
    try {
      str=new String("Test");
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
    str.charAt(i);
    str=null;
  }
}

@ ExpectWarning ( value = "NP_NULL_ON_SOME_PATH_EXCEPTION" ) @ NoWarning ( value = "NP_ALWAYS_NULL,NP_NULL_ON_SOME_PATH" ) public static void falsePositive ( ) { String str = null ; for ( int i = 0 ; i < 2 ; i ++ ) { try { str = new String ( "Test" ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } str . charAt ( i ) ; str = null ; } }
checking fp npe warnings generated by eclipse to ensure we don ' t generate them https : / / bugs . eclipse . org / bugs / show_bug . cgi ? id = 195638
