sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1725536 - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
Date Tue, 19 Jan 2016 14:45:17 GMT
Author: desruisseaux
Date: Tue Jan 19 14:45:17 2016
New Revision: 1725536

URL: http://svn.apache.org/viewvc?rev=1725536&view=rev
Log:
Merge bug fixes from JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 19 14:45:17 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1724583
+/sis/branches/JDK8:1584960-1725532
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1725536&r1=1725535&r2=1725536&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Tue Jan 19 14:45:17 2016
@@ -1468,6 +1468,7 @@ public class Formatter implements Locali
                     throw new IllegalStateException();
                 }
             }
+            hasContextualUnit &= ~1;
         } else if (units.put(previous.toSI(), previous) != unit) {
             /*
              * The unit that we replaced was not the expected one. Probably the user has
invoked

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java?rev=1725536&r1=1725535&r2=1725536&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] Tue Jan 19 14:45:17 2016
@@ -59,6 +59,7 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.crs.DefaultVerticalCRS;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultGeocentricCRS;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.referencing.provider.TransverseMercator;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.system.SystemListener;
@@ -583,7 +584,7 @@ public enum CommonCRS {
                     }
                     // Use same name and datum than the geographic CRS.
                     final GeographicCRS base = geographic();
-                    object = new DefaultGeographicCRS(IdentifiedObjects.getProperties(base),
base.getDatum(), cs);
+                    object = new DefaultGeographicCRS(properties(base, geo3D), base.getDatum(),
cs);
                     cachedGeo3D = object;
                 }
             }
@@ -641,7 +642,7 @@ public enum CommonCRS {
                     }
                     // Use same name and datum than the geographic CRS.
                     final GeographicCRS base = geographic();
-                    object = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(base),
base.getDatum(), cs);
+                    object = new DefaultGeocentricCRS(properties(base, geocentric), base.getDatum(),
cs);
                     cachedGeocentric = object;
                 }
             }
@@ -1526,6 +1527,15 @@ public enum CommonCRS {
     }
 
     /**
+     * Returns the same properties than the given object, except for the identifier which
is set to the given code.
+     */
+    private static Map<String,?> properties(final IdentifiedObject template, final
short code) {
+        final Map<String,Object> properties = new HashMap<>(IdentifiedObjects.getProperties(template));
+        properties.put(GeographicCRS.IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG,
String.valueOf(code)));
+        return properties;
+    }
+
+    /**
      * Returns the EPSG factory to use for creating CRS, or {@code null} if none.
      * If this method returns {@code null}, then the caller will silently fallback on hard-coded
values.
      */



Mime
View raw message