You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2007/01/31 12:00:10 UTC

[jira] Updated: (HARMONY-2415) [classlib][logging] Compatibility: java.util.logging.Level.getLocalizedName() returns non-localized string name

     [ https://issues.apache.org/jira/browse/HARMONY-2415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison updated HARMONY-2415:
---------------------------------

    Summary: [classlib][logging] Compatibility: java.util.logging.Level.getLocalizedName() returns non-localized string name  (was: [classlib][logging] Compatibility: Harmonyjava.util.logging.Level.getLocalizedName() returns non-localized string name)

> [classlib][logging] Compatibility: java.util.logging.Level.getLocalizedName() returns non-localized string name
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2415
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2415
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>         Assigned To: Tim Ellison
>         Attachments: HARMONY-2415-test.patch, HARMONY-2415.patch
>
>
> When Level is created as some ResourceBundle, getLocalizedName() returns
> non-localized string name. This equals the result of getName().
> But on RI getLocalizedName() returns the same value as the 
> resourceBundle.getString(levelName)
> Code for reproducing:
> To reproduce this bug run the following test:
> ---------------HT1_resource.java-------------
> import java.util.ListResourceBundle;
> public class HT1_resource extends ListResourceBundle {
>     public Object[][] getContents() {
>             return contents;
>     }
>     static final Object[][] contents = {
>                 {"Level_error", "Name"},
>                 {"Localized", "Localized message"},
>     };
> }
> ----------------HT1.java--------------
> import java.text.*;
> import java.util.*;
> import java.util.logging.*;
> import java.io.*;
> import junit.framework.TestCase;
> public class HT1 extends TestCase {
>     public final String bundleName = "HT1_resource";
>     public void testT() {
>         String levelName = "Level_error";
>         Level newLevel = new myLevel(levelName, 600, bundleName);
>         //getLocalizedName() should return the same value as 
>         //resourceBundle.getString(levelName)
>         ResourceBundle rb = ResourceBundle.getBundle(bundleName);
>         String lName = newLevel.getLocalizedName();
>         String rName = rb.getString(levelName);
>         if (!lName.equals(rName)) {
>             fail("getLocalizedName() returns "
>                                 + lName
>                                 + " but should return the same value as " 
>                                 + rName);
>         }
>     }
> }
> class myLevel extends Level {
>     public myLevel (String name, int value) {
>         super(name, value);
>     }
>     public myLevel (String name, int value, String resourceBundleName) {
>         super(name, value, resourceBundleName);
>     }
> }
> ------------------------
> Steps to Reproduce:
> 1) Create HT1 and HT1_resource classes
> 2) Run test
>    java -cp .:junit.jar -showversion junit.textui.TestRunner HT1
> Output:
> On RI:
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .
> Time: 0.015
> OK (1 test)
> On Harmony:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software
> Foundation or its licensors, as applicable.
> java version "1.5.0" 
> pre-alpha : not complete or compatible
> svn = rsvn: '.' is not a working copy, (Sep 26 2006), Linux/ia32/gcc 3.3.3,
> release build
> http://incubator.apache.org/harmony
> .F
> Time: 0.113
> There was 1 failure:
> 1) testT(HT1)junit.framework.AssertionFailedError: getLocalizedName() returns
> Level_error but should return the same value as Name
>         at HT1.testT(HT1.java:22)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0
> On Harmony+j9
> .F
> Time: 0.047
> There was 1 failure:
> 1) testT(HT1)junit.framework.AssertionFailedError: getLocalizedName() returns
> Level_error
> but should return the same value as Name
>         at HT1.testT(HT1.java:22)
>         at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.