JDK annotations contain invalid NotNull annotation

Answered

Hi,

I just spent the better part of my afternoon debugging a null pointer exception in my code. The reason for this is a faulty jdk annotation that IDEA gets from somewhere.

The offending method is org.w3c.dom.Node#getAttributes(). In the jdkAnnotations.jar file that IntelliJ uses for external annotations, this method is listed as having a NotNull annotation. However, the method javadoc from the jdk mention that null values can be returned.

 

I have two questions:

  1. Why is this method annotated as NotNull if this is not the case?
  2. What is the source of this file? It has appeared in my IDEA settings but I'm not sure where it comes from. Who decides what goes in here?

 

Thanks

1 comment
Comment actions Permalink

We've created a ticket to investigate this, please follow https://youtrack.jetbrains.com/issue/IDEA-297812

0

Please sign in to leave a comment.