From owner-freebsd-java@FreeBSD.ORG  Fri Feb 24 16:10:10 2006
Return-Path: <owner-freebsd-java@FreeBSD.ORG>
X-Original-To: freebsd-java@freebsd.org
Delivered-To: freebsd-java@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A78C116A420
	for <freebsd-java@freebsd.org>; Fri, 24 Feb 2006 16:10:10 +0000 (GMT)
	(envelope-from lists@intricatesoftware.com)
Received: from mta8.srv.hcvlny.cv.net (mta8.srv.hcvlny.cv.net [167.206.4.203])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4AB6843D8D
	for <freebsd-java@freebsd.org>; Fri, 24 Feb 2006 16:09:56 +0000 (GMT)
	(envelope-from lists@intricatesoftware.com)
Received: from [172.16.1.72] (ool-457a77e8.dyn.optonline.net [69.122.119.232])
	by mta8.srv.hcvlny.cv.net
	(Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005))
	with ESMTP id <0IV700FMP8VSUC50@mta8.srv.hcvlny.cv.net> for
	freebsd-java@freebsd.org; Fri, 24 Feb 2006 11:09:29 -0500 (EST)
Date: Fri, 24 Feb 2006 11:09:27 -0500
From: Kurt Miller <lists@intricatesoftware.com>
In-reply-to: <1757973988.20060224034740@jetbrains.com>
To: freebsd-java@freebsd.org, Serge Baranov <serge@jetbrains.com>
Message-id: <200602241109.27845.lists@intricatesoftware.com>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT
Content-disposition: inline
References: <1757973988.20060224034740@jetbrains.com>
User-Agent: KMail/1.9.1
Cc: 
Subject: Re: NullPointerException in Charset.java:493
X-BeenThere: freebsd-java@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: kurt@intricatesoftware.com
List-Id: Porting Java to FreeBSD <freebsd-java.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-java>,
	<mailto:freebsd-java-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-java>
List-Post: <mailto:freebsd-java@freebsd.org>
List-Help: <mailto:freebsd-java-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-java>,
	<mailto:freebsd-java-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Feb 2006 16:10:10 -0000

Hi,

This will be fixed with patchset 3 in a few weeks.

-Kurt

On Thursday 23 February 2006 7:47 pm, Serge Baranov wrote:
> Hello All,
> 
> The following exception is thrown when calling:
> Charset.availableCharsets() JDK method.
> 
> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
>         at java.nio.charset.Charset.put(Charset.java:493)
>         at java.nio.charset.Charset.access$300(Charset.java:240)
>         at java.nio.charset.Charset$4.run(Charset.java:529)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.nio.charset.Charset.availableCharsets(Charset.java:525)
> 
> It has been already discussed:
> http://lists.freebsd.org/mailman/htdig/freebsd-java/2005-September/004339.html
> but the problem still exists.
> 
> Here is the test case that will reproduce the problem:
> 
> import java.nio.charset.Charset;
> import java.util.Iterator;
> import java.util.Set;
> 
> public class TestCase {
>   public static void main(String[] args) {
>     Set set = Charset.availableCharsets().keySet();
>     for (Iterator iterator = set.iterator(); iterator.hasNext();) {
>       String s = (String) iterator.next();
>       System.out.println(s);
>     }
>   }
> }
> 
> Save into TestCase.java
> Compile: javac TestCase.java
> Run: java TestCase
> 
> Expected result: list of available charsets printed.
> Actual result: NPE is thrown at java.nio.charset.Charset.put(Charset.java:493)
> 
> For some reason there is null charset returned at this point:
> Charset cs = (Charset)i.next();
> 
> Suggested fix: either add a null check as per Dan Cojocar reply or
> investigate why null appears there and fix it on the earlier stage.
> 
> Fixing this bug is very important, since it breaks functionality of
> almost any Java application that operates charsets (like IntelliJ IDEA).
> 
> System information:
> 
> $ java -version
> java version "1.5.0-p2"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-p2-root_23_feb_2006_08_02)
> Java HotSpot(TM) Client VM (build 1.5.0-p2-root_23_feb_2006_08_02, mixed mode)
> 6.1-PRERELEASE i386
> 
> P.S. I'm not subscribed to this list, put my address in CC field when
> replying.
> 
> 
> Serge Baranov
> JetBrains, Inc
> http://www.jetbrains.com
> "Develop with pleasure!"
> 
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
>