sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1708130 - in /sis/branches/JDK7: ./ core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/ core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/
Date Mon, 12 Oct 2015 14:32:08 GMT
Author: desruisseaux
Date: Mon Oct 12 14:32:08 2015
New Revision: 1708130

URL: http://svn.apache.org/viewvc?rev=1708130&view=rev
Log:
Merge from the JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/DerivedCRS.xml

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 14:32:08 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1708091
+/sis/branches/JDK8:1584960-1708129
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java?rev=1708130&r1=1708129&r2=1708130&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
[UTF-8] Mon Oct 12 14:32:08 2015
@@ -143,6 +143,7 @@ class IndexedResourceCompiler implements
      * @throws ResourceCompilerException If an error occurred.
      * @return The number of errors found.
      */
+    @SuppressWarnings("ForLoopReplaceableByForEach")
     public int run() throws ResourceCompilerException {
         if (!sourceDirectory.isDirectory()) {
             throw new ResourceCompilerException(sourceDirectory + " not found or is not a
directory.");
@@ -323,18 +324,18 @@ class IndexedResourceCompiler implements
              * Checks if the expected arguments count (according to naming conventions)
              * matches the arguments count found in the MessageFormat pattern.
              */
-            final int argumentCount;
+            int argumentCount = 0;
+            String resource = value;
             final int index = key.lastIndexOf(ARGUMENT_COUNT_PREFIX);
-            if (index < 0) {
-                argumentCount = 0;
-                resources.put(key, value); // Text will not be formatted using MessageFormat.
-            } else try {
+            if (index >= 0) try {
                 String suffix = key.substring(index + ARGUMENT_COUNT_PREFIX.length());
                 argumentCount = Integer.parseInt(suffix);
-                resources.put(key, message.toPattern());
+                resource = message.toPattern();
             } catch (NumberFormatException exception) {
-                warning(file, key, "Bad number in resource key", exception);
-                continue;
+                // No warning - allow use of underscore for other purpose.
+            }
+            if (resources.put(key, resource) != null) {
+                warning(file, key, "Duplicated key", null);
             }
             final int expected = message.getFormatsByArgumentIndex().length;
             if (argumentCount != expected) {
@@ -605,6 +606,7 @@ search: for (int i=0; i<buffer.length();
      *
      * @param message The message to log.
      */
+    @SuppressWarnings("UseOfSystemOutOrSystemErr")
     protected void info(final String message) {
         System.out.println(message);
     }
@@ -615,6 +617,7 @@ search: for (int i=0; i<buffer.length();
      *
      * @param message The message to log.
      */
+    @SuppressWarnings("UseOfSystemOutOrSystemErr")
     protected void warning(final String message) {
         System.out.println(message);
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java?rev=1708130&r1=1708129&r2=1708130&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
[UTF-8] Mon Oct 12 14:32:08 2015
@@ -239,6 +239,6 @@ public final strictfp class DefaultDeriv
         /*
          * Test marshalling and compare with the original file.
          */
-        assertMarshalEqualsFile(XML_FILE, crs, "xmlns:*", "xsi:schemaLocation", "gml:id");
+        assertMarshalEqualsFile(XML_FILE, crs, "xmlns:*", "xsi:schemaLocation");
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/DerivedCRS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/DerivedCRS.xml?rev=1708130&r1=1708129&r2=1708130&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/DerivedCRS.xml
(original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/DerivedCRS.xml
Mon Oct 12 14:32:08 2015
@@ -22,15 +22,15 @@
                 xmlns:gml          = "http://www.opengis.net/gml/3.2"
                 xmlns:xlink        = "http://www.w3.org/1999/xlink"
                 xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
-                gml:id             = "test-derived-crs">
+                gml:id             = "test-crs-derived">
 
-  <gml:identifier codeSpace="SIS">urn:ogc:def:crs:SIS::test-derived-crs</gml:identifier>
-  <gml:name codeSpace="SIS">Topocentric example</gml:name>
+  <gml:identifier codeSpace="test">urn:ogc:def:crs:test::derived</gml:identifier>
+  <gml:name codeSpace="test">Topocentric example</gml:name>
   <gml:scope>Nowhere.</gml:scope>
   <gml:conversion>
-    <gml:Conversion gml:id="test-conversion">
-      <gml:identifier codeSpace="SIS">urn:ogc:def:coordinateOperation:SIS::test-conversion</gml:identifier>
-      <gml:name codeSpace="SIS">Topocentric example</gml:name>
+    <gml:Conversion gml:id="test-coordinateOperation-frombase">
+      <gml:identifier codeSpace="test">urn:ogc:def:coordinateOperation:test::fromBase</gml:identifier>
+      <gml:name codeSpace="test">Topocentric example</gml:name>
       <gml:scope>Nowhere.</gml:scope>
       <gml:method>
         <gml:OperationMethod gml:id="epsg-method-9837">
@@ -150,28 +150,28 @@
   <gml:derivedCRSType codeSpace="EPSG">engineering</gml:derivedCRSType>
 
   <gml:coordinateSystem>
-    <gml:CartesianCS gml:id="test-cs">
-      <gml:identifier codeSpace="SIS">urn:ogc:def:cs:SIS::test-cs</gml:identifier>
+    <gml:CartesianCS gml:id="test-cs-derivedcs">
+      <gml:identifier codeSpace="test">urn:ogc:def:cs:test::derivedCS</gml:identifier>
       <gml:name>Topocentric easting and northing</gml:name>
       <gml:axis>
-        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-east">
-          <gml:identifier codeSpace="SIS">urn:ogc:def:axis:SIS::test-east</gml:identifier>
+        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-axis-east">
+          <gml:identifier codeSpace="test">urn:ogc:def:axis:test::east</gml:identifier>
           <gml:name>Topocentric East</gml:name>
           <gml:axisAbbrev>U</gml:axisAbbrev>
           <gml:axisDirection codeSpace="EPSG">east</gml:axisDirection>
         </gml:CoordinateSystemAxis>
       </gml:axis>
       <gml:axis>
-        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-north">
-          <gml:identifier codeSpace="SIS">urn:ogc:def:axis:SIS::test-north</gml:identifier>
+        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-axis-north">
+          <gml:identifier codeSpace="test">urn:ogc:def:axis:test::north</gml:identifier>
           <gml:name>Topocentric North</gml:name>
           <gml:axisAbbrev>V</gml:axisAbbrev>
           <gml:axisDirection codeSpace="EPSG">north</gml:axisDirection>
         </gml:CoordinateSystemAxis>
       </gml:axis>
       <gml:axis>
-        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-up">
-          <gml:identifier codeSpace="SIS">urn:ogc:def:axis:SIS::test-up</gml:identifier>
+        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="test-axis-up">
+          <gml:identifier codeSpace="test">urn:ogc:def:axis:test::up</gml:identifier>
           <gml:name>Topocentric Up</gml:name>
           <gml:axisAbbrev>z</gml:axisAbbrev>
           <gml:axisDirection codeSpace="EPSG">up</gml:axisDirection>



Mime
View raw message