sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1607411 - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition...
Date Wed, 02 Jul 2014 16:23:42 GMT
Author: desruisseaux
Date: Wed Jul  2 16:23:41 2014
New Revision: 1607411

URL: http://svn.apache.org/r1607411
Log:
Merge from the JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_CoupledResource.java
      - copied unchanged from r1607409, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_CoupledResource.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationChainMetadata.java
      - copied unchanged from r1607409, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationChainMetadata.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java
      - copied unchanged from r1607409, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
      - copied unchanged from r1607409, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/
      - copied from r1607409, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ImmutableAffineTransform.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/NumberConverter.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1606677-1607408
  Merged /sis/branches/JDK7:r1606678-1607409

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -71,7 +71,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -66,7 +66,7 @@
  * See {@link org.apache.sis.xml.IdentifierMap} for more information.
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -45,7 +45,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -290,7 +290,7 @@ public class DefaultCoverageDescription 
                         this, DefaultCoverageDescription.class, "getDimensions");
             }
 
-            /** Updates the legacy value in an existing new kind of value. */
+            /** Updates the legacy value in an existing instance of the new kind of value.
*/
             @Override protected boolean update(final AttributeGroup container, final RangeDimension
value) {
                 if (container instanceof DefaultAttributeGroup) {
                     ((DefaultAttributeGroup) container).setGroupAttributes(asCollection(value));

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -68,7 +68,7 @@
  * {@link org.opengis.metadata.content.RangeDimension}.
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -53,7 +53,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -118,7 +118,7 @@
  * </ul>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -24,6 +24,7 @@ import org.opengis.util.InternationalStr
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.identification.Keywords;
 import org.opengis.metadata.identification.KeywordType;
+import org.opengis.metadata.identification.KeywordClass;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 
@@ -35,7 +36,7 @@ import org.apache.sis.util.iso.Types;
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Keywords_Type", propOrder = {
@@ -66,6 +67,12 @@ public class DefaultKeywords extends ISO
     private Citation thesaurusName;
 
     /**
+     * User-defined categorization of groups of keywords that extend or are orthogonal
+     * to the standardized {@linkplain #getType() keyword type} codes.
+     */
+    private KeywordClass keywordClass;
+
+    /**
      * Constructs an initially empty keywords.
      */
     public DefaultKeywords() {
@@ -195,4 +202,29 @@ public class DefaultKeywords extends ISO
         checkWritePermission();
         thesaurusName = newValue;
     }
+
+    /**
+     * Returns the user-defined categorization of groups of keywords that extend or
+     * are orthogonal to the standardized {@linkplain #getType() keyword type} codes.
+     *
+     * @return User-defined categorization of groups of keywords, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    @Override
+    public KeywordClass getKeywordClass() {
+        return keywordClass;
+    }
+
+    /**
+     * Sets the user-defined categorization of groups of keywords.
+     *
+     * @param newValue New user-defined categorization of groups of keywords.
+     *
+     * @since 0.5
+     */
+    public void setKeywordClass(final KeywordClass newValue) {
+        checkWritePermission();
+        keywordClass = newValue;
+    }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -69,7 +69,7 @@
  * </ul>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -49,7 +49,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -375,7 +375,7 @@ public class DefaultMaintenanceInformati
                         this, DefaultMaintenanceInformation.class, "getUpdateScopeDescriptions");
             }
 
