jdk1.5.0p2 nio NPE

Dan Cojocar dan.cojocar at gmail.com
Fri Sep 23 13:41:02 PDT 2005


On 9/22/05, Greg Lewis <glewis at eyesbeyond.com> wrote:
>
> On Wed, Sep 21, 2005 at 05:34:32PM +0300, Dan Cojocar wrote:
> > I just tried the new patchset and i receive the following exception when
> i
> > want to start Intellij's idea:
> >
> > java.lang.NullPointerException
> > at java.nio.charset.Charset.put(Charset.java:493)
> [snip]
>
> Is this a regression, i.e., did it work with patchset 1? Not knowing
> how Intellij works, is it possible to run this under jdb and get some
> more information on this (there are two variables on that line which
> could cause a NullPointerException).


Hello Greg,
I didn't noticed this on patchset 1 until now because I didn't have the new
eap from intellij, it seems that only with this last eap i get this NPE. But
now i can confirm that patchset 1 is affected too :(

But if I modify line 493 in Charset.java to check if cs is not null,
intellij's idea is working properly.

--- Charset.java.orig Fri Sep 23 23:29:08 2005
+++ Charset.java Fri Sep 23 23:23:43 2005
@@ -490,7 +490,7 @@
private static void put(Iterator i, Map m) {
while (i.hasNext()) {
Charset cs = (Charset)i.next();
- if (!m.containsKey(cs.name()))
+ if (cs!=null&&!m.containsKey(cs.name()))
m.put(cs.name(), cs);
}
}


Thanks,
Dan


More information about the freebsd-java mailing list