sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1758913 - in /sis/branches/JDK7: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-feature/src/test/java...
Date Fri, 02 Sep 2016 09:06:50 GMT
Author: desruisseaux
Date: Fri Sep  2 09:06:50 2016
New Revision: 1758913

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

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AssociationView.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
    sis/branches/JDK7/ide-project/NetBeans/build.xml
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 09:06:50 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1758394
+/sis/branches/JDK8:1584960-1758905
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.io.IOException;
 import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.ParameterValueGroup;
@@ -39,7 +40,6 @@ import org.opengis.feature.FeatureOperat
 import org.opengis.feature.IdentifiedType;
 import org.opengis.feature.Operation;
 import org.opengis.feature.Property;
-import org.opengis.metadata.Identifier;
 
 
 /**

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AssociationView.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AssociationView.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AssociationView.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AssociationView.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -18,6 +18,8 @@ package org.apache.sis.feature;
 
 import java.util.Collection;
 import org.opengis.util.GenericName;
+
+// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureAssociation;
 import org.opengis.feature.FeatureAssociationRole;

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -20,6 +20,8 @@ import java.util.Map;
 import java.util.Collection;
 import java.util.Collections;
 import org.opengis.util.GenericName;
+
+// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.Attribute;
 import org.opengis.feature.AttributeType;

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -38,13 +38,13 @@ import org.apache.sis.util.ArraysExt;
 
 // Branch-dependent imports
 import java.util.Objects;
+import org.apache.sis.internal.jdk8.JDK8;
 import org.opengis.feature.AttributeType;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.PropertyType;
 import org.opengis.feature.FeatureAssociationRole;
 import org.opengis.feature.Operation;
-import org.apache.sis.internal.jdk8.JDK8;
 
 
 /**

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -16,10 +16,12 @@
  */
 package org.apache.sis.feature.builder;
 
-import org.opengis.feature.PropertyType;
 import org.opengis.util.GenericName;
 import org.apache.sis.util.resources.Errors;
 
+// Branch-dependent imports
+import org.opengis.feature.PropertyType;
+
 
 /**
  * Wraps an existing operation. This package can not create new operations, except for a
few special cases.

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -29,8 +29,8 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static java.util.Collections.singletonMap;
 import static org.apache.sis.test.TestUtilities.getSingleton;
+import static java.util.Collections.singletonMap;
 
 // Branch-dependent imports
 import org.opengis.feature.PropertyType;

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -20,6 +20,7 @@ import java.util.Arrays;
 import java.util.Set;
 import java.util.Collections;
 import com.esri.core.geometry.Geometry;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.internal.feature.AttributeConvention;
 import org.apache.sis.test.DependsOnMethod;
@@ -31,7 +32,6 @@ import static org.apache.sis.test.Assert
 
 // Branch-dependent imports
 import org.opengis.feature.AttributeType;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
 
 /**
@@ -55,7 +55,7 @@ public final strictfp class AttributeTyp
         assertEquals("default name", "string", builder.getName().toString());
 
         builder.setName("myScope", "myName");
-        final AttributeType<?> att = (AttributeType<?>) builder.build();
+        final AttributeType<?> att = builder.build();
 
         assertEquals("name", "myScope:myName",   att.getName().toString());
         assertEquals("valueClass", String.class, att.getValueClass());
@@ -81,7 +81,7 @@ public final strictfp class AttributeTyp
         assertSame(builder, builder.setDefaultValue("test default value."));
         assertSame(builder, builder.setCardinality(10, 60));
         assertSame(builder, builder.setMaximalLength(80));
-        final AttributeType<?> att = (AttributeType<?>) builder.build();
+        final AttributeType<?> att = builder.build();
 
         assertEquals("name",          "myScope:myName",      att.getName().toString());
         assertEquals("definition",    "test definition",     att.getDefinition().toString());
@@ -141,7 +141,7 @@ public final strictfp class AttributeTyp
         /*
          * Verify the attribute created by the builder.
          */
-        final AttributeType<?> att = (AttributeType<?>) newb.build();
+        final AttributeType<?> att = newb.build();
         assertEquals("name",          "temperature",      att.getName().toString());
         assertEquals("definition",    "test definition",  att.getDefinition().toString());
         assertEquals("description",   "test description", att.getDescription().toString());

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=1758913&r1=1758912&r2=1758913&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] Fri Sep  2 09:06:50 2016
@@ -27,7 +27,6 @@ import java.util.Collections;
 import java.util.Locale;
 import java.util.Date;
 import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.text.NumberFormat;
 import java.text.FieldPosition;
 import java.lang.reflect.Array;
