Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
unspecified
-
None
-
None
-
Operating System: All
Platform: All
-
5891
Description
I sometimes see the following stacktrace:
Exception:java.lang.NullPointerException: null
at org.opendaylight.yangide.editor.editors.text.help.HelpCompositionUtils.getNodeHelp(HelpCompositionUtils.java:50)
at org.opendaylight.yangide.editor.editors.text.hover.YangTextHover.getHoverInfo(YangTextHover.java:71)
at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Besides the error dialog, I don't see any consequences from it.
Here's the "getNodeHelp" method:
------------
public static String getNodeHelp(ASTNode node) {
if (node.getDescription() != null && node.getDescription().length() > 0)
String info = getIndexedInfo(node);
if (info == null)
info = getLanguageHelp(node);
return info;
}
-------------
From the context of line 50, it appears that "node" is null. I don't think I've ever seen this happen when I had the debugger connected and a breakpoint enabled here. I've tried to connect up the debugger after I see this happen, but I've never been able to repeat it when the debugger is connected.
A simple fix could be to just return null if node is null. It appears from inspecting the "TextViewerHoverManager" code that calls this indirectly, that it would deal smoothly with a null return value.
However, it's not clear whether getting a null value here is an indication of something else going wrong.