Author: desruisseaux Date: Mon Jul 6 11:09:07 2015 New Revision: 1689365 URL: http://svn.apache.org/r1689365 Log: Merge from the JDK8 branch.
Modified: sis/branches/JDK7/ (props changed) sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/ElementTest.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java Propchange: sis/branches/JDK7/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Jul 6 11:09:07 2015 @@ -1,4 +1,4 @@ /sis/branches/Android:1430670-1480699 /sis/branches/JDK6:1394913-1508480 -/sis/branches/JDK8:1584960-1689354 +/sis/branches/JDK8:1584960-1689363 /sis/trunk:1394364-1508466,1519089-1519674 Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1689365&r1=1689364&r2=1689365&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] Mon Jul 6 11:09:07 2015 @@ -208,7 +208,12 @@ final class Element { } lower = upper + n; // After the closing quote. } while (lower < text.length() && text.codePointAt(lower) == closingQuote); - list.add(content.toString()); + /* + * Leading and trailing spaces should be ignored according ISO 19162 §B.4. + * Note that the specification suggests also to replace consecutive white + * spaces by a single space, but we don't do that yet. + */ + list.add(CharSequences.trimWhitespaces(content).toString()); } else if (!Character.isUnicodeIdentifierStart(firstChar)) { /* * Try to parse the next element as a date or a number. We will attempt such parsing Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1689365&r1=1689364&r2=1689365&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] Mon Jul 6 11:09:07 2015 @@ -670,7 +670,7 @@ final class GeodeticObjectParser extends final Element element = parent.pullElement(OPTIONAL, WKTKeywords.CS); if (element != null) { final String expected = type; - type = CharSequences.trimWhitespaces(element.pullVoidElement("type").keyword); + type = element.pullVoidElement("type").keyword; dimension = element.pullInteger("dimension"); csProperties = new HashMap<>(parseMetadataAndClose(element, "CS", null)); if (expected != null) { @@ -954,7 +954,7 @@ final class GeodeticObjectParser extends * expressed by a syntax like AXIS[“South along 90°W”, SOUTH, MERIDIAN[-90, UNIT["deg"]]]. Note that * the meridian is relative to the prime meridian of the enclosing geodetic CRS. */ - String name = CharSequences.trimWhitespaces(element.pullString("name")); + String name = element.pullString("name"); final Element orientation = element.pullVoidElement("orientation"); Unit<?> unit = parseUnit(element); if (unit == null) { Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/ElementTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/ElementTest.java?rev=1689365&r1=1689364&r2=1689365&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/ElementTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/ElementTest.java [UTF-8] Mon Jul 6 11:09:07 2015 @@ -83,10 +83,10 @@ public final strictfp class ElementTest assertEquals("value", "World Geodetic System 1984", element.pullString("value")); element.close(null); - // Spaces inside quotes should be preserved. + // Leading and trailing spaces inside quotes should be ignored (ISO 19162 §B.4). element = parse(" Datum [ \" World Geodetic System 1984 \" ] "); assertEquals("keyword", "Datum", element.keyword); - assertEquals("value", " World Geodetic System 1984 ", element.pullString("value")); + assertEquals("value", "World Geodetic System 1984", element.pullString("value")); element.close(null); // Consecutive values. Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java?rev=1689365&r1=1689364&r2=1689365&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] Mon Jul 6 11:09:07 2015 @@ -374,6 +374,7 @@ public class DefaultCoordinateOperationF /* * Undocumented (for now) feature: if the 'transform' argument is null but parameters are * found in the given properties, create the MathTransform instance from those parameters. + * This is needed for WKT parsing of CoordinateOperation[…] among others. */ if (transform == null) { final ParameterValueGroup parameters = Containers.property(properties,