sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1773528 [1/3] - in /sis/branches/JDK7: ./ application/sis-console/ application/sis-openoffice/src/main/unopkg/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-referen...
Date Sat, 10 Dec 2016 17:35:39 GMT
Author: desruisseaux
Date: Sat Dec 10 17:35:38 2016
New Revision: 1773528

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

Added:
    sis/branches/JDK7/ide-project/NetBeans/nbproject/cfg_hints.xml
      - copied unchanged from r1773526, sis/branches/JDK8/ide-project/NetBeans/nbproject/cfg_hints.xml
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
      - copied, changed from r1773526, sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
    sis/branches/JDK7/storage/sis-geotiff/src/main/resources/
      - copied from r1773526, sis/branches/JDK8/storage/sis-geotiff/src/main/resources/
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/application/sis-console/pom.xml
    sis/branches/JDK7/application/sis-openoffice/src/main/unopkg/sis.png   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Cloner.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptyQueue.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/XPaths.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/XPathsTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SystemUnitTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
    sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
    sis/branches/JDK7/pom.xml
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
    sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 10 17:35:38 2016
@@ -1,4 +1,5 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1773005
+/sis/branches/JDK8:1584960-1773526
+/sis/branches/JDK9:1773327-1773512
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/application/sis-console/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/pom.xml?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/pom.xml (original)
+++ sis/branches/JDK7/application/sis-console/pom.xml Sat Dec 10 17:35:38 2016
@@ -111,6 +111,18 @@ Console application.
       <version>${project.version}</version>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.sis.storage</groupId>
