Author: desruisseaux
Date: Mon Feb  2 15:27:30 2015
New Revision: 1656489

URL: http://svn.apache.org/r1656489
Log:
Merge from the JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
    
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
    
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
    
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
    
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
    
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
    
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java
    
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
    
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
    
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
    sis/branches/JDK7/pom.xml

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb  2 15:27:30 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1655065
+/sis/branches/JDK8:1584960-1656486
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -158,6 +158,9 @@ final class TreeTableView implements Tre
 
     /**
      * Invoked on serialization. Write the metadata object instead of the 
{@linkplain #root} node.
+     *
+     * @param  out The output stream where to serialize this object.
+     * @throws IOException If an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         out.defaultWriteObject();
@@ -166,6 +169,10 @@ final class TreeTableView implements Tre
 
     /**
      * Invoked on deserialization. Recreate the {@linkplain #root} node from 
the metadata object.
+     *
+     * @param  in The input stream from which to deserialize an object.
+     * @throws IOException If an I/O error occurred while reading or if the 
stream contains invalid data.
+     * @throws ClassNotFoundException If the class serialized on the stream is 
not on the classpath.
      */
     private void readObject(final ObjectInputStream in) throws IOException, 
ClassNotFoundException {
         in.defaultReadObject();

Modified: 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -820,7 +820,7 @@ public class DefaultMetadata extends ISO
      *
      * @return Date that the metadata was created, or {@code null}.
      *
-     * @deprecated As of ISO 19115:2014, replaced by {@link #getDates()}.
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getDateInfo()}.
      */
     @Override
     @Deprecated
@@ -842,7 +842,7 @@ public class DefaultMetadata extends ISO
      *
      * @param newValue The new date stamp.
      *
-     * @deprecated As of ISO 19115:2014, replaced by {@link 
#setDates(Collection)}.
+     * @deprecated As of ISO 19115:2014, replaced by {@link 
#setDateInfo(Collection)}.
      */
     @Deprecated
     public void setDateStamp(final Date newValue) {

Modified: 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -381,7 +381,7 @@ public class DefaultSource extends ISOMe
      *
      * @return Information about the extent of the source data.
      *
-     * @deprecated As of ISO 19115:2014, moved to {@link 
DefaultScope#getExtent()}.
+     * @deprecated As of ISO 19115:2014, moved to {@link 
DefaultScope#getExtents()}.
      */
     @Override
     @Deprecated
@@ -405,7 +405,7 @@ public class DefaultSource extends ISOMe
      *
      * @param newValues The new source extents.
      *
-     * @deprecated As of ISO 19115:2014, moved to {@link 
DefaultScope#setExtent(Extent)}.
+     * @deprecated As of ISO 19115:2014, moved to {@link 
DefaultScope#setExtents(Collection)}.
      */
     @Deprecated
     public void setSourceExtents(final Collection<? extends Extent> newValues) 
{

Modified: 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -326,6 +326,9 @@ final class ParameterValueList extends A
 
     /**
      * Trims the array to its capacity before to serialize.
+     *
+     * @param  out The output stream where to serialize this object.
+     * @throws IOException If an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         values = ArraysExt.resize(values, size);

Modified: 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -33,11 +33,20 @@ import java.util.Objects;
 
 /**
  * Specification of the coordinate operation method formula.
+ * A formula may be {@linkplain #getFormula() given textually},
+ * or may be a {@linkplain #getCitation() reference to a publication}.
+ *
+ * <p>{@code Formula} is for human reading.
+ * The object that actually does the work of applying formula to coordinate 
values is
+ * {@link org.opengis.referencing.operation.MathTransform}.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.5
  * @since   0.5
  * @module
+ *
+ * @see DefaultOperationMethod
+ * @see org.apache.sis.referencing.operation.transform.AbstractMathTransform
  */
 public class DefaultFormula extends FormattableObject implements Formula, 
Serializable {
     /**

Modified: 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -22,8 +22,10 @@ import java.util.Collections;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.operation.Formula;
+import org.opengis.referencing.operation.Projection;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.CoordinateOperation;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.ComparisonMode;
@@ -144,9 +146,9 @@ public class DefaultOperationMethod exte
      * with any number of dimensions (e.g. <cite>Affine Transform</cite>).
      *
      * @param properties      Set of properties. Shall contain at least {@code 
"name"}.
-     * @param sourceDimension Number of dimensions in the source CRS of this 
operation method.
-     * @param targetDimension Number of dimensions in the target CRS of this 
operation method.
-     * @param parameters      The set of parameters.
+     * @param sourceDimension Number of dimensions in the source CRS of this 
operation method, or {@code null}.
+     * @param targetDimension Number of dimensions in the target CRS of this 
operation method, or {@code null}.
+     * @param parameters      Description of parameters expected by this 
operation.
      */
     public DefaultOperationMethod(final Map<String,?> properties,
                                   final Integer sourceDimension,
@@ -331,6 +333,36 @@ public class DefaultOperationMethod exte
     }
 
     /**
+     * Returns the base interface of the {@code CoordinateOperation} instances 
that use this method.
+     * The base {@code CoordinateOperation} interface is usually one of the 
following subtypes:
+     *
+     * <ul>
+     *   <li>{@link org.opengis.referencing.operation.Transformation}
+     *     if the coordinate operation has some errors (typically of a few 
metres) because of the empirical process by
+     *     which the operation parameters were determined. Those errors do not 
depend on the floating point precision
+     *     or the accuracy of the implementation algorithm.</li>
+     *   <li>{@link org.opengis.referencing.operation.Conversion}
+     *     if the coordinate operation is theoretically of infinite precision, 
ignoring the limitations of floating
+     *     point arithmetic (including rounding errors) and the approximations 
implied by finite series expansions.</li>
+     *   <li>{@link org.opengis.referencing.operation.Projection}
+     *     if the coordinate operation is a conversion (as defined above) 
converting geodetic latitudes and longitudes
+     *     to plane (map) coordinates. This type can optionally be refined 
with one of the
+     *     {@link org.opengis.referencing.operation.CylindricalProjection},
+     *     {@link org.opengis.referencing.operation.ConicProjection} or
+     *     {@link org.opengis.referencing.operation.PlanarProjection} 
subtypes.</li>
+     * </ul>
+     *
+     * In case of doubt, this method can conservatively return the base type.
+     * The default implementation returns {@code CoordinateOperation.class},
+     * which is the most conservative return value.
+     *
+     * @return Interface implemented by all coordinate operations that use 
this method.
+     */
+    public Class<? extends CoordinateOperation> getOperationType() {
+        return CoordinateOperation.class;
+    }
+
+    /**
      * Formula(s) or procedure used by this operation method. This may be a 
reference to a
      * publication. Note that the operation method may not be analytic, in 
which case this
      * attribute references or contains the procedure, not an analytic formula.
@@ -466,6 +498,29 @@ public class DefaultOperationMethod exte
     @Override
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
-        return (formatter.getConvention().majorVersion() == 1) ? "Projection" 
: "Method";
+        if (formatter.getConvention().majorVersion() == 1) {
+            /*
+             * The WKT 1 keyword is "PROJECTION", which imply that the 
operation method should be of type
+             * org.opengis.referencing.operation.Projection. So strictly 
speaking only the first check in
+             * the following 'if' statement is relevant.
+             *
+             * Unfortunately in many cases we do not know the operation type, 
because the method that we
+             * invoked - getOperationType() - is not a standard OGC/ISO 
property, so this information is
+             * usually not provided in XML documents for example.  The user 
could also have instantiated
+             * DirectOperationMethod directly without creating a subclass. 
Consequently we also accept to
+             * format the keyword as "PROJECTION" if the operation type 
*could* be a projection. This is
+             * the second check in the following 'if' statement.
+             *
+             * In other words, the combination of those two checks exclude the 
following operation types:
+             * Transformation, ConcatenatedOperation, PassThroughOperation, or 
any user-defined type that
+             * do not extend Projection. All other operation types are 
accepted.
+             */
+            final Class<? extends CoordinateOperation> type = 
getOperationType();
+            if (Projection.class.isAssignableFrom(type) || 
type.isAssignableFrom(Projection.class)) {
+                return "Projection";
+            }
+            formatter.setInvalidWKT(this, null);
+        }
+        return "Method";
     }
 }

Modified: 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -47,18 +47,23 @@ import static org.apache.sis.util.Argume
 
 /**
  * Provides a default implementation for most methods required by the {@link 
MathTransform} interface.
- * {@code AbstractMathTransform} provides a convenient base class from which 
transform implementations
+ * A {@code MathTransform} is an object that actually does the work of 
applying a
+ * {@linkplain org.apache.sis.referencing.operation.DefaultFormula formula} to 
coordinate values.
+ * The math transform does not know or care how the coordinates relate to 
positions in the real world.
+ * For example if an affine transform scales <var>z</var> values by a factor 
of 1000,
+ * then it could be converting metres to millimetres, or it could be 
converting kilometres to metres.
+ *
+ * <p>{@code AbstractMathTransform} provides a convenient base class from 
which {@code MathTransform} implementations
  * can be easily derived. It also defines a few additional SIS-specific 
methods for convenience of performance.
+ * The simplest way to implement this abstract class is to provide an 
implementation for the following methods only:</p>
  *
- * <p>The simplest way to implement this abstract class is to provide an 
implementation for the following methods
- * only:</p>
  * <ul>
  *   <li>{@link #getSourceDimensions()}</li>
  *   <li>{@link #getTargetDimensions()}</li>
  *   <li>{@link #transform(double[], int, double[], int, boolean)}</li>
  * </ul>
  *
- * However more performance may be gained by overriding the other {@code 
transform} methods as well.
+ * However more performance may be gained by overriding the other {@code 
transform(…)} methods as well.
  *
  * {@section Immutability and thread safety}
  * All Apache SIS implementations of {@code MathTransform} are immutable and 
thread-safe.

Modified: 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -39,7 +39,7 @@ public abstract class AbstractFactory im
     /**
      * Returns the implementor of this factory, or {@code null} if unknown.
      * The default implementation tries to fetch this information from the
-     * manifest associated to the package of this class.
+     * manifest associated to the package of {@code this.getClass()}.
      *
      * @return The vendor for this factory implementation, or {@code null} if 
unknown.
      *

Modified: 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -221,6 +221,10 @@ public class DefaultRecordType extends R
     /**
      * Invoked on deserialization for restoring the transient fields.
      * See {@link #writeObject(ObjectOutputStream)} for the stream data 
description.
+     *
+     * @param  in The input stream from which to deserialize an object.
+     * @throws IOException If an I/O error occurred while reading or if the 
stream contains invalid data.
+     * @throws ClassNotFoundException If the class serialized on the stream is 
not on the classpath.
      */
     private void readObject(final ObjectInputStream in) throws IOException, 
ClassNotFoundException {
         in.defaultReadObject();
@@ -241,6 +245,9 @@ public class DefaultRecordType extends R
      *
      * @serialData The number of members as an {@code int}, followed by a
      *             ({@code MemberName}, {@code Type}) pair for each member.
+     *
+     * @param  out The output stream where to serialize this object.
+     * @throws IOException If an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         final int size = size();

Modified: 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -83,6 +83,10 @@ abstract class RecordDefinition { // Int
 
         /**
          * Invoked on deserialization for restoring the transient fields.
+         *
+         * @param  in The input stream from which to deserialize an attribute.
+         * @throws IOException If an I/O error occurred while reading or if 
the stream contains invalid data.
+         * @throws ClassNotFoundException If the class serialized on the 
stream is not on the classpath.
          */
         private void readObject(final ObjectInputStream in) throws 
IOException, ClassNotFoundException {
             in.defaultReadObject();

Modified: 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
 [UTF-8] Mon Feb  2 15:27:30 2015
@@ -148,6 +148,9 @@ abstract class ResourceInternationalStri
 
     /**
      * Serializes this international string using the key name rather than 
numerical value.
+     *
+     * @param  out The output stream where to serialize this object.
+     * @throws IOException If an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         out.defaultWriteObject();
@@ -156,6 +159,10 @@ abstract class ResourceInternationalStri
 
     /**
      * Deserializes an object serialized by {@link 
#writeObject(ObjectOutputStream)}.
+     *
+     * @param  in The input stream from which to deserialize an object.
+     * @throws IOException If an I/O error occurred while reading or if the 
stream contains invalid data.
+     * @throws ClassNotFoundException If the class serialized on the stream is 
not on the classpath.
      */
     private void readObject(final ObjectInputStream in) throws IOException, 
ClassNotFoundException {
         in.defaultReadObject();

Modified: sis/branches/JDK7/pom.xml
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1656489&r1=1656488&r2=1656489&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Mon Feb  2 15:27:30 2015
@@ -423,6 +423,26 @@ Apache SIS is a free software, Java lang
         <maven.compiler.optimize>true</maven.compiler.optimize>
       </properties>
     </profile>
+    <profile>
+      <activation>
+        <property>
+          <name>bootclasspath</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+              <compilerArgs>
+                <arg>-bootclasspath</arg>
+                <arg>${bootclasspath}</arg>
+              </compilerArgs>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 
@@ -442,6 +462,9 @@ Apache SIS is a free software, Java lang
           <target>${maven.compile.target}</target>
           <encoding>${project.build.sourceEncoding}</encoding>
           <useIncrementalCompilation>false</useIncrementalCompilation> <!-- 
https://jira.codehaus.org/browse/MCOMPILER-209 -->
+          <compilerArgs>
+            <arg>-Xlint:all</arg>
+          </compilerArgs>
         </configuration>
       </plugin>
 


Reply via email to