History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-18231
Type: Bug Bug
Status: Open Open
Assignee: Maxim Shafirov
Reporter: Jan Thomä
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

@Nullable inspection doesn't recognize != null check

Created: 27 May 08 23:17   Updated: 28 May 08 12:50
Component/s: Code Analysis. Inspection

Build: 7,757
Severity: Low


 Description  « Hide
I have used the @Nullable annotation for a function parameter. Yet even when i check the variable for being != null i still get an inspection warning that an NPE might be thrown:
public void processOutdatedItem(CompileContext compileContext, String s, @Nullable final ValidityState validityState)
  {
    if (validityState != null)
    {
      ApplicationManager.getApplication().runReadAction(new Runnable()
      {
        public void run()
        {
          BundleValidityState myvalstate = (BundleValidityState) validityState;
          String jarUrl = myvalstate.getOutputJarUrl();
          if (jarUrl != null)
          {
            FileUtil.delete(new File(VfsUtil.urlToPath(jarUrl)));
          }
        }
      }
      );
    }
  }

The part "myvalstate.getOutputJarUrl()" is marked as "can throw an NPE" even though the parameter is checked for being not null.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.