+      <artifactId>sis-geotiff</artifactId>
+      <version>${project.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sis.storage</groupId>
+      <artifactId>sis-earth-observation</artifactId>
+      <version>${project.version}</version>
+      <scope>runtime</scope>
+    </dependency>
 
     <!-- Test dependencies -->
     <dependency>

Propchange: sis/branches/JDK7/application/sis-openoffice/src/main/unopkg/sis.png
            ('svn:mergeinfo' removed)

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.io.wkt;
 
 import java.util.EnumMap;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.apache.sis.internal.util.X364;
 import org.apache.sis.util.resources.Errors;
 
@@ -110,7 +111,7 @@ public class Colors implements Cloneable
     /**
      * Creates a new set of colors initialized to a copy of the given one.
      *
-     * @param colors The set of colors to copy.
+     * @param colors  the set of colors to copy.
      */
     public Colors(final Colors colors) {
         map = new EnumMap<>(colors.map);
@@ -122,9 +123,9 @@ public class Colors implements Cloneable
      * {@code "red"}, {@code "green"}, {@code "yellow"}, {@code "blue"}, {@code "magenta"}, {@code "cyan"}
      * and {@code "gray"}, case-insensitive.
      *
-     * @param  key   The syntactic element for which to set the color.
-     * @param  color The color to give to the specified element, or {@code null} if none.
-     * @throws IllegalArgumentException If the given color name is not recognized.
+     * @param  key    the syntactic element for which to set the color.
+     * @param  color  the color to give to the specified element, or {@code null} if none.
+     * @throws IllegalArgumentException if the given color name is not recognized.
      */
     public void setName(final ElementKind key, final String color) throws IllegalArgumentException {
         if (isImmutable) {
@@ -143,7 +144,7 @@ public class Colors implements Cloneable
      * @param key The syntactic element for which to get the color.
      * @return The color of the specified element, or {@code null} if none.
      */
-    public final String getName(final ElementKind key) { // Declared final for consistency with getAnsiSequence(…)
+    public final String getName(final ElementKind key) {      // Declared final for consistency with getAnsiSequence(…)
         final X364 color = map.get(key);
         return (color != null) ? color.color : null;
     }
@@ -171,7 +172,7 @@ public class Colors implements Cloneable
     /**
      * Returns a clone of this {@code Colors}.
      *
-     * @return A clone of this {@code Colors}.
+     * @return a clone of this {@code Colors}.
      */
     @Override
     public Colors clone() {
@@ -189,7 +190,7 @@ public class Colors implements Cloneable
     /**
      * Compares this {@code Colors} with the given object for equality.
      *
-     * @param  other The object to compare with this {@code Colors}.
+     * @param  other  the object to compare with this {@code Colors}.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -204,7 +205,7 @@ public class Colors implements Cloneable
     /**
      * Returns a hash code value for this object.
      *
-     * @return A hash code value.
+     * @return a hash code value.
      */
     @Override
     public int hashCode() {
@@ -214,9 +215,10 @@ public class Colors implements Cloneable
     /**
      * Replaces the deserialized instance by {@link #DEFAULT} one if possible.
      *
-     * @return The object to use after deserialization.
+     * @return the object to use after deserialization.
+     * @throws ObjectStreamException required by specification but should never be thrown.
      */
-    final Object readResolve() {
+    final Object readResolve() throws ObjectStreamException {
         return isImmutable && map.equals(DEFAULT.map) ? DEFAULT : this;
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -19,6 +19,7 @@ package org.apache.sis.io.wkt;
 import java.util.Arrays;
 import java.util.Locale;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import java.text.NumberFormat;
 import org.apache.sis.util.Localized;
 import org.apache.sis.util.Workaround;
@@ -192,7 +193,7 @@ public class Symbols implements Localize
     /**
      * Creates a new set of WKT symbols initialized to a copy of the given symbols.
      *
-     * @param symbols The symbols to copy.
+     * @param symbols  the symbols to copy.
      */
     public Symbols(final Symbols symbols) {
         ensureNonNull("symbols", symbols);
@@ -235,7 +236,7 @@ public class Symbols implements Localize
      * Returns the default set of symbols.
      * This is currently set to {@link #SQUARE_BRACKETS}.
      *
-     * @return The default set of symbols.
+     * @return the default set of symbols.
      */
     public static Symbols getDefault() {
         return SQUARE_BRACKETS;
@@ -251,7 +252,7 @@ public class Symbols implements Localize
      * On the contrary, the {@code Locale} property of this {@code Symbols} class controls
      * the decimal format symbols and is very rarely set to an other locale than {@code Locale.ROOT}.
      *
-     * @return The locale for dates and numbers.
+     * @return the locale for dates and numbers.
      *
      * @see WKTFormat#getLocale(Locale.Category)
      */
@@ -265,7 +266,7 @@ public class Symbols implements Localize
      * Note that any non-English locale is likely to produce WKT that do not conform to ISO 19162.
      * Such WKT can be used for human reading, but not for data export.
      *
-     * @param locale The new symbols locale.
+     * @param  locale  the new symbols locale.
      */
     public void setLocale(final Locale locale) {
         checkWritePermission();
@@ -297,7 +298,7 @@ public class Symbols implements Localize
      * Returns the number of paired brackets. For example if the WKT parser accepts both the
      * {@code […]} and {@code (…)} bracket pairs, then this method returns 2.
      *
-     * @return The number of bracket pairs.
+     * @return the number of bracket pairs.
      *
      * @see #getOpeningBracket(int)
      * @see #getClosingBracket(int)
@@ -311,8 +312,8 @@ public class Symbols implements Localize
      * Index 0 stands for the default bracket used at formatting time.
      * All other index are for optional brackets accepted at parsing time.
      *
-     * @param  index Index of the opening bracket to get, from 0 to {@link #getNumPairedBrackets()} exclusive.
-     * @return The opening bracket at the given index, as a Unicode code point.
+     * @param  index  index of the opening bracket to get, from 0 to {@link #getNumPairedBrackets()} exclusive.
+     * @return the opening bracket at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     public final int getOpeningBracket(final int index) {
@@ -324,8 +325,8 @@ public class Symbols implements Localize
      * Index 0 stands for the default bracket used at formatting time.
      * All other index are for optional brackets accepted at parsing time.
      *
-     * @param  index Index of the closing bracket to get, from 0 to {@link #getNumPairedBrackets()} exclusive.
-     * @return The closing bracket at the given index, as a Unicode code point.
+     * @param  index  index of the closing bracket to get, from 0 to {@link #getNumPairedBrackets()} exclusive.
+     * @return the closing bracket at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     public final int getClosingBracket(final int index) {
@@ -345,8 +346,8 @@ public class Symbols implements Localize
      *   symbols.setPairedBrackets("()", "[]");
      * }</div>
      *
-     * @param preferred The preferred pair of opening and closing quotes, used at formatting time.
-     * @param alternatives Alternative pairs of opening and closing quotes accepted at parsing time.
+     * @param  preferred     the preferred pair of opening and closing quotes, used at formatting time.
+     * @param  alternatives  alternative pairs of opening and closing quotes accepted at parsing time.
      */
     public void setPairedBrackets(final String preferred, final String... alternatives) {
         checkWritePermission();
@@ -379,8 +380,8 @@ public class Symbols implements Localize
      * Index 0 stands for the default quote used at formatting time, which is usually {@code '"'}.
      * All other index are for optional quotes accepted at parsing time.
      *
-     * @param  index Index of the opening quote to get, from 0 to {@link #getNumPairedQuotes()} exclusive.
-     * @return The opening quote at the given index, as a Unicode code point.
+     * @param  index  index of the opening quote to get, from 0 to {@link #getNumPairedQuotes()} exclusive.
+     * @return the opening quote at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     public final int getOpeningQuote(final int index) {
@@ -392,8 +393,8 @@ public class Symbols implements Localize
      * Index 0 stands for the default quote used at formatting time, which is usually {@code '"'}.
      * All other index are for optional quotes accepted at parsing time.
      *
-     * @param  index Index of the closing quote to get, from 0 to {@link #getNumPairedQuotes()} exclusive.
-     * @return The closing quote at the given index, as a Unicode code point.
+     * @param  index  index of the closing quote to get, from 0 to {@link #getNumPairedQuotes()} exclusive.
+     * @return the closing quote at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     public final int getClosingQuote(final int index) {
@@ -423,8 +424,8 @@ public class Symbols implements Localize
      *   symbols.setPairedQuotes("“”", "\"\"");
      * }</div>
      *
-     * @param preferred The preferred pair of opening and closing quotes, used at formatting time.
-     * @param alternatives Alternative pairs of opening and closing quotes accepted at parsing time.
+     * @param  preferred     the preferred pair of opening and closing quotes, used at formatting time.
+     * @param  alternatives  alternative pairs of opening and closing quotes accepted at parsing time.
      */
     public void setPairedQuotes(final String preferred, final String... alternatives) {
         checkWritePermission();
@@ -473,7 +474,7 @@ public class Symbols implements Localize
      * Returns the character used for opening a sequence of values.
      * This is usually <code>'{'</code>.
      *
-     * @return The character used for opening a sequence of values, as a Unicode code point.
+     * @return the character used for opening a sequence of values, as a Unicode code point.
      */
     public final int getOpenSequence() {
         return openSequence;
@@ -483,7 +484,7 @@ public class Symbols implements Localize
      * Returns the character used for closing a sequence of values.
      * This is usually <code>'}'</code>.
      *
-     * @return The character used for closing a sequence of values, as a Unicode code point.
+     * @return the character used for closing a sequence of values, as a Unicode code point.
      */
     public final int getCloseSequence() {
         return closeSequence;
@@ -492,8 +493,8 @@ public class Symbols implements Localize
     /**
      * Sets the characters used for opening and closing a sequence of values.
      *
-     * @param openSequence  The character for opening a sequence of values, as a Unicode code point.
-     * @param closeSequence The character for closing a sequence of values, as a Unicode code point.
+     * @param  openSequence   the character for opening a sequence of values, as a Unicode code point.
+     * @param  closeSequence  the character for closing a sequence of values, as a Unicode code point.
      */
     public void setSequenceBrackets(final int openSequence, final int closeSequence) {
         checkWritePermission();
@@ -507,7 +508,7 @@ public class Symbols implements Localize
      * Returns the string used as a separator in a list of values. This is usually {@code ", "},
      * but may be different if a non-English locale is used for formatting numbers.
      *
-     * @return The string used as a separator in a list of values.
+     * @return the string used as a separator in a list of values.
      */
     public final String getSeparator() {
         return separator;
@@ -518,7 +519,7 @@ public class Symbols implements Localize
      * The given string will be used "as-is" at formatting time,
      * but leading and trailing spaces will be ignored at parsing time.
      *
-     * @param separator The new string to use as a separator in a list of values.
+     * @param  separator  the new string to use as a separator in a list of values.
      */
     public void setSeparator(final String separator) {
         checkWritePermission();
@@ -580,8 +581,8 @@ public class Symbols implements Localize
      * The purpose of this method is to guess some characteristics about the encoded object without
      * the cost of a full WKT parsing.
      *
-     * @param  wkt The WKT to inspect.
-     * @param  element The element to search for.
+     * @param  wkt      the WKT to inspect.
+     * @param  element  the element to search for.
      * @return {@code true} if the given WKT contains at least one instance of the given element.
      */
     public boolean containsElement(final CharSequence wkt, final String element) {
@@ -605,7 +606,7 @@ public class Symbols implements Localize
      * Consequently, the presence of {@code AXIS[…]} elements in a WKT is an indication that the encoded
      * object may not be understood as intended by some external softwares.
      *
-     * @param  wkt The WKT to inspect.
+     * @param  wkt  the WKT to inspect.
      * @return {@code true} if the given WKT contains at least one instance of the {@code AXIS[…]} element.
      */
     public boolean containsAxis(final CharSequence wkt) {
@@ -616,9 +617,9 @@ public class Symbols implements Localize
     /**
      * Implementation of {@link #containsElement(CharSequence, String)} without verification of argument validity.
      *
-     * @param  wkt     The WKT to inspect.
-     * @param  element The element to search. Must contains only uppercase letters.
-     * @param  offset  The index to start the search from.
+     * @param  wkt      the WKT to inspect.
+     * @param  element  the element to search. Must contains only uppercase letters.
+     * @param  offset   the index to start the search from.
      */
     private boolean containsElement(final CharSequence wkt, final String element, int offset) {
         final int[] quotes = this.quotes;
@@ -685,7 +686,7 @@ public class Symbols implements Localize
     /**
      * Returns a clone of this {@code Symbols}.
      *
-     * @return A clone of this {@code Symbols}.
+     * @return a clone of this {@code Symbols}.
      */
     @Override
     public Symbols clone() {
@@ -706,7 +707,7 @@ public class Symbols implements Localize
     /**
      * Compares this {@code Symbols} with the given object for equality.
      *
-     * @param  other The object to compare with this {@code Symbols}.
+     * @param  other  the object to compare with this {@code Symbols}.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -727,7 +728,7 @@ public class Symbols implements Localize
     /**
      * Returns a hash code value for this object.
      *
-     * @return A hash code value.
+     * @return a hash code value.
      */
     @Override
     public int hashCode() {
@@ -738,9 +739,10 @@ public class Symbols implements Localize
      * Invoked on deserialization for replacing the deserialized instance by the constant instance.
      * This method also opportunistically recompute the {@link #quote} field if no replacement is done.
      *
-     * @return The object to use after deserialization.
+     * @return the object to use after deserialization.
+     * @throws ObjectStreamException required by specification but should never be thrown.
      */
-    final Object readResolve() {
+    final Object readResolve() throws ObjectStreamException {
         if (isImmutable) {
             if (equals(SQUARE_BRACKETS)) return SQUARE_BRACKETS;
             if (equals(CURLY_BRACKETS))  return CURLY_BRACKETS;

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -19,6 +19,7 @@ package org.apache.sis.io.wkt;
 import java.util.Map;
 import java.util.HashMap;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.referencing.cs.PolarCS;
 import org.opengis.referencing.cs.SphericalCS;
 import org.opengis.referencing.cs.EllipsoidalCS;
@@ -155,8 +156,8 @@ public abstract class Transliterator imp
      * <p>The default implementation invokes {@link CharSequences#toASCII(CharSequence)},
      * replaces line feed and tabulations by single spaces, then remove control characters.</p>
      *
-     * @param  text The text to format without non-ASCII characters.
-     * @return The text to write in <cite>Well Known Text</cite>.
+     * @param  text  the text to format without non-ASCII characters.
+     * @return the text to write in <cite>Well Known Text</cite>.
      *
      * @see org.apache.sis.util.Characters#isValidWKT(int)
      */
@@ -207,10 +208,10 @@ public abstract class Transliterator imp
      *       or {@code GEOCENTRIC_Z} and the name is the same than the axis direction (ignoring case).</li>
      * </ul>
      *
-     * @param  cs        The enclosing coordinate system, or {@code null} if unknown.
-     * @param  direction The direction of the axis to format.
-     * @param  name      The axis name, to be eventually replaced by this method.
-     * @return The axis name to format, or {@code null} if the name shall be omitted.
+     * @param  cs         the enclosing coordinate system, or {@code null} if unknown.
+     * @param  direction  the direction of the axis to format.
+     * @param  name       the axis name, to be eventually replaced by this method.
+     * @return the axis name to format, or {@code null} if the name shall be omitted.
      *
      * @see org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#formatTo(Formatter)
      */
@@ -257,10 +258,10 @@ public abstract class Transliterator imp
      * SIS does not put restriction on axis names, but we nevertheless try to use a unique
      * name when we recognize it.</div>
      *
-     * @param  csType    The type of the coordinate system, or {@code null} if unknown.
-     * @param  direction The parsed axis direction.
-     * @param  name      The parsed axis abbreviation, to be eventually replaced by this method.
-     * @return The axis name to use. Can not be null.
+     * @param  csType     the type of the coordinate system, or {@code null} if unknown.
+     * @param  direction  the parsed axis direction.
+     * @param  name       the parsed axis abbreviation, to be eventually replaced by this method.
+     * @return the axis name to use. Can not be null.
      */
     public String toLongAxisName(final String csType, final AxisDirection direction, final String name) {
         if (csType != null) switch (csType) {
@@ -290,8 +291,8 @@ public abstract class Transliterator imp
     /**
      * Returns {@code true} if the given axis name is at least part of the given expected axis name.
      *
-     * @param expected {@link AxisNames#LATITUDE} or {@link AxisNames#LONGITUDE}.
-     * @param name The parsed axis name.
+     * @param  expected  {@link AxisNames#LATITUDE} or {@link AxisNames#LONGITUDE}.
+     * @param  name      the parsed axis name.
      */
     private static boolean isLatLong(final String expected, final String name) {
         final int length = name.length();
@@ -320,10 +321,10 @@ public abstract class Transliterator imp
      * Note that while this method may return a string of any length, ISO 19162 requires abbreviations
      * to be a single Latin character.
      *
-     * @param  cs           The enclosing coordinate system, or {@code null} if unknown.
-     * @param  direction    The direction of the axis to format.
-     * @param  abbreviation The axis abbreviation, to be eventually replaced by this method.
-     * @return The axis abbreviation to format.
+     * @param  cs            the enclosing coordinate system, or {@code null} if unknown.
+     * @param  direction     the direction of the axis to format.
+     * @param  abbreviation  the axis abbreviation, to be eventually replaced by this method.
+     * @return the axis abbreviation to format.
      *
      * @see org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#formatTo(Formatter)
      */
@@ -398,10 +399,10 @@ public abstract class Transliterator imp
      *   <li><var>U</var> → θ  if {@code csType} is {@code "polar"}.</li>
      * </ul>
      *
-     * @param  csType       The type of the coordinate system, or {@code null} if unknown.
-     * @param  direction    The parsed axis direction.
-     * @param  abbreviation The parsed axis abbreviation, to be eventually replaced by this method.
-     * @return The axis abbreviation to use. Can not be null.
+     * @param  csType        the type of the coordinate system, or {@code null} if unknown.
+     * @param  direction     the parsed axis direction.
+     * @param  abbreviation  the parsed axis abbreviation, to be eventually replaced by this method.
+     * @return the axis abbreviation to use. Can not be null.
      */
     public String toUnicodeAbbreviation(final String csType, final AxisDirection direction, String abbreviation) {
         if (abbreviation.length() == 1) {
@@ -439,7 +440,7 @@ public abstract class Transliterator imp
         }
 
         /** Replaces deserialized instances by the unique instance. */
-        Object readResolve() {
+        Object readResolve() throws ObjectStreamException {
             return DEFAULT;
         }
     }
@@ -483,7 +484,7 @@ public abstract class Transliterator imp
         }
 
         /** Replaces deserialized instances by the unique instance. */
-        Object readResolve() {
+        Object readResolve() throws ObjectStreamException {
             return IDENTITY;
         }
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.metadata;
 
 import java.util.Map;
 import java.util.IdentityHashMap;
+import java.io.ObjectStreamException;
 import org.opengis.annotation.UML;
 import org.opengis.annotation.Classifier;
 import org.opengis.annotation.Stereotype;
@@ -71,11 +72,11 @@ final class StandardImplementation exten
      * Creates a new instance working on implementation of interfaces defined in the
      * specified package. This constructor is used only for the pre-defined constants.
      *
-     * @param citation              The title of the standard.
-     * @param interfacePackage      The root package for metadata interfaces, with a trailing {@code '.'}.
-     * @param implementationPackage The root package for metadata implementations. with a trailing {@code '.'}.
-     * @param acronyms              An array of (full text, acronyms) pairs. This array is not cloned.
-     * @param dependencies          The dependencies to other metadata standards, or {@code null} if none.
+     * @param citation               the title of the standard.
+     * @param interfacePackage       the root package for metadata interfaces, with a trailing {@code '.'}.
+     * @param implementationPackage  the root package for metadata implementations. with a trailing {@code '.'}.
+     * @param acronyms               an array of (full text, acronyms) pairs. This array is not cloned.
+     * @param dependencies           the dependencies to other metadata standards, or {@code null} if none.
      */
     StandardImplementation(final String citation, final String interfacePackage, final String implementationPackage,
             final String[] acronyms, final MetadataStandard[] dependencies)
@@ -111,9 +112,9 @@ final class StandardImplementation exten
      * Returns the implementation class for the given interface, or {@code null} if none.
      * This class uses heuristic rules based on naming conventions.
      *
-     * @param  <T>  The compile-time {@code type}.
-     * @param  type The interface, typically from the {@code org.opengis.metadata} package.
-     * @return The implementation class, or {@code null} if none.
+     * @param  <T>   the compile-time {@code type}.
+     * @param  type  the interface, typically from the {@code org.opengis.metadata} package.
+     * @return the implementation class, or {@code null} if none.
      */
     @Override
     public <T> Class<? extends T> getImplementation(final Class<T> type) {
@@ -170,7 +171,7 @@ final class StandardImplementation exten
     /**
      * Invoked on deserialization. Returns one of the pre-existing constants if possible.
      */
-    Object readResolve() {
+    Object readResolve() throws ObjectStreamException {
         if (ISO_19111.citation.equals(citation)) return ISO_19111;
         if (ISO_19115.citation.equals(citation)) return ISO_19115;
         /*

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -371,7 +371,7 @@ public abstract class DatumShiftGrid<C e
 
     /**
      * Converts the given normalized <var>x</var> ordinate to grid index.
-     * "Normalized coordinates" are coordinates in the unit of measurement given by {@link Unit#toSI()}.
+     * "Normalized coordinates" are coordinates in the unit of measurement given by {@link Unit#getSystemUnit()}.
      * For angular coordinates, this is radians. For linear coordinates, this is metres.
      *
      * @param  x  the "real world" ordinate (often longitude in radians) of the point for which to get the translation.
@@ -383,7 +383,7 @@ public abstract class DatumShiftGrid<C e
 
     /**
      * Converts the given normalized <var>x</var> ordinate to grid index.
-     * "Normalized coordinates" are coordinates in the unit of measurement given by {@link Unit#toSI()}.
+     * "Normalized coordinates" are coordinates in the unit of measurement given by {@link Unit#getSystemUnit()}.
      * For angular coordinates, this is radians. For linear coordinates, this is metres.
      *
      * @param  y  the "real world" ordinate (often latitude in radians) of the point for which to get the translation.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.opera
 
 import java.util.Arrays;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.apache.sis.referencing.operation.matrix.Matrix2;
@@ -59,7 +60,7 @@ final class CartesianToPolar extends Coo
     /**
      * Returns the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.opera
 
 import java.util.Arrays;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.apache.sis.referencing.operation.matrix.Matrix3;
@@ -52,7 +53,7 @@ final class CartesianToSpherical extends
     /**
      * Returns the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -198,7 +198,7 @@ public class InterpolatedTransform exten
      *   <li>If the datum shift unit {@linkplain Units#isTemporal(Unit) is temporal}, then the transform
      *       will work with input and output coordinates in seconds.</li>
      *   <li>Generally for all units other than angular, the transform will work with input and output
-     *       coordinates in the unit given by {@link Unit#toSI()}.</li>
+     *       coordinates in the unit given by {@link Unit#getSystemUnit()}.</li>
      * </ul>
      *
      * @param  <T>      dimension of the coordinate and the translation unit.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.opera
 
 import java.util.Arrays;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.apache.sis.referencing.operation.matrix.Matrix2;
@@ -72,7 +73,7 @@ final class PolarToCartesian extends Coo
     /**
      * Returns the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.opera
 
 import java.util.Arrays;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.apache.sis.referencing.operation.matrix.Matrix3;
@@ -70,7 +71,7 @@ final class SphericalToCartesian extends
     /**
      * Returns the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.converter;
 
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.ObjectConverter;
@@ -77,7 +78,7 @@ final class Column extends TableColumn<C
     /**
      * Resources to the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return target ? TARGET : SOURCE;
     }
 
@@ -93,8 +94,8 @@ final class Column extends TableColumn<C
      * Used by {@link FallbackConverter} and {@link ConverterRegistry} for
      * implementing their {@code toString()} method.
      *
-     * @param  converter The converter for which to create a tree.
-     * @param  addTo     The node in which to add the converter.
+     * @param  converter  the converter for which to create a tree.
+     * @param  addTo      the node in which to add the converter.
      */
     static void toTree(final ObjectConverter<?,?> converter, final TreeTable.Node addTo) {
         final TreeTable.Node node = addTo.newChild();

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.internal.converte
 
 import java.util.Set;
 import java.util.EnumSet;
+import java.io.ObjectStreamException;
 import org.apache.sis.math.FunctionProperty;
 import org.apache.sis.util.ObjectConverter;
 import org.apache.sis.util.resources.Errors;
@@ -48,8 +49,8 @@ abstract class SystemConverter<S,T> exte
     /**
      * Creates a new converter for the given source and target classes.
      *
-     * @param sourceClass The {@linkplain #getSourceClass() source class}.
-     * @param targetClass The {@linkplain #getTargetClass() target class}.
+     * @param sourceClass  the {@linkplain #getSourceClass() source class}.
+     * @param targetClass  the {@linkplain #getTargetClass() target class}.
      */
     SystemConverter(final Class<S> sourceClass, final Class<T> targetClass) {
         super(sourceClass, targetClass);
@@ -58,7 +59,7 @@ abstract class SystemConverter<S,T> exte
     /**
      * Returns the source class given at construction time.
      *
-     * @return The type of objects to convert.
+     * @return the type of objects to convert.
      */
     @Override
     public final Class<S> getSourceClass() {
@@ -68,7 +69,7 @@ abstract class SystemConverter<S,T> exte
     /**
      * Returns the target class given at construction time.
      *
-     * @return The type of converted objects.
+     * @return the type of converted objects.
      */
     @Override
     public final Class<T> getTargetClass() {
@@ -87,7 +88,7 @@ abstract class SystemConverter<S,T> exte
     /**
      * Default to non-invertible conversion. Must be overridden by subclasses that support inversions.
      *
-     * @return A converter for converting instances of <var>T</var> back to instances of <var>S</var>.
+     * @return a converter for converting instances of <var>T</var> back to instances of <var>S</var>.
      */
     @Override
     public ObjectConverter<T,S> inverse() throws UnsupportedOperationException {
@@ -120,7 +121,7 @@ abstract class SystemConverter<S,T> exte
      *       an instance of {@code ClassPair} instance (not a subclass).</li>
      * </ul>
      *
-     * @param  other The object to compare with this {@code SystemConverter}.
+     * @param  other the object to compare with this {@code SystemConverter}.
      * @return {@code true} if the given object is a {@code ClassPair} or a converter of the
      *         same class than {@code this}, and both have the same source and target classes.
      */
@@ -138,7 +139,7 @@ abstract class SystemConverter<S,T> exte
      * exists for the same source an target classes, then this converter is returned.
      * Otherwise this converter is returned <strong>without</strong> being cached.
      *
-     * @return The unique instance, or {@code this} if no unique instance can be found.
+     * @return the unique instance, or {@code this} if no unique instance can be found.
      */
     public ObjectConverter<S,T> unique() {
         final ObjectConverter<S,T> existing = SystemRegistry.INSTANCE.findEquals(this);
@@ -149,15 +150,15 @@ abstract class SystemConverter<S,T> exte
      * Returns the singleton instance on deserialization, if any. If no instance already exist
      * in the virtual machine, we do not cache the instance (for now) for security reasons.
      */
-    protected final Object readResolve() {
+    protected final Object readResolve() throws ObjectStreamException {
         return unique();
     }
 
     /**
      * Formats an error message for a value that can not be converted.
      *
-     * @param  value The value that can not be converted.
-     * @return The error message.
+     * @param  value  the value that can not be converted.
+     * @return the error message.
      */
     final String formatErrorMessage(final S value) {
         return Errors.format(Errors.Keys.CanNotConvertValue_2, value, targetClass);

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.IdentityHashMap;
 import java.util.Collection;
 import java.util.Collections;
+import java.io.ObjectStreamException;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.internal.simple.CitationConstant;
@@ -96,9 +97,9 @@ public final class NonMarshalledAuthorit
     /**
      * Creates a new citation for the given XML attribute name.
      *
-     * @param attribute The XML attribute name, to be returned by {@link #getName()}.
-     * @param ordinal   Ordinal value for switch statement, as one of the {@link #ID},
-     *                  {@link #UUID}, <i>etc.</i> constants.
+     * @param attribute  the XML attribute name, to be returned by {@link #getName()}.
+     * @param ordinal    ordinal value for switch statement, as one of the {@link #ID},
+     *                   {@link #UUID}, <i>etc.</i> constants.
      */
     public NonMarshalledAuthority(final String attribute, final byte ordinal) {
         super(attribute);
@@ -113,9 +114,9 @@ public final class NonMarshalledAuthorit
      * <p>This method is used for implementation of {@code getIdentifier()} methods (singular form)
      * in public metadata objects.</p>
      *
-     * @param  <T> The type of object used as identifier values.
-     * @param  identifiers The collection from which to get identifiers, or {@code null}.
-     * @return The first identifier, or {@code null} if none.
+     * @param  <T>          the type of object used as identifier values.
+     * @param  identifiers  the collection from which to get identifiers, or {@code null}.
+     * @return the first identifier, or {@code null} if none.
      */
     public static <T extends Identifier> T getMarshallable(final Collection<? extends T> identifiers) {
         if (identifiers != null) {
@@ -137,9 +138,9 @@ public final class NonMarshalledAuthorit
      * <p>This method is used for implementation of {@code setIdentifier(Identifier)} methods
      * in public metadata objects.</p>
      *
-     * @param <T>         The type of object used as identifier values.
-     * @param identifiers The collection in which to add the identifier.
-     * @param newValue    The identifier to add, or {@code null}.
+     * @param <T>          the type of object used as identifier values.
+     * @param identifiers  the collection in which to add the identifier.
+     * @param newValue     the identifier to add, or {@code null}.
      *
      * @see #setMarshallables(Collection, Collection)
      */
@@ -148,7 +149,7 @@ public final class NonMarshalledAuthorit
         while (it.hasNext()) {
             final T old = it.next();
             if (old != null && old.getAuthority() instanceof NonMarshalledAuthority<?>) {
-                continue; // Don't touch this identifier.
+                continue;                   // Leave the identifier as-is.
             }
             it.remove();
         }
@@ -167,8 +168,8 @@ public final class NonMarshalledAuthorit
      * {@link org.apache.sis.xml.IdentifiedObject#getIdentifiers()}, which is expected to return
      * all identifiers in normal (non-marshalling) usage.</p>
      *
-     * @param  identifiers The identifiers to filter, or {@code null}.
-     * @return The identifiers to marshal, or {@code null} if none.
+     * @param  identifiers  the identifiers to filter, or {@code null}.
+     * @return the identifiers to marshal, or {@code null} if none.
      */
     public static Collection<Identifier> filterOnMarshalling(Collection<Identifier> identifiers) {
         if (identifiers != null && Context.isFlagSet(Context.current(), Context.MARSHALLING)) {
@@ -196,9 +197,9 @@ public final class NonMarshalledAuthorit
      * <p>This method is used for implementation of {@code setIdentifiers(Collection)} methods
      * in public metadata objects.</p>
      *
-     * @param  identifiers The metadata internal identifiers collection, or {@code null} if none.
-     * @param  newValues   The identifiers to add, or {@code null}.
-     * @return The collection to set (may be {@code newValues}.
+     * @param  identifiers  the metadata internal identifiers collection, or {@code null} if none.
+     * @param  newValues    the identifiers to add, or {@code null}.
+     * @return the collection to set (may be {@code newValues}.
      *
      * @see #setMarshallable(Collection, Identifier)
      */
@@ -261,10 +262,11 @@ public final class NonMarshalledAuthorit
      * Invoked at deserialization time in order to replace the deserialized instance
      * by the appropriate instance defined in the {@link IdentifierSpace} interface.
      *
-     * @return The instance to use, as an unique instance if possible.
+     * @return the instance to use, as an unique instance if possible.
+     * @throws ObjectStreamException never thrown.
      */
     @Override
-    protected Object readResolve() {
+    protected Object readResolve() throws ObjectStreamException {
         final String name = getName();
         IdentifierSpace<?> candidate;
         int code = 0;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -18,6 +18,7 @@ package org.apache.sis.internal.simple;
 
 import java.util.Date;
 import java.util.Collection;
+import java.io.ObjectStreamException;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.CitationDate;
@@ -172,8 +173,9 @@ public class CitationConstant extends Si
      * instance defined in the {@link org.apache.sis.metadata.iso.citation.Citations} class.
      *
      * @return the instance to use, as an unique instance if possible.
+     * @throws ObjectStreamException never thrown.
      */
-    protected Object readResolve() {
+    protected Object readResolve() throws ObjectStreamException {
         CitationConstant c = MetadataServices.getInstance().getCitationConstant(title);
         if (c == null) {
             /*

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Cloner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Cloner.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Cloner.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Cloner.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -61,7 +61,7 @@ public class Cloner {
      * <p>The default implementation returns {@code true} in every cases.
      * Subclasses can override this method if they need a different behavior.</p>
      *
-     * @param  object The object that can not be cloned.
+     * @param  object  the object that can not be cloned.
      * @return {@code true} if the problem shall be considered a clone failure.
      */
     protected boolean isCloneRequired(final Object object) {
@@ -78,9 +78,9 @@ public class Cloner {
      *   <li>Otherwise the given object is returned.</li>
      * </ul>
      *
-     * @param  object The object to clone, or {@code null}.
-     * @return A clone of the given object, or {@code null} if {@code object} was null.
-     * @throws CloneNotSupportedException If the given object can not be cloned.
+     * @param  object  the object to clone, or {@code null}.
+     * @return a clone of the given object, or {@code null} if {@code object} was null.
+     * @throws CloneNotSupportedException if the given object can not be cloned.
      */
     public Object clone(final Object object) throws CloneNotSupportedException {
         if (object == null) {
@@ -136,7 +136,7 @@ public class Cloner {
      * or an unchecked exception, or do nothing otherwise. If this method returns normally,
      * then it is caller's responsibility to throw an other exception.
      *
-     * @param cause The value of {@link InvocationTargetException#getCause()}.
+     * @param  cause  the value of {@link InvocationTargetException#getCause()}.
      */
     private static void rethrow(final Throwable cause) throws CloneNotSupportedException {
         if (cause instanceof CloneNotSupportedException) {
@@ -154,9 +154,9 @@ public class Cloner {
     /**
      * Returns an exception telling that the object can not be cloned because of the given error.
      *
-     * @param  cause The cause for the failure to clone an object.
-     * @param  type  The type of object that we failed to clone.
-     * @return An exception with an error message and the given cause.
+     * @param  cause  the cause for the failure to clone an object.
+     * @param  type   the type of object that we failed to clone.
+     * @return an exception with an error message and the given cause.
      */
     private static CloneNotSupportedException fail(final Throwable cause, final Class<?> type) {
         return (CloneNotSupportedException) new CloneNotSupportedException(
@@ -168,8 +168,8 @@ public class Cloner {
      * This method may be convenient when there is only one object to clone, otherwise instantiating a new
      * {@code Cloner} object is more efficient.
      *
-     * @param  object The object to clone, or {@code null}.
-     * @return The given object (which may be {@code null}) or a clone of the given object.
+     * @param  object  the object to clone, or {@code null}.
+     * @return the given object (which may be {@code null}) or a clone of the given object.
      * @throws CloneNotSupportedException if the call to {@link Object#clone()} failed.
      *
      * @since 0.6

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptyQueue.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptyQueue.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptyQueue.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptyQueue.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.util;
 
+import java.io.ObjectStreamException;
 import java.io.Serializable;
 import java.util.AbstractQueue;
 import java.util.Collections;
@@ -26,7 +27,7 @@ import java.util.Queue;
 /**
  * An immutable and serializable empty queue.
  *
- * @param  <E> Type of elements in the collection.
+ * @param  <E>  type of elements in the collection.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
@@ -63,7 +64,8 @@ final class EmptyQueue<E> extends Abstra
     /**
      * Returns the singleton instance on deserialization.
      */
-    protected Object readResolve() {
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    protected Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/XPaths.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/XPaths.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/XPaths.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/XPaths.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -27,7 +27,7 @@ import static org.apache.sis.internal.ut
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.8
  * @module
  */
 public final class XPaths extends Static {
@@ -38,6 +38,51 @@ public final class XPaths extends Static
     }
 
     /**
+     * If the given character sequences seems to be a URI, returns the presumed end of that URN.
+     * Otherwise returns -1.
+     * Examples:
+     * <ul>
+     *   <li>{@code "urn:ogc:def:uom:EPSG::9001"}</li>
+     *   <li>{@code "http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"}</li>
+     * </ul>
+     *
+     * @param  uri     the URI candidate to verify.
+     * @param  offset  index of the first character to verify.
+     * @return index after the last character of the presumed URI, or -1 if this
+     *         method thinks that the given character sequence is not a URI.
+     *
+     * @since 0.8
+     */
+    public static int endOfURI(final CharSequence uri, int offset) {
+        boolean isURI = false;
+        int parenthesis = 0;
+        final int length = uri.length();
+scan:   while (offset < length) {
+            final int c = Character.codePointAt(uri, offset);
+            if (!Character.isLetterOrDigit(c)) {
+                switch (c) {
+                    case '#':                                           // Anchor in URL, presumed followed by xpointer.
+                    case ':': isURI |= (parenthesis == 0); break;       // Scheme or URN separator.
+                    case '_':
+                    case '-':                                           // Valid character in URL.
+                    case '%':                                           // Encoded character in URL.
+                    case '.':                                           // Domain name separator in URL.
+                    case '/': break;                                    // Path separator, but could also be division as in "m/s".
+                    case '(': parenthesis++; break;
+                    case ')': parenthesis--; break;
+                    default: {
+                        if (Character.isWhitespace(c)) break;           // Not supposed to be valid, but be lenient.
+                        if (parenthesis != 0) break;
+                        break scan;                                     // Non-valid character outside parenthesis.
+                    }
+                }
+            }
+            offset += Character.charCount(c);
+        }
+        return isURI ? offset : -1;
+    }
+
+    /**
      * Parses a URL which contains a pointer to a XML fragment.
      * The current implementation recognizes the following types:
      *
@@ -69,7 +114,7 @@ public final class XPaths extends Static
                     if (i >= 0 && regionMatches("xpointer", url, f+1, i)) {
                         i = url.indexOf("@gml:id=", i+1);
                         if (i >= 0) {
-                            i = skipLeadingWhitespaces(url, i+8, url.length()); // 8 is the length of "@gml:id="
+                            i = skipLeadingWhitespaces(url, i+8, url.length());     // 8 is the length of "@gml:id="
                             final int c = url.charAt(i);
                             if (c == '\'' || c == '"') {
                                 final int s = url.indexOf(c, ++i);

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.io;
 
+import java.io.ObjectStreamException;
 import java.text.Format;
 import java.text.FieldPosition;
 import java.text.ParsePosition;
@@ -71,7 +72,7 @@ final class ClassFormat extends Format {
     /**
      * Resolves to the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return INSTANCE;
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -20,6 +20,7 @@ import java.text.Format;
 import java.text.FieldPosition;
 import java.text.ParsePosition;
 import java.text.ParseException;
+import java.io.ObjectStreamException;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.internal.util.LocalizedParseException;
@@ -99,7 +100,7 @@ final class DefaultFormat extends Format
      * Parses the given string. Callers shall catch the {@link NumberFormatException}
      * and handle the error according the caller's method contract.
      *
-     * @throws NumberFormatException If the parsing failed.
+     * @throws NumberFormatException if the parsing failed.
      */
     private Object valueOf(final String source) throws NumberFormatException {
         return (type != Number.class) ? Numbers.valueOf(source, type) : Numbers.narrowestNumber(source);
@@ -139,7 +140,7 @@ final class DefaultFormat extends Format
     /**
      * Resolves to the singleton instance on deserialization.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         final Format format = getInstance(type);
         return (format != null) ? format : this;
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -307,15 +307,16 @@ abstract class AbstractUnit<Q extends Qu
 
     /**
      * Returns {@code true} if the given Unicode code point is a valid character for a unit symbol.
-     * Current implementation accepts only letters, subscripts and the degree sign, but the set of
-     * legal characters may be expanded in any future SIS version.
-     * The most important goal is to avoid confusion with exponents.
+     * Current implementation accepts letters, subscripts and the degree sign, but the set of legal
+     * characters may be expanded in any future SIS version. The most important goal is to avoid
+     * confusion with exponents and to detect where a unit symbol ends.
      *
-     * <p>Note that some units defined in the {@link Units} class break this rule. But the hard-coded
-     * symbols in that class are known to be consistent with SI usage or with {@link UnitFormat} work.</p>
+     * <p>Note that some units defined in the {@link Units} class break this rule. In particular,
+     * some of those units contains superscripts or division sign. But the hard-coded symbols in
+     * that class are known to be consistent with SI usage or with {@link UnitFormat} work.</p>
      */
     static boolean isSymbolChar(final int c) {
-        return Character.isLetter(c) || Characters.isSubScript(c) || c == '°';
+        return Character.isLetter(c) || Characters.isSubScript(c) || "°'′’\"″%‰-_".indexOf(c) >= 0;
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.measure;
 
+import java.util.Objects;
 import java.util.Locale;
 import java.text.Format;
 import java.text.FieldPosition;
@@ -41,11 +42,8 @@ import static org.apache.sis.math.MathFu
 import static org.apache.sis.math.MathFunctions.isNegative;
 import static org.apache.sis.math.DecimalFunctions.fractionDigitsForDelta;
 
-// Branch-dependent imports
-import java.util.Objects;
 import org.apache.sis.internal.jdk8.JDK8;
 
-
 /**
  * Parses and formats angles according a specified pattern. The pattern is a string
  * containing any characters, with a special meaning for the following characters:

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -98,7 +98,7 @@ final class ConventionalUnit<Q extends Q
          * The SystemUnitTest.verifyRelatedUnits() method verified that the array does
          * not contain null element and that all 'toTarget' are instances of LinearConverter.
          */
-        final ConventionalUnit<Q>[] related = target.related;
+        final ConventionalUnit<Q>[] related = target.related();
         if (related != null && toTarget instanceof LinearConverter) {
             final LinearConverter c = (LinearConverter) toTarget;
             for (final ConventionalUnit<Q> existing : related) {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -62,14 +62,14 @@ class FormatField extends Format.Field {
      * Invoked on deserialization for resolving this instance to one of the predefined constants.
      *
      * @return One of the predefined constants.
-     * @throws InvalidObjectException If this instance can not be resolved.
+     * @throws InvalidObjectException if this instance can not be resolved.
      */
     @Override
     protected final Object readResolve() throws InvalidObjectException {
         final Class<?> type = getClass();
         try {
             return type.cast(type.getField(getName()).get(null));
-        } catch (Exception cause) { // Many exceptions, including unchecked ones.
+        } catch (Exception cause) {                                 // Many exceptions, including unchecked ones.
             InvalidObjectException e = new InvalidObjectException(cause.toString());
             e.initCause(cause);
             throw e;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -16,15 +16,13 @@
  */
 package org.apache.sis.measure;
 
+import java.util.Objects;
 import javax.measure.Unit;
 import javax.measure.UnitConverter;
 import javax.measure.IncommensurableException;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.resources.Errors;
 
-// Branch-dependent imports
-import java.util.Objects;
-
 
 /**
  * A range of numbers associated with a unit of measurement. All operations performed by this
@@ -47,7 +45,7 @@ import java.util.Objects;
  * Subclasses may or may not be immutable, at implementation choice. But implementors are
  * encouraged to make sure that subclasses remain immutable for more predictable behavior.
  *
- * @param <E> The type of range elements as a subclass of {@link Number}.
+ * @param  <E>  the type of range elements as a subclass of {@link Number}.
  *
  * @author  Martin Desruisseaux (IRD)
  * @since   0.3

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -1016,4 +1016,33 @@ public class RangeFormat extends Format
         }
         return convert(value);
     }
+
+    /**
+     * Returns a clone of this range format.
+     *
+     * @return a clone of this range format.
+     */
+    @Override
+    public RangeFormat clone() {
+        final RangeFormat f = (RangeFormat) super.clone();
+        try {
+            f.setFinal("elementFormat", elementFormat);
+            f.setFinal("unitFormat",    unitFormat);
+        } catch (ReflectiveOperationException e) {
+            throw new AssertionError(e);
+        }
+        return f;
+    }
+
+    /**
+     * Sets final field to a clone of the given format.
+     */
+    private void setFinal(final String name, Format value) throws ReflectiveOperationException {
+        if (value != null) {
+            value = (Format) value.clone();
+            java.lang.reflect.Field f = RangeFormat.class.getDeclaredField(name);
+            f.setAccessible(true);
+            f.set(this, value);
+        }
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java?rev=1773528&r1=1773527&r2=1773528&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java [UTF-8] Sat Dec 10 17:35:38 2016
@@ -69,7 +69,7 @@ final class SystemUnit<Q extends Quantit
      *
      * @see #related(int)
      */
-    transient ConventionalUnit<Q>[] related;
+    private transient ConventionalUnit<Q>[] related;
 
     /**
      * Creates a new unit having the given symbol and EPSG code.
@@ -466,10 +466,22 @@ final class SystemUnit<Q extends Quantit
      */
     @SuppressWarnings({"unchecked", "rawtypes"})
     final void related(final int n) {
+        if (related != null) {
+            throw new IllegalStateException();
+        }
         related = new ConventionalUnit[n];
     }
 
     /**
+     * Returns units for the same quantity but with scale factors that are not the SI one.
+     * This method returns a direct reference to the internal field; caller shall not modify.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final ConventionalUnit<Q>[] related() {
+        return related;
+    }
+
+    /**
      * Compares this unit with the given object for equality.
      *
      * @param  other  the other object to compares with this unit, or {@code null}.



Mime
View raw message