This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build: NetBeans IDE Dev (Build 200709101200) VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06 OS: Windows 2003, 5.2, x86 User Comments: Opened the Javadoc Index Search via the Help menu. Typed in the search term "Server". The JavaDocs include the standard JDK JavaDocs, anything included automatically with a webapp, and JavaDocs for ESRI ArcObjects. I clicked on the first entry in the list of matches and got the null pointer exception. Everything appears to be working--the JavaDoc content panel shows the correct JavaDoc contents.
Created attachment 48610 [details] stacktrace
I optimized the search tool to invoke the html browser only once. It does not fixed the issue but minimize the probability it occurs again. /cvs/javadoc/src/org/netbeans/modules/javadoc/search/DocIndexItem.java,v <-- DocIndexItem.java new revision: 1.17; previous revision: 1.16 done Checking in IndexSearch.java; /cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexSearch.java,v <-- IndexSearch.java new revision: 1.69; previous revision: 1.68 Reassigning to openide/awt in order to evaluate the swing browser threading. The potential NPE reason could be at org.openide.awt.SwingBrowserImpl.run where I found doc.putProperty(Document.StreamDescriptionProperty, null). Try also to debug HtmlBrowser.setURL invocation. I was surprised how often it was rescheduled to other threads before it comes to SwingBrowserImpl.run. Even more surprising is the count of passes through the SwingBrowserImpl.run.
Yes threading is problem. Setting doc.putProperty(Document.StreamDescriptionProperty, null). is correct way http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html#setPage(java.net.URL) how to force reload ie. skip caching when the same URL is set to JEditorPane. Problem is that SwingBrowserImpl.run does it out of AWT thread but JEditoPane accessesthis property in AWT thread without checking it is null or not. If this happens between SwingBrowserImpl.run set property to null and call of JEditorPane.setPage(URL) NPE arises. => fix is to do this in AWT thread. (We cannot synchronize access with AWT thread in JEditorPane or any other place in Swing. Another example Swing is NOT thread safe.
This is caused by fix of issue #71450.
Quite easy to reproduce: Just press Reload button repeatedly on the same URL. It happens quite often though not always.
It happens when URL has reference part ie it ends with #<something> which is usual when you select some method in Java class eg: jar:file:/home/mslama/jdk-6-doc.zip!/docs/api/javax/swing/JEditorPane.html#JEditorPane()
*** This issue has been marked as a duplicate of 71450 ***