sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1734394 - in /sis/branches/JDK8: core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/ core/sis-utility/src/main/java/org/apache/sis/internal/util/ storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/
Date Thu, 10 Mar 2016 12:27:40 GMT
Author: desruisseaux
Date: Thu Mar 10 12:27:40 2016
New Revision: 1734394

URL: http://svn.apache.org/viewvc?rev=1734394&view=rev
Log:
More uniformization in the way we parse ISO dates (for now - to be replaced by java.time package)
for easier merge with JDK7 branch.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1734394&r1=1734393&r2=1734394&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] Thu Mar 10 12:27:40 2016
@@ -40,7 +40,6 @@ import java.sql.ResultSetMetaData;
 import java.sql.Statement;
 import java.sql.SQLException;
 import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.text.ParseException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -115,6 +114,9 @@ import org.apache.sis.measure.Units;
 
 import static org.apache.sis.internal.referencing.ServicesForMetadata.CONNECTION;
 
+// Branch-dependent imports
+import org.apache.sis.internal.util.StandardDateFormat;
+
 
 /**
  * <cite>Data Access Object</cite> (DAO) creating geodetic objects from a JDBC
connection to an EPSG database.
@@ -1644,7 +1646,7 @@ addURIs:    for (int i=0; ; i++) {
                             throw new FactoryDataException(error().getString(Errors.Keys.DatumOriginShallBeDate));
                         }
                         if (dateFormat == null) {
-                            dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'",
Locale.CANADA);
+                            dateFormat = new StandardDateFormat();
                             dateFormat.setCalendar(getCalendar());          // Use UTC timezone.
                         }
                         try {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java?rev=1734394&r1=1734393&r2=1734394&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
[UTF-8] Thu Mar 10 12:27:40 2016
@@ -58,6 +58,13 @@ public final class StandardDateFormat ex
     public static final String SHORT_PATTERN = "yyyy-MM-dd";
 
     /**
+     * Creates a new format for a default locale in the UTC timezone.
+     */
+    public StandardDateFormat() {
+        this(Locale.CANADA);        // Canada locale symbols are close to the ISO ones.
+    }
+
+    /**
      * Creates a new format for the given locale in the UTC timezone.
      *
      * @param locale The locale of the format to create.

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1734394&r1=1734393&r2=1734394&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] Thu Mar 10 12:27:40 2016
@@ -30,8 +30,6 @@ import java.io.BufferedReader;
 import java.io.LineNumberReader;
 import java.io.IOException;
 import java.net.URI;
-import java.time.Instant;
-import java.time.DateTimeException;
 import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
@@ -63,6 +61,10 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.IndexedResourceBundle;
 
+// Branch-dependent imports
+import java.time.Instant;
+import java.time.DateTimeException;
+
 
 /**
  * A data store which creates feature instances from a CSV file using the OGC Moving Features
specification.



Mime
View raw message