Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 2862 invoked from network); 17 May 2007 15:36:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 May 2007 15:36:37 -0000 Received: (qmail 65497 invoked by uid 500); 17 May 2007 15:36:43 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 65483 invoked by uid 500); 17 May 2007 15:36:43 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 65473 invoked by uid 99); 17 May 2007 15:36:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 08:36:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 08:36:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B4F37714072 for ; Thu, 17 May 2007 08:36:16 -0700 (PDT) Message-ID: <23039132.1179416176737.JavaMail.jira@brutus> Date: Thu, 17 May 2007 08:36:16 -0700 (PDT) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-3823) [classlib][luni] Wrong implementation of strategy for instantiating resource bundles in java.util.ResourceBundle In-Reply-To: <8924302.1178638095772.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov resolved HARMONY-3823. -------------------------------------- Resolution: Fixed Thanks guys. Slightly modified version of the patch was committed at the revision 538967. Please verify that everything is fine. > [classlib][luni] Wrong implementation of strategy for instantiating resource bundles in java.util.ResourceBundle > ---------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-3823 > URL: https://issues.apache.org/jira/browse/HARMONY-3823 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: all > Reporter: Vladimir Molotkov > Priority: Critical > Attachments: H-3823.patch, H-3823_test.patch, test.zip > > > The spec says: > "... > First, it attempts to load a class using the candidate bundle name. If such a class can be found and loaded using the specified class loader, is assignment compatible with ResourceBundle, is accessible from ResourceBundle, and can be instantiated, getBundle creates a new instance of this class and uses it as the result resource bundle." > The following is corresponding code fragment from ResourceBundle: > ... > try { > Class bundleClass = Class.forName(bundleName, true, loader); > bundle = (ResourceBundle) bundleClass.newInstance(); > bundle.setLocale(locale); > } catch (LinkageError e) { > } catch (Exception e) { > } > ... > As we can see "bundle" class instance may be created even if specified instantiation conditions are not satisfied. > The bug causes 'Struts test' (http://issues.apache.org/jira/browse/HARMONY-3597) failure. > Attached archive contains simplified test which reproduces struts test situation. Just unzip and execute: > javac *.java > java b > RI test output: > ------------------ > $ java b > p: set class to 'b' > java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key nonexistent > java.util.MissingResourceException: Can't find bundle for base name a, locale en_US > java.util.MissingResourceException: Can't find bundle for base name java.lang.Object, locale en_US > p: found string 'Name' using key 'name' > PASSED > DRLVM test output: > ------------------------- > $ java b > p: set class to 'b' > p: set class to 'b' > java.util.MissingResourceException > p: set class to 'a' > java.util.MissingResourceException > java.util.MissingResourceException > java.util.MissingResourceException > java.util.MissingResourceException > FAILED -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.