@@ -100,7 +99,7 @@ import org.apache.sis.metadata.iso.exten
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
@@ -120,12 +119,6 @@ public class Formatter implements Locali
     private static final int VERTICAL_ACCURACY = 9;
 
     /**
-     * The time span threshold for switching between the {@code "yyyy-MM-dd'T'HH:mm:ss.SX"}
-     * and {@code "yyyy-MM-dd"} date pattern when formatting a temporal extent.
-     */
-    private static final long TEMPORAL_THRESHOLD = 24 * 60 * 60 * 1000L;
-
-    /**
      * The value of {@code X364.FOREGROUND_DEFAULT.sequence()}, hard-coded for avoiding
      * {@link org.apache.sis.internal.util.X364} class loading.
      */
@@ -914,13 +907,12 @@ public class Formatter implements Locali
     }
 
     /**
-     * Appends the given temporal extents, if non-null.
-     * This method uses a simplified format if the time span is large enough.
+     * Appends the given temporal extent, if non-null.
      * Examples:
      *
      * <ul>
-     *   <li>“{@code TemporalExtent[1980-04-12, 1980-04-18]}” (Δt = 6 days)</li>
-     *   <li>“{@code TemporalExtent[1980-04-12T18:00:00.0Z, 1980-04-12T21:00:00.0Z]}”
(Δt = 3 hours)</li>
+     *   <li>“{@code TemporalExtent[1980-04-12, 1980-04-18]}”</li>
+     *   <li>“{@code TemporalExtent[1980-04-12T18:00:00.0Z, 1980-04-12T21:00:00.0Z]}”</li>
      * </ul>
      */
     private void appendTemporalExtent(final Range<Date> range) {
@@ -928,26 +920,10 @@ public class Formatter implements Locali
             final Date min = range.getMinValue();
             final Date max = range.getMaxValue();
             if (min != null && max != null) {
-                String pattern = null;
-                if (dateFormat instanceof SimpleDateFormat && (max.getTime() - min.getTime())
>= TEMPORAL_THRESHOLD) {
-                    final String p = ((SimpleDateFormat) dateFormat).toPattern();
-                    if (p.length() > StandardDateFormat.SHORT_PATTERN.length() &&
-                        p.startsWith(StandardDateFormat.SHORT_PATTERN))
-                    {
-                        pattern = p;
-                        ((SimpleDateFormat) dateFormat).applyPattern(StandardDateFormat.SHORT_PATTERN);
-                    }
-                }
                 openElement(true, WKTKeywords.TimeExtent);
                 setColor(ElementKind.EXTENT);
-                try {
-                    append(min);
-                    append(max);
-                } finally {
-                    if (pattern != null) {
-                        ((SimpleDateFormat) dateFormat).applyPattern(pattern);
-                    }
-                }
+                append(min);
+                append(max);
                 resetColor();
                 closeElement(true);
             }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -124,7 +124,7 @@ public class DefaultConstraints extends
      * This is a <cite>shallow</cite> copy constructor, since the other metadata
contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from, or {@code null} if none.
+     * @param object the metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Constraints)
      */
@@ -159,8 +159,8 @@ public class DefaultConstraints extends
      *       metadata contained in the given object are not recursively copied.</li>
      * </ul>
      *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
