sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1652464 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/ sis-utility/src/main/java/org/apache/sis/internal/util/ sis-utility/src/test/j...
Date Fri, 16 Jan 2015 17:24:27 GMT
Author: desruisseaux
Date: Fri Jan 16 17:24:26 2015
New Revision: 1652464

URL: http://svn.apache.org/r1652464
Log:
Update for a change in GeoAPI pending interfaces (org.opengis.temporal).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java?rev=1652464&r1=1652463&r2=1652464&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] Fri Jan 16 17:24:26 2015
@@ -168,7 +168,7 @@ public class DefaultTemporalExtent exten
         } else {
             return null;
         }
-        return instant.getPosition().getDate();
+        return instant.getDate();
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java?rev=1652464&r1=1652463&r2=1652464&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
[UTF-8] Fri Jan 16 17:24:26 2015
@@ -16,13 +16,13 @@
  */
 package org.apache.sis.internal.jaxb.gml;
 
+import java.util.Date;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.datatype.DatatypeConfigurationException;
 import org.opengis.temporal.Instant;
-import org.opengis.temporal.Position;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.XmlUtilities;
 
@@ -78,14 +78,14 @@ public final class TimeInstant extends G
      */
     static XMLGregorianCalendar toXML(final Instant instant) {
         if (instant != null) {
-            final Position position = instant.getPosition();
-            if (position != null) {
+            final Date date = instant.getDate();
+            if (date != null) {
                 final Context context = Context.current();
                 try {
-                    final XMLGregorianCalendar date = XmlUtilities.toXML(context, position.getDate());
-                    if (date != null) {
-                        XmlUtilities.trimTime(date, false);
-                        return date;
+                    final XMLGregorianCalendar gc = XmlUtilities.toXML(context, date);
+                    if (gc != null) {
+                        XmlUtilities.trimTime(gc, false);
+                        return gc;
                     }
                 } catch (DatatypeConfigurationException e) {
                     Context.warningOccured(context, TimeInstant.class, "toXML", e, true);

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java?rev=1652464&r1=1652463&r2=1652464&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
[UTF-8] Fri Jan 16 17:24:26 2015
@@ -60,7 +60,7 @@ public final class TemporalUtilities ext
      * Creates an instant for the given date using the given factory.
      */
     private static Instant createInstant(final TemporalFactory factory, final Date date)
{
-        return factory.createInstant(factory.createPosition(date));
+        return factory.createInstant(date);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java?rev=1652464&r1=1652463&r2=1652464&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java
[UTF-8] Fri Jan 16 17:24:26 2015
@@ -16,19 +16,13 @@
  */
 package org.apache.sis.internal.jaxb.gml;
 
-import java.sql.Time;
 import java.util.Date;
-import java.util.Collection;
-import java.util.Collections;
 import org.opengis.temporal.Instant;
-import org.opengis.temporal.Period;
 import org.opengis.temporal.Duration;
-import org.opengis.temporal.Position;
 import org.opengis.temporal.RelativePosition;
 import org.opengis.temporal.TemporalPosition;
 import org.opengis.temporal.TemporalPrimitive;
 import org.opengis.temporal.TemporalGeometricPrimitive;
-import org.opengis.util.InternationalString;
 import org.apache.sis.internal.simple.SimpleIdentifiedObject;
 
 
@@ -42,7 +36,7 @@ import org.apache.sis.internal.simple.Si
  * @module
  */
 @SuppressWarnings("serial")
-final class DummyInstant extends SimpleIdentifiedObject implements Instant, Position {
+final class DummyInstant extends SimpleIdentifiedObject implements Instant {
     /**
      * The time, in milliseconds elapsed since January 1st, 1970.
      */
@@ -64,26 +58,10 @@ final class DummyInstant extends SimpleI
     }
 
     /**
-     * Returns the position, which is {@code this}.
-     */
-    @Override
-    public Position getPosition() {
-        return this;
-    }
-
-    /**
-     * Empty properties.
-     */
-    @Override public Time                getTime()     {return null;}
-    @Override public InternationalString getDateTime() {return null;}
-    @Override public TemporalPosition    anyOther()    {return null;}
-    @Override public Collection<Period>  getBegunBy()  {return Collections.emptySet();}
-    @Override public Collection<Period>  getEndedBy()  {return Collections.emptySet();}
-    @Override public Duration            length()      {return null;}
-
-    /**
      * Unsupported operations.
      */
+    @Override public Duration         length()                                   {throw new
UnsupportedOperationException();}
     @Override public RelativePosition relativePosition(TemporalPrimitive  other) {throw new
UnsupportedOperationException();}
     @Override public Duration         distance(TemporalGeometricPrimitive other) {throw new
UnsupportedOperationException();}
+    @Override public TemporalPosition getTemporalPosition()                      {throw new
UnsupportedOperationException();}
 }



Mime
View raw message