Bug#306371: NPE building lucene javadocs

Julian Scheid Julian Scheid <julian@sektor37.de>, 306371@bugs.debian.org
Tue Apr 26 13:13:03 2005


ms419@freezone.co.uk wrote:
> Package: gjdoc
> Version: 0.7.3-1
> 
[snip]
>   [javadoc] Fetching package list for external documentation set.
>   [javadoc] java.lang.NullPointerException
>   [javadoc]    at java.io.InputStreamReader.<init> 
> (InputStreamReader.java:137)
>   [javadoc]    at 
> gnu.classpath.tools.doclets.htmldoclet.ExternalDocSet.readPackages 
> (ExternalDocSet.java:94)
>   [javadoc]    at 
> gnu.classpath.tools.doclets.htmldoclet.ExternalDocSet.load 
> (ExternalDocSet.java:79)
[snip]

Thanks for your bug report which revealed two distinct issues.

Firstly, gjdoc wasn't properly checking for URL.openStream() returning 
null. This is fixed in cvs head now. If you try again with head, you 
should get a warning message like "Cannot fetch package list from 
http://java.sun.com/j2se/1.4/docs/api/".

Secondly, the current Classpath implementation of URL.openStream() is 
buggy: for the URL above, which redirects to .../j2se/1.4.2/... using a 
302 (Moved Temporarily) HTTP response code, the redirection isn't 
followed but instead a null stream is returned. And for non-existing 
URLs it returns a stream instead of raising a FileNotFoundException.

I've filed a corresponding bug report which already has been partly 
acted upon:
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=12815

As a temporary workaround until these bugs are fixed in the kaffe debian 
package, you may want to change the URL in line 29 in lucene's top-level 
build.xml to read "http://java.sun.com/j2se/1.4.2/docs/api/" - or, even 
better, "http://developer.classpath.org/doc/" :-)

Cheers,

Julian