-            /** Updates the legacy value in an existing new kind of value. */
+            /** Updates the legacy value in an existing instance of the new kind of value.
*/
             @Override protected boolean update(final Scope container, final ScopeDescription
value) {
                 if (container instanceof DefaultScope) {
                     ((DefaultScope) container).setLevelDescription(asCollection(value));

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -43,7 +43,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -65,7 +65,7 @@
  * will have precedence. The later behavior is compliant with INSPIRE rules.
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -93,7 +93,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -67,7 +67,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods
accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason
for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value
created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -254,9 +254,8 @@ public abstract strictfp class MetadataT
              */
             final boolean isWritable = isWritable(accessor.implementation, property);
             if (isWritable != accessor.isWritable(i)) {
-                System.out.println(accessor);
+                fail("Non writable property: " + accessor + '.' + property);
             }
-            assertEquals("isWritable", isWritable, accessor.isWritable(i));
             if (isWritable) {
                 final Object newValue = valueFor(property, elementType);
                 final Object oldValue = accessor.set(i, instance, newValue, PropertyAccessor.RETURN_PREVIOUS);

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -188,6 +188,10 @@ public final strictfp class AllMetadataT
             org.opengis.metadata.quality.ThematicClassificationCorrectness.class,
             org.opengis.metadata.quality.TopologicalConsistency.class,
             org.opengis.metadata.quality.Usability.class,
+            org.opengis.metadata.service.CoupledResource.class,
+            org.opengis.metadata.service.OperationChainMetadata.class,
+            org.opengis.metadata.service.OperationMetadata.class,
+            org.opengis.metadata.service.Parameter.class,
             org.opengis.metadata.spatial.CellGeometry.class,
             org.opengis.metadata.spatial.Dimension.class,
             org.opengis.metadata.spatial.DimensionNameType.class,
@@ -225,6 +229,10 @@ public final strictfp class AllMetadataT
      */
     @Override
     protected String getExpectedNamespace(final Class<?> impl, final Specification
specification) {
+        if (impl.getPackage().getName().equals("org.apache.sis.metadata.iso.service")) {
+            assertEquals(Specification.ISO_19115, specification);
+            return Namespaces.SRV;
+        }
         if (impl == org.apache.sis.metadata.iso.identification.DefaultServiceIdentification.class)
{
             return Namespaces.SRV;
         }
@@ -263,6 +271,7 @@ public final strictfp class AllMetadataT
      * or {@code null} if no adapter is expected for the given type.
      *
      * @return {@inheritDoc}
+     * @throws ClassNotFoundException {@inheritDoc}
      */
     @Override
     protected Class<?> getWrapperFor(final Class<?> type) throws ClassNotFoundException
{

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ImmutableAffineTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ImmutableAffineTransform.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ImmutableAffineTransform.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ImmutableAffineTransform.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -31,7 +31,7 @@ import org.apache.sis.util.resources.Err
  * @version 0.5
  * @module
  */
-class ImmutableAffineTransform extends AffineTransform {
+public class ImmutableAffineTransform extends AffineTransform {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -295,6 +295,8 @@ class ImmutableAffineTransform extends A
 
     /**
      * Checks for {@linkplain #checkPermission() permission} before inverting this transform.
+     *
+     * @throws java.awt.geom.NoninvertibleTransformException If the matrix can not be inverted.
      */
     @Override
     public final void invert() throws NoninvertibleTransformException {

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/NumberConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/NumberConverter.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/NumberConverter.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/NumberConverter.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -109,12 +109,27 @@ final class NumberConverter<S extends Nu
      */
     @Override
     public T apply(final S source) {
-        final T target = Numbers.cast(source, targetClass);
-        if (target.longValue() != source.longValue() ||
-                Double.doubleToLongBits(target.doubleValue()) !=
-                Double.doubleToLongBits(source.doubleValue()))
-        {
-            throw new UnconvertibleObjectException(formatErrorMessage(source));
+        final double sourceValue = source.doubleValue();
+        T target = Numbers.cast(source, targetClass);
+        final double targetValue = target.doubleValue();
+        if (Double.doubleToLongBits(targetValue) != Double.doubleToLongBits(sourceValue))
{
+            /*
+             * Casted value is not equal to the source value. Maybe we just lost the fraction
digits
+             * in a (double → long) cast, in which case the difference should be smaller
than 1.
+             */
+            final double delta = Math.abs(targetValue - sourceValue);
+            if (!(delta < 0.5)) { // Use '!' for catching NaN.
+                if (delta < 1) {
+                    target = Numbers.cast(Math.round(sourceValue), targetClass);
+                } else {
+                    /*
+                     * The delta may be greater than 1 in a (BigInteger/BigDecimal → long)
cast if the
+                     * BigInteger/BigDecimal has more significant digits than what the double
type can
+                     * hold.
+                     */
+                    throw new UnconvertibleObjectException(formatErrorMessage(source));
+                }
+            }
         }
         return target;
     }

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java?rev=1607411&r1=1607410&r2=1607411&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java
[UTF-8] Wed Jul  2 16:23:41 2014
@@ -33,7 +33,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @DependsOn(SystemRegistryTest.class)
@@ -54,6 +54,19 @@ public final strictfp class NumberConver
     }
 
     /**
+     * Asserts that conversion of the given {@code source} value produces the given {@code
target} value.
+     * The conversion is not expected to be invertible. This method is used for testing rounding
behavior.
+     */
+    private static <S extends Number, T extends Number> void runConversion(
+            final ObjectConverter<S,T> c, final S source, final T target, final S inverse)
+            throws UnconvertibleObjectException
+    {
+        assertFalse(source.equals(inverse));
+        assertEquals("Forward conversion.", target,  c.apply(source));
+        assertEquals("Inverse conversion.", inverse, c.inverse().apply(target));
+    }
+
+    /**
      * Asserts that conversion of the given {@code source} value produces
      * the given {@code target} value, and tests the inverse conversion.
      */
@@ -115,7 +128,9 @@ public final strictfp class NumberConver
     @Test
     public void testInteger() {
         final ObjectConverter<Float, Integer> c = create(Float.class, Integer.class);
-        runInvertibleConversion(c, Float.valueOf(-8), Integer.valueOf(-8));
+        runInvertibleConversion(c, Float.valueOf(-8),    Integer.valueOf(-8));
+        runConversion          (c, Float.valueOf(2.25f), Integer.valueOf(2), Float.valueOf(2f));
+        runConversion          (c, Float.valueOf(2.75f), Integer.valueOf(3), Float.valueOf(3f));
         // Can not easily tests the values around Integer.MIN/MAX_VALUE because of rounding
errors in float.
         assertSame("Deserialization shall resolves to the singleton instance.", c, assertSerializedEquals(c));
     }
@@ -137,6 +152,7 @@ public final strictfp class NumberConver
     public void testFloat() {
         final ObjectConverter<Double, Float> c = create(Double.class, Float.class);
         runInvertibleConversion(c, Double.valueOf(2.5), Float.valueOf(2.5f));
+        runConversion          (c, Double.valueOf(0.1), Float.valueOf(0.1f), Double.valueOf(0.1f));
         tryUnconvertibleValue  (c, Double.valueOf(1E+40));
         assertSame("Deserialization shall resolves to the singleton instance.", c, assertSerializedEquals(c));
     }
@@ -172,6 +188,23 @@ public final strictfp class NumberConver
     }
 
     /**
+     * Tests conversion of a value having more digits than what the {@code double} type can
hold.
+     */
+    @Test
+    public void testLargeValue() {
+        final long longValue = 1000000000000000010L;
+        final double doubleValue = longValue;
+        assertTrue(Math.ulp(doubleValue) > 10); // Need to have more digits than 'double'
capacity.
+        runConversion(create(BigDecimal.class, Double.class),
+                BigDecimal.valueOf(longValue), Double.valueOf(doubleValue), BigDecimal.valueOf(doubleValue));
+
+        final ObjectConverter<BigDecimal, Long> c = create(BigDecimal.class, Long.class);
+        final BigDecimal value = BigDecimal.valueOf(longValue);
+        runInvertibleConversion(c, value, Long.valueOf(longValue));
+        tryUnconvertibleValue(c, value.multiply(BigDecimal.valueOf(10)));
+    }
+
+    /**
      * Tests conversions to comparable objects. Should returns the object unchanged
      * since all {@link Number} subclasses are comparable.
      */



Mime
View raw message