+     * @param  object  the object to get as a SIS implementation, or {@code null} if none.
+     * @return a SIS implementation containing the values of the given object (may be the
      *         given object itself), or {@code null} if the argument was null.
      */
     public static DefaultConstraints castOrCopy(final Constraints object) {
@@ -181,7 +181,7 @@ public class DefaultConstraints extends
      * Returns the limitation affecting the fitness for use of the resource.
      * Example: <cite>"not to be used for navigation"</cite>.
      *
-     * @return Limitation affecting the fitness for use of the resource.
+     * @return limitation affecting the fitness for use of the resource.
      */
     @Override
     @XmlElement(name = "useLimitation")
@@ -193,7 +193,7 @@ public class DefaultConstraints extends
      * Sets the limitation affecting the fitness for use of the resource.
      * Example: <cite>"not to be used for navigation"</cite>.
      *
-     * @param newValues The new use limitations.
+     * @param  newValues  the new use limitations.
      */
     public void setUseLimitations(final Collection<? extends InternationalString> newValues)
{
         useLimitations = writeCollection(newValues, useLimitations, InternationalString.class);
@@ -203,7 +203,7 @@ public class DefaultConstraints extends
      * Returns the spatial and / or temporal extents and or levels of the application
      * of the constraints restrictions.
      *
-     * @return Spatial and / or temporal extents.
+     * @return spatial and / or temporal extents.
      *
      * @since 0.5
      */
@@ -216,7 +216,7 @@ public class DefaultConstraints extends
     /**
      * Sets the spatial and / or temporal extents and or levels of the application of the
constraints restrictions.
      *
-     * @param newValue The new spatial and / or temporal extents.
+     * @param  newValue  the new spatial and / or temporal extents.
      *
      * @since 0.5
      */
@@ -228,7 +228,7 @@ public class DefaultConstraints extends
     /**
      * Returns the graphics / symbols indicating the constraint.
      *
-     * @return The graphics / symbols indicating the constraint.
+     * @return the graphics / symbols indicating the constraint.
      *
      * @since 0.5
      */
@@ -241,7 +241,7 @@ public class DefaultConstraints extends
     /**
      * Sets the new graphics / symbols indicating the constraint.
      *
-     * @param newValues the new graphics / symbols indicating the constraint.
+     * @param  newValues  the new graphics / symbols indicating the constraint.
      *
      * @since 0.5
      */
@@ -253,7 +253,7 @@ public class DefaultConstraints extends
      * Returns citations for the limitation of constraint.
      * Example: "copyright statement, license agreement, etc."
      *
-     * @return Citations for the limitation of constraint.
+     * @return citations for the limitation of constraint.
      *
      * @since 0.5
      */
@@ -266,7 +266,7 @@ public class DefaultConstraints extends
     /**
      * Sets the citations for the limitation of constraint.
      *
-     * @param newValues The new citation for the limitation of constraint.
+     * @param  newValues  the new citation for the limitation of constraint.
      *
      * @since 0.5
      */
@@ -277,7 +277,7 @@ public class DefaultConstraints extends
     /**
      * Returns information concerning the parties to whom the resource can or cannot be released.
      *
-     * @return Information concerning the parties to whom the resource can or cannot be released,
or {@code null} if none.
+     * @return information concerning the parties to whom the resource can or cannot be released,
or {@code null} if none.
      *
      * @since 0.5
      */
@@ -290,7 +290,7 @@ public class DefaultConstraints extends
     /**
      * Sets the information concerning the parties to whom the resource.
      *
-     * @param newValue The new information concerning the parties to whom the resource can
or cannot be released.
+     * @param  newValue  the new information concerning the parties to whom the resource
can or cannot be released.
      *
      * @since 0.5
      */
@@ -302,7 +302,7 @@ public class DefaultConstraints extends
     /**
      * Returns the parties responsible for the resource constraints.
      *
-     * @return Parties responsible for the resource constraints.
+     * @return parties responsible for the resource constraints.
      *
      * @since 0.5
      */
@@ -315,7 +315,7 @@ public class DefaultConstraints extends
     /**
      * Sets the parties responsible for the resource constraints.
      *
-     * @param newValues The new parties responsible for the resource constraints.
+     * @param  newValues  the new parties responsible for the resource constraints.
      *
      * @since 0.5
      */

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -19,12 +19,14 @@ package org.apache.sis.test;
 import java.util.Locale;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.citation.Responsibility;
 import org.opengis.referencing.IdentifiedObject;
 import org.apache.sis.io.wkt.Symbols;
 import org.apache.sis.io.wkt.WKTFormat;
 import org.apache.sis.io.wkt.Convention;
 
+// Branch-specific imports
+import org.opengis.metadata.citation.Responsibility;
+
 
 /**
  * Assertion methods used by the {@code sis-metadata} module in addition of the ones inherited

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=1758913&r1=1758912&r2=1758913&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] Fri Sep  2 09:06:50 2016
@@ -79,6 +79,7 @@ import org.apache.sis.measure.Units;
 
 import static java.util.Collections.singletonMap;
 import static org.opengis.referencing.IdentifiedObject.NAME_KEY;
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
@@ -1336,14 +1337,14 @@ public enum CommonCRS {
         /**
          * Time measured as days since January 1st, 4713 BC at 12:00 UTC.
          */
-        JULIAN(Vocabulary.Keys.Julian, -2440588 * (24*60*60*1000L) + (12*60*60*1000L)),
+        JULIAN(Vocabulary.Keys.Julian, -2440588L * MILLISECONDS_PER_DAY + MILLISECONDS_PER_DAY/2),
 
         /**
          * Time measured as days since November 17, 1858 at 00:00 UTC.
          * A <cite>Modified Julian day</cite> (MJD) is defined relative to
          * <cite>Julian day</cite> (JD) as {@code MJD = JD − 2400000.5}.
          */
-        MODIFIED_JULIAN(Vocabulary.Keys.ModifiedJulian, -40587 * (24*60*60*1000L)),
+        MODIFIED_JULIAN(Vocabulary.Keys.ModifiedJulian, -40587L * MILLISECONDS_PER_DAY),
 
         /**
          * Time measured as days since May 24, 1968 at 00:00 UTC.
@@ -1351,14 +1352,14 @@ public enum CommonCRS {
          * A <cite>Truncated Julian day</cite> (TJD) is defined relative to
          * <cite>Julian day</cite> (JD) as {@code TJD = JD − 2440000.5}.
          */
-        TRUNCATED_JULIAN(Vocabulary.Keys.TruncatedJulian, -587 * (24*60*60*1000L)),
+        TRUNCATED_JULIAN(Vocabulary.Keys.TruncatedJulian, -587L * MILLISECONDS_PER_DAY),
 
         /**
          * Time measured as days since December 31, 1899 at 12:00 UTC.
          * A <cite>Dublin Julian day</cite> (DJD) is defined relative to
          * <cite>Julian day</cite> (JD) as {@code DJD = JD − 2415020}.
          */
-        DUBLIN_JULIAN(Vocabulary.Keys.DublinJulian, -25568 * (24*60*60*1000L) + (12*60*60*1000L)),
+        DUBLIN_JULIAN(Vocabulary.Keys.DublinJulian, -25568L * MILLISECONDS_PER_DAY + MILLISECONDS_PER_DAY/2),
 
         /**
          * Time measured as seconds since January 1st, 1970 at 00:00 UTC.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -50,6 +50,7 @@ import org.junit.Test;
 
 import static org.apache.sis.test.ReferencingAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 // Branch-specific imports
 import org.opengis.util.Factory;
@@ -1041,7 +1042,7 @@ public final strictfp class GeodeticObje
         final TemporalDatum timeDatum = timeCRS.getDatum();
         assertNameAndIdentifierEqual("Time", 0, timeCRS);
         assertNameAndIdentifierEqual("Modified Julian", 0, timeDatum);
-        assertEquals("epoch", new Date(-40587 * (24*60*60*1000L)), timeDatum.getOrigin());
+        assertEquals("epoch", new Date(-40587L * MILLISECONDS_PER_DAY), timeDatum.getOrigin());
 
         // No more CRS.
         assertFalse(components.hasNext());

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -28,6 +28,7 @@ import org.junit.Test;
 
 import static org.apache.sis.test.ReferencingAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 
 /**
@@ -47,7 +48,7 @@ public final strictfp class DefaultTempo
     /**
      * November 17, 1858 at 00:00 UTC as a Java timestamp.
      */
-    private static final long ORIGIN = -40587 * (24*60*60*1000L);
+    private static final long ORIGIN = -40587L * MILLISECONDS_PER_DAY;
 
     /**
      * Creates the temporal datum to use for testing purpose.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -28,6 +28,7 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 
 import static org.opengis.referencing.datum.Datum.*;
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 
 /**
@@ -151,7 +152,7 @@ public final strictfp class HardCodedDat
      */
     public static final DefaultTemporalDatum MODIFIED_JULIAN = new DefaultTemporalDatum(
             properties("Modified Julian", null, null),
-            new Date(-40587 * (24*60*60*1000L)));
+            new Date(-40587L * MILLISECONDS_PER_DAY));
 
     /**
      * Image with {@link PixelInCell#CELL_CENTER}.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -25,12 +25,20 @@ import java.text.SimpleDateFormat;
 
 
 /**
- * A date format used for parsing date in the {@code "yyyy-MM-dd'T'HH:mm:ss.SSSX"} pattern,
but in which
- * the time is optional. The "Apache SIS for JDK8" branch can use the {@link java.time.format}
package,
- * while other branches use {@link java.text.SimpleDateFormat}.
+ * A date format used for parsing dates in the {@code "yyyy-MM-dd'T'HH:mm:ss.SSSX"} pattern,
but in which
+ * the time is optional. For this class, "Standard" is interpreted as "close to ISO 19162
requirements",
+ * which is not necessarily identical to other ISO standards.
  *
- * <p>External users should use nothing else than the parsing and formating methods.
The methods for
- * configuring the {@code DateFormat} may not be available between different SIS branches.</p>
+ * <p>This class is implemented in two different way depending on the Apache SIS branch:</p>
+ * <ul>
+ *   <li>Branches for JDK8 and more use {@link java.time.format.DateTimeFormatter}.</li>
+ *   <li>Branches for older JDKs use {@link java.text.SimpleDateFormat} together with
some hacks
+ *       for allowing some fields to be optional (for example adding ":00" is seconds are
missing).</li>
+ * </ul>
+ *
+ * External users should use nothing else than the parsing and formating methods.
+ * The methods for configuring the {@code DateFormat} instances may or may not work
+ * depending on the branch.
  *
  * <p>The main usage for this class is Well Known Text (WKT) parsing and formatting.
  * ISO 19162 uses ISO 8601:2004 for the dates. Any precision is allowed: the date could have
only the year,
@@ -46,6 +54,7 @@ import java.text.SimpleDateFormat;
 public final class StandardDateFormat extends SimpleDateFormat {
     /**
      * For cross-version compatibility.
+     * This number must be different between the JDK8 branch and pre-JDK8 branches.
      */
     private static final long serialVersionUID = 1552761359761440473L;
 
@@ -83,6 +92,11 @@ public final class StandardDateFormat ex
     public static final String PATTERN = SHORT_PATTERN + "'T'" + TIME_PATTERN;
 
     /**
+     * The length of a day in number of milliseconds.
+     */
+    public static final int MILLISECONDS_PER_DAY = 24*60*60*1000;
+
+    /**
      * {@code true} if the user has invoked {@link #applyPattern(String)} or {@link #applyLocalizedPattern(String)}.
      */
     private boolean isUserSpecifiedPattern;
@@ -140,22 +154,22 @@ public final class StandardDateFormat ex
      * Formats the given date. If hours, minutes, seconds and milliseconds are zero and the
timezone is UTC,
      * then this method omits the clock part (unless the user has overridden the pattern).
      *
-     * @param  date    the date to format.
-     * @param  buffer  where to format the date.
-     * @param  pos     where to store information about a date field.
+     * @param  date        the date to format.
+     * @param  toAppendTo  where to format the date.
+     * @param  pos         ignored.
      * @return the given buffer, for method calls chaining.
      */
     @Override
-    public StringBuffer format(final Date date, final StringBuffer buffer, final FieldPosition
pos) {
-        if (!isUserSpecifiedPattern && (date.getTime() % (24*60*60*1000)) == 0 &&
UTC.equals(getTimeZone().getID())) {
+    public StringBuffer format(final Date date, final StringBuffer toAppendTo, final FieldPosition
pos) {
+        if (!isUserSpecifiedPattern && (date.getTime() % MILLISECONDS_PER_DAY) ==
0 && UTC.equals(getTimeZone().getID())) {
             try {
                 super.applyPattern(SHORT_PATTERN);
-                return super.format(date, buffer, pos);
+                return super.format(date, toAppendTo, pos);
             } finally {
                 super.applyPattern(PATTERN);
             }
         }
-        return super.format(date, buffer, pos);
+        return super.format(date, toAppendTo, pos);
     }
 
     /**
@@ -166,7 +180,7 @@ public final class StandardDateFormat ex
      * @return the date, or {@code null} if we failed to parse it.
      */
     @Override
-    public Date parse(String text, final ParsePosition position) {
+    public Date parse(final String text, final ParsePosition position) {
         if (isUserSpecifiedPattern) {
             return super.parse(text, position);
         }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -58,6 +58,8 @@ public final strictfp class StandardDate
 
     /**
      * Tests parsing a date.
+     * Since the implementation is completely different in JDK8 branch than in previous branch,
+     * a key purpose of this test is to ensure that the parsing is consistent between the
branches.
      *
      * @throws ParseException if an error occurred while parsing the date.
      */

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -34,6 +34,7 @@ import org.apache.sis.test.TestUtilities
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 
 /**
@@ -69,10 +70,10 @@ public final strictfp class RangeSetTest
     /**
      * Verifies the value of {@link RangeSet#contains(Range, boolean)}.
      *
-     * @param ranges   The range set to test.
-     * @param range    The range to check for inclusion.
-     * @param exact    The expected value in exact mode.
-     * @param included The expected value in non-exact mode.
+     * @param  ranges    the range set to test.
+     * @param  range     the range to check for inclusion.
+     * @param  exact     the expected value in exact mode.
+     * @param  included  the expected value in non-exact mode.
      */
     private static <E extends Comparable<? super E>> void checkContains(final
RangeSet<E> ranges,
             final Range<E> range, final boolean exact, final boolean included)
@@ -151,25 +152,24 @@ public final strictfp class RangeSetTest
         /*
          * Add a singleton range.
          */
-        final long day = 24*60*60*1000L;
         final Date now = new Date();
-        final Date yesterday = new Date(now.getTime() - day);
+        final Date yesterday = new Date(now.getTime() - MILLISECONDS_PER_DAY);
         assertTrue(ranges.add(yesterday, now));
         assertEquals(1, ranges.size());
         checkContains(ranges, new Range<>(Date.class, yesterday, true, now, false),
true, true);
         /*
          * Add a disjoint range.
          */
-        final Date lastWeek = new Date(now.getTime() - 7*day);
-        final Date other = new Date(lastWeek.getTime() + 2*day);
+        final Date lastWeek = new Date(now.getTime() - 7*MILLISECONDS_PER_DAY);
+        final Date other = new Date(lastWeek.getTime() + 2*MILLISECONDS_PER_DAY);
         assertTrue(ranges.add(new Range<>(Date.class, lastWeek, true, other, false)));
         assertEquals(2, ranges.size());
         /*
          * Verify the RangeSet content.
          */
         final Iterator<Range<Date>> it = ranges.iterator();
-        assertEqual(new Range<Date>(Date.class, lastWeek,  true, other, false), it.next(),
ranges.first());
-        assertEqual(new Range<Date>(Date.class, yesterday, true, now,   false), it.next(),
ranges.last());
+        assertEqual(new Range<>(Date.class, lastWeek,  true, other, false), it.next(),
ranges.first());
+        assertEqual(new Range<>(Date.class, yesterday, true, now,   false), it.next(),
ranges.last());
         assertFalse(it.hasNext());
     }
 
@@ -198,8 +198,8 @@ public final strictfp class RangeSetTest
          * Verify the RangeSet content.
          */
         final Iterator<Range<String>> it = ranges.iterator();
-        assertEqual(new Range<String>(String.class, "FAA", true, "FCC", false), it.next(),
ranges.first());
-        assertEqual(new Range<String>(String.class, "GAA", true, "GBB", false), it.next(),
ranges.last());
+        assertEqual(new Range<>(String.class, "FAA", true, "FCC", false), it.next(),
ranges.first());
+        assertEqual(new Range<>(String.class, "GAA", true, "GBB", false), it.next(),
ranges.last());
         assertFalse(it.hasNext());
     }
 
@@ -324,8 +324,8 @@ public final strictfp class RangeSetTest
         assertTrue(ranges.remove(-15, -5));
         assertEquals("size", 1, ranges.size());
         Range<Integer> r = ranges.first();
-        assertEquals(-20, (int) r.getMinValue());
-        assertEquals(-15, (int) r.getMaxValue());
+        assertEquals(-20, r.getMinValue().intValue());
+        assertEquals(-15, r.getMaxValue().intValue());
         /*
          *                          A             B
          * Range  :                 [-------------]
@@ -339,8 +339,8 @@ public final strictfp class RangeSetTest
         assertTrue(ranges.remove(-25, -15));
         assertEquals("size", 1, ranges.size());
         r = ranges.first();
-        assertEquals(-15, (int) r.getMinValue());
-        assertEquals(-10, (int) r.getMaxValue());
+        assertEquals(-15, r.getMinValue().intValue());
+        assertEquals(-10, r.getMaxValue().intValue());
         /*
          *                   A                       B
          * Range  :          [-----------------------]
@@ -354,14 +354,14 @@ public final strictfp class RangeSetTest
         assertTrue(ranges.remove(-17, -13));
         assertEquals("size", 2, ranges.size());
         r = ranges.getRange(0);
-        assertEquals(-20, (int) r.getMinValue());
-        assertEquals(-17, (int) r.getMaxValue());
+        assertEquals(-20, r.getMinValue().intValue());
+        assertEquals(-17, r.getMaxValue().intValue());
         r = ranges.getRange(1);
-        assertEquals(-17, (int) r.getMinValue());
-        assertEquals(-13, (int) r.getMaxValue());
+        assertEquals(-17, r.getMinValue().intValue());
+        assertEquals(-13, r.getMaxValue().intValue());
         r = ranges.getRange(2);
-        assertEquals(-13, (int) r.getMinValue());
-        assertEquals(-10, (int) r.getMaxValue());
+        assertEquals(-13, r.getMinValue().intValue());
+        assertEquals(-10, r.getMaxValue().intValue());
         /*
          *                       A                B
          * Range  :              [----------------]
@@ -541,7 +541,7 @@ public final strictfp class RangeSetTest
      * in normal SIS build. We run this test only when the {@link RangeSet} implementation
      * changed, and we want to test the impact of that change on the performance.
      *
-     * @throws InterruptedException If the test has been interrupted.
+     * @throws InterruptedException if the test has been interrupted.
      */
     @Performance
     public void stress() throws InterruptedException {

Modified: sis/branches/JDK7/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/build.xml?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/build.xml Fri Sep  2 09:06:50 2016
@@ -119,7 +119,6 @@
     <concat destfile="${build.classes.dir}/META-INF/services/org.opengis.referencing.operation.OperationMethod"
encoding="UTF-8" fixlastline="yes">
       <fileset dir="${project.root}">
         <include name="*/*/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod"/>
-        <include name="*/*/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod"/>
       </fileset>
     </concat>
 
@@ -199,5 +198,12 @@
         <include name="**/*.xml"/>
       </fileset>
     </copy>
+
+    <!-- OperationMethod implementations to be loaded by ServiceLoader. -->
+    <concat destfile="${build.test.classes.dir}/META-INF/services/org.opengis.referencing.operation.OperationMethod"
encoding="UTF-8" fixlastline="yes">
+      <fileset dir="${project.root}">
+        <include name="*/*/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod"/>
+      </fileset>
+    </concat>
   </target>
 </project>

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -19,7 +19,6 @@ package org.apache.sis.storage.geotiff;
 import java.util.Arrays;
 import java.io.IOException;
 import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
 import org.apache.sis.internal.storage.ChannelDataInput;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.math.Vector;
@@ -27,6 +26,7 @@ import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.resources.Errors;
 
 // Branch-dependent imports
+import java.nio.charset.StandardCharsets;
 import org.apache.sis.internal.jdk8.JDK8;
 
 

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?rev=1758913&r1=1758912&r2=1758913&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] Fri Sep  2 09:06:50 2016
@@ -45,6 +45,8 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.iso.Types;
 
+import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
+
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.LocalDate;
 
@@ -645,13 +647,15 @@ parse:      for (int i = 0; i < length;)
             }
             final DefaultCitation c = new DefaultCitation(notice);
             if (year != 0) {
-                final Date date = new Date(LocalDate.of(year, 1, 1).toEpochDay() * (24*60*60*1000L));
+                final Date date = new Date(LocalDate.of(year, 1, 1).toEpochDay() * MILLISECONDS_PER_DAY);
                 c.setDates(Collections.singleton(new DefaultCitationDate(date, DateType.IN_FORCE)));
             }
             if (i != 0) {
                 buffer.setLength(i);
-                c.setCitedResponsibleParties(Collections.singleton(new DefaultResponsibility(Role.OWNER,
null,
-                        new AbstractParty(buffer, null))));     // Same limitation than MetadataBuilder.party().
+                // Same limitation than MetadataBuilder.party().
+                final AbstractParty party = new AbstractParty(buffer, null);
+                final DefaultResponsibility r = new DefaultResponsibility(Role.OWNER, null,
party);
+                c.setCitedResponsibleParties(Collections.singleton(r));
             }
             constraints.getReferences().add(c);
         }




Mime
View raw message