Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-889

False positive of "Null Pointer Dereference" when invoking Lamda

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 8.2, 9.0
    • None
    • java - Hints
    • None

    Description

      If the last line of a void Lamda is "field = null" and invoke the resulting (in this case) Runnable, Netbeans will tell you that you are dereferncing a null pointer.

      // Some comments here
      	String value = "";
      	void nullDereference(){
      		Runnable run = ()->{
      			value = null;
      		};
      		run.run();//false positive
      	}
      

      Attachments

        1. NETBEANS-889-2.diff
          9 kB
          Jan Lahoda
        2. NETBEANS-889-1.diff
          7 kB
          Jan Lahoda

        Activity

          People

            Unassigned Unassigned
            Sir Intellegence Austin Stephens
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: