harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r501793 - in /harmony/enhanced/classlib/trunk/modules/logging: .settings/ src/main/java/java/util/logging/ src/test/java/org/apache/harmony/logging/tests/java/util/logging/
Date Wed, 31 Jan 2007 10:59:54 GMT
Author: tellison
Date: Wed Jan 31 02:59:54 2007
New Revision: 501793

URL: http://svn.apache.org/viewvc?view=rev&rev=501793
Log:
Apply patch HARMONY-2415 ([classlib][logging] Compatibility: java.util.logging.Level.getLocalizedName()
returns non-localized string name)
Update Eclipse metadata to build 1.5 target code.


Added:
    harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java
  (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.ui.prefs
Modified:
    harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.core.prefs
    harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
    harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTest.java

Modified: harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.core.prefs?view=diff&rev=501793&r1=501792&r2=501793
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.core.prefs (original)
+++ harmony/enhanced/classlib/trunk/modules/logging/.settings/org.eclipse.jdt.core.prefs Wed
Jan 31 02:59:54 2007
@@ -1,7 +1,7 @@
-#Wed May 03 13:10:22 BST 2006
+#Wed Jan 31 10:53:59 GMT 2007
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.5
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate

Modified: harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java?view=diff&rev=501793&r1=501792&r2=501793
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
Wed Jan 31 02:59:54 2007
@@ -22,10 +22,12 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 import org.apache.harmony.logging.internal.nls.Messages;
+import org.apache.harmony.kernel.vm.VM;
 
 /**
  * <code>Level</code> objects are used to indicate the level of logging. There
@@ -204,7 +206,8 @@
         this.resourceBundleName = resourceBundleName;
         if (resourceBundleName != null) {
             try {
-                rb = ResourceBundle.getBundle(resourceBundleName);
+                rb = ResourceBundle.getBundle(resourceBundleName, 
+                		Locale.getDefault(), VM.callerClassLoader());
             } catch (MissingResourceException e) {
                 rb = null;
             }

Modified: harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTest.java?view=diff&rev=501793&r1=501792&r2=501793
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTest.java
Wed Jan 31 02:59:54 2007
@@ -335,6 +335,13 @@
 		Level l = new MockLevel("level1", 120,
 				"bundles/java/util/logging/res");
 		assertEquals(rb.getString("level1"), l.getLocalizedName());
+		
+        // regression test for HARMONY-2415
+        rb = ResourceBundle.getBundle(
+                "org.apache.harmony.logging.tests.java.util.logging.LevelTestResource");
+        l = new MockLevel("Level_error", 120, 
+                "org.apache.harmony.logging.tests.java.util.logging.LevelTestResource");
+        assertEquals(rb.getString("Level_error"), l.getLocalizedName());
 
 		l = new MockLevel("bad name", 120, "res");
 		assertEquals("bad name", l.getLocalizedName());

Added: harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java?view=auto&rev=501793
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java
Wed Jan 31 02:59:54 2007
@@ -0,0 +1,30 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.logging.tests.java.util.logging;
+
+import java.util.ListResourceBundle;
+
+public class LevelTestResource extends ListResourceBundle {
+    public Object[][] getContents() {
+        return contents;
+    }
+
+    @SuppressWarnings("nls")
+    static final Object[][] contents = { { "Level_error", "Name" },
+            { "Localized", "Localized message" }, };
+}
\ No newline at end of file

Propchange: harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LevelTestResource.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message