sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1499442 - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/test/java/org/apache/sis/test/suite/
Date Wed, 03 Jul 2013 15:25:58 GMT
Author: desruisseaux
Date: Wed Jul  3 15:25:58 2013
New Revision: 1499442

URL: http://svn.apache.org/r1499442
Log:
Merge last-minute bug fix from JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
      - copied, changed from r1499441, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1499407-1499441

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1499442&r1=1499441&r2=1499442&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] Wed Jul  3 15:25:58 2013
@@ -301,15 +301,7 @@ public class ImmutableIdentifier impleme
             final Locale locale = Locales.parseSuffix(REMARKS_KEY, key);
             if (locale != null) {
                 if (localized == null) {
-                    if (remarks instanceof DefaultInternationalString) {
-                        localized = (DefaultInternationalString) remarks;
-                    } else {
-                        localized = new DefaultInternationalString();
-                        if (remarks instanceof CharSequence) { // String or InternationalString.
-                            localized.add(Locale.ROOT, remarks.toString());
-                            remarks = null;
-                        }
-                    }
+                    localized = new DefaultInternationalString();
                 }
                 localized.add(locale, (String) value);
             }
@@ -319,9 +311,12 @@ public class ImmutableIdentifier impleme
          * both as InternationalString and as String for some locales (which is a weird
          * usage...), then current implementation discards the later with a warning.
          */
-        if (localized != null && !localized.getLocales().isEmpty()) {
+        if (localized != null) {
             if (remarks == null) {
                 remarks = localized;
+            } else if (remarks instanceof SimpleInternationalString) {
+                localized.add(Locale.ROOT, remarks.toString());
+                remarks = localized;
             } else {
                 Logging.log(ImmutableIdentifier.class, "<init>",
                     Messages.getResources(null).getLogRecord(Level.WARNING, Messages.Keys.LocalesDiscarded));

Copied: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
(from r1499441, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?p2=sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java&r1=1499441&r2=1499442&rev=1499442&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
[UTF-8] Wed Jul  3 15:25:58 2013
@@ -44,7 +44,7 @@ public final strictfp class ImmutableIde
      * Returns the properties map to be used in argument to test methods.
      */
     private static Map<String,Object> properties() {
-        final Map<String,Object> properties = new HashMap<>();
+        final Map<String,Object> properties = new HashMap<String,Object>();
         assertNull(properties.put(CODE_KEY,        "This is a code"));
         assertNull(properties.put(AUTHORITY_KEY,   "This is an authority"));
         assertNull(properties.put(VERSION_KEY,     "This is a version"));

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1499442&r1=1499441&r2=1499442&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
[UTF-8] Wed Jul  3 15:25:58 2013
@@ -53,6 +53,7 @@ import org.junit.BeforeClass;
     org.apache.sis.metadata.MetadataStandardTest.class,
     org.apache.sis.metadata.PrunerTest.class,
     org.apache.sis.metadata.AbstractMetadataTest.class,
+    org.apache.sis.metadata.iso.ImmutableIdentifierTest.class,
     org.apache.sis.metadata.iso.AllMetadataTest.class,
 
     // XML marshalling.



Mime
View raw message