sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1706801 - in /sis/branches/JDK6: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/book/ core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/ core/sis-build-helper/src/main/resources/org/apache/sis/internal/ cor...
Date Mon, 05 Oct 2015 11:11:11 GMT
Author: desruisseaux
Date: Mon Oct  5 11:11:11 2015
New Revision: 1706801

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

Added:
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/
      - copied from r1706794, sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/
    sis/branches/JDK6/core/sis-build-helper/src/main/resources/org/apache/sis/internal/
      - copied from r1706794, sis/branches/JDK7/core/sis-build-helper/src/main/resources/org/apache/sis/internal/
Removed:
    sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:11 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1704648
-/sis/branches/JDK8:1584960-1704612
+/sis/branches/JDK7:1394913-1706794
+/sis/branches/JDK8:1584960-1706793
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java?rev=1706801&r1=1706794&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -104,13 +104,13 @@ public final class Assembler {
     /**
      * The {@code title} attributes found in abbreviations.
      */
-    private final Map<String,String> abbreviations = new HashMap<>();
+    private final Map<String,String> abbreviations = new HashMap<String,String>();
 
     /**
      * Whether we found an abbreviation after the last {@code h?} element.
      * This is used in order to avoid inserting too many abbreviation title.
      */
-    private final Set<String> writtenAbbreviations = new HashSet<>();
+    private final Set<String> writtenAbbreviations = new HashSet<String>();
 
     /**
      * Section numbers, incremented when a new {@code <h1>}, {@code <h2>}, <i>etc.</i> element is found.
@@ -293,25 +293,20 @@ public final class Assembler {
             }
             case Node.ELEMENT_NODE: {
                 final String name = node.getNodeName();
-                switch (name) {
-                    case "xi:include": {
+                /* switch (name) */ {
+                    if (name.equals("xi:include")) {
                         node = replaceByBody(((Element) node).getAttribute("href"), node);
-                        break;
                     }
-                    case "aside":
-                    case "article": {
+                    else if (name.equals("aside") || name.equals("article")) {
                         index = false;
-                        break;
                     }
-                    case "abbr": {
+                    else if (name.equals("abbr")) {
                         processAbbreviation((Element) node);
-                        break;
                     }
-                    case "pre": {
+                    else if (name.equals("pre")) {
                         colorizer.highlight(node, ((Element) node).getAttribute("class"));
-                        break;
                     }
-                    case "code": {
+                    else if (name.equals("code")) {
                         if (!((Element) node).hasAttribute("class")) {
                             final String style = colorizer.styleForSingleIdentifier(node.getTextContent());
                             if (style != null) {
@@ -320,7 +315,7 @@ public final class Assembler {
                         }
                         return; // Do not scan recursively the <code> text content.
                     }
-                    default: {
+                    else {
                         if (name.length() == 2 && name.charAt(0) == 'h') {
                             final int c = name.charAt(1) - '0';
                             if (c >= 1 && c <= 9) {
@@ -348,7 +343,6 @@ public final class Assembler {
                                 }
                             }
                         }
-                        break;
                     }
                 }
                 break;

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java?rev=1706801&r1=1706794&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -47,7 +47,7 @@ public final class CodeColorizer {
     /**
      * Lists of Java keywords.
      */
-    public static final Set<String> JAVA_KEYWORDS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
+    public static final Set<String> JAVA_KEYWORDS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
         "abstract", "continue", "for",        "new",        "switch",
         "assert",   "default",  "goto",       "package",    "synchronized",
         "boolean",  "do",       "if",         "private",    "this",
@@ -106,20 +106,23 @@ public final class CodeColorizer {
      */
     public CodeColorizer(final Document document) throws IOException, BookException {
         this.document = document;
-        identifierSpecifiers = new HashMap<>(1000);
+        identifierSpecifiers = new HashMap<String,Specifier>(1000);
         for (final Specifier specifier : Specifier.values()) {
             final String filename = specifier.name() + ".lst";
             final InputStream in = CodeColorizer.class.getResourceAsStream(filename);
             if (in == null) {
                 throw new FileNotFoundException(filename);
             }
-            try (final BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8"))) {
+            final BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+            try {
                 String line;
                 while ((line = r.readLine()) != null) {
                     if (identifierSpecifiers.put(line, specifier) != null) {
                         throw new BookException(line + " is defined twice in " + specifier);
                     }
                 }
+            } finally {
+                r.close();
             }
         }
     }

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -16,9 +16,11 @@
  */
 package org.apache.sis.internal.taglet;
 
-import java.util.*;
+import java.util.Map;
+import java.util.StringTokenizer;
 import com.sun.javadoc.Tag;
 import com.sun.tools.doclets.Taglet;
+import org.apache.sis.internal.book.CodeColorizer;
 
 
 /**
@@ -168,24 +170,6 @@ all:    while (tk.hasMoreTokens()) {
     }
 
     /**
-     * Lists of Java keywords.
-     */
-    private static final Set<String> KEYWORDS =
-            Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
-        "abstract", "continue", "for",        "new",        "switch",
-        "assert",   "default",  "goto",       "package",    "synchronized",
-        "boolean",  "do",       "if",         "private",    "this",
-        "break",    "double",   "implements", "protected",  "throw",
-        "byte",     "else",     "import",     "public",     "throws",
-        "case",     "enum",     "instanceof", "return",     "transient",
-        "catch",    "extends",  "int",        "short",      "try",
-        "char",     "final",    "interface",  "static",     "void",
-        "class",    "finally",  "long",       "strictfp",   "volatile",
-        "const",    "float",    "native",     "super",      "while",
-        /* literals: */ "true", "false", "null"
-    )));
-
-    /**
      * Adds syntactic coloration for the given line.
      */
     private static void colorJava(final String line, final StringBuilder buffer) {
@@ -198,7 +182,7 @@ all:    while (tk.hasMoreTokens()) {
                     int j = i;
                     while (++j < length && Character.isJavaIdentifierPart(line.charAt(j)));
                     final String word = line.substring(i, j);
-                    final boolean keyword = KEYWORDS.contains(word);
+                    final boolean keyword = CodeColorizer.JAVA_KEYWORDS.contains(word);
                     i = j-1;
                     boolean function = false;
                     if (!keyword || word.equals("this") || word.equals("super")) {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -1478,21 +1478,6 @@ public class Formatter implements Locali
     }
 
     /**
-     * Removes the unit previously added by a call to {@code addContextualUnit(unit)}.
-     * If the given unit is null, then this method does nothing.
-     *
-     * @param unit The contextual unit to remove, or {@code null} if none.
-     *
-     * @deprecated Replaced by {@link #restoreContextualUnit(Unit, Unit)}.
-     */
-    @Deprecated
-    public void removeContextualUnit(final Unit<?> unit) {
-        if (unit != null) {
-            units.remove(unit.toSI());
-        }
-    }
-
-    /**
      * Returns the unit to use instead than the given one, or {@code unit} if there is no replacement.
      * This method searches for a unit specified by {@link #addContextualUnit(Unit)}
      * which {@linkplain Unit#isCompatible(Unit) is compatible} with the given unit.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -424,6 +424,7 @@ final class GeodeticObjectParser extends
      * @return A properties map with the parent name and the optional authority code.
      * @throws ParseException if an element can not be parsed.
      */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
     private Map<String,Object> parseMetadataAndClose(final Element parent, final String name,
             final IdentifiedObject fallback) throws ParseException
     {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -336,40 +336,6 @@ public class WKTFormat extends CompoundF
     }
 
     /**
-     * Returns whether non-ASCII characters are preserved. The default value is {@code false},
-     * which causes replacements like "é" → "e" in all elements except {@link ElementKind#REMARKS}.
-     *
-     * <p>This value is always {@code true} when the WKT {@linkplain #getConvention() convention}
-     * is set to {@link Convention#INTERNAL}.</p>
-     *
-     * @return Whether non-ASCII characters are preserved.
-     *
-     * @since 0.5
-     *
-     * @deprecated Replaced by {@link #getTransliterator()}.
-     */
-    @Deprecated
-    public boolean isNonAsciiAllowed() {
-        return getTransliterator() == Transliterator.IDENTITY;
-    }
-
-    /**
-     * Sets whether non-ASCII characters shall be preserved. The default value is {@code false},
-     * which causes replacements like "é" → "e" in all elements except {@link ElementKind#REMARKS}.
-     * Setting this property to {@code true} will disable such replacements.
-     *
-     * @param allowed Whether non-ASCII characters shall be preserved.
-     *
-     * @since 0.5
-     *
-     * @deprecated Replaced by {@link #setTransliterator(Transliterator)}.
-     */
-    @Deprecated
-    public void setNonAsciiAllowed(final boolean allowed) {
-        setTransliterator(allowed ? Transliterator.IDENTITY : Transliterator.DEFAULT);
-    }
-
-    /**
      * Returns whether WKT keywords should be written with upper cases or camel cases.
      *
      * @return The case to use for formatting keywords.
@@ -857,20 +823,6 @@ public class WKTFormat extends CompoundF
     }
 
     /**
-     * If a warning occurred during the last WKT {@linkplain #parse(CharSequence, ParsePosition) parsing} or
-     * {@linkplain #format(Object, Appendable) formatting}, returns the warning. Otherwise returns {@code null}.
-     * The warning is cleared every time a new object is parsed or formatted.
-     *
-     * @return The last warning, or {@code null} if none.
-     *
-     * @deprecated Replaced by {@link #getWarnings()}.
-     */
-    @Deprecated
-    public String getWarning() {
-        return (warnings != null) ? warnings.toString() : null;
-    }
-
-    /**
      * Returns a clone of this format.
      *
      * @return A clone of this format.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -17,7 +17,6 @@
 package org.apache.sis.metadata.iso;
 
 import java.util.Collection;
-import java.util.logging.Logger;
 import java.io.Serializable;
 import javax.xml.bind.annotation.XmlID;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -31,10 +30,8 @@ import org.apache.sis.xml.IdentifiedObje
 import org.apache.sis.metadata.MetadataStandard;
 import org.apache.sis.metadata.ModifiableMetadata;
 import org.apache.sis.internal.jaxb.IdentifierMapWithSpecialCases;
-import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.CharSequences;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
@@ -66,17 +63,6 @@ public class ISOMetadata extends Modifia
     private static final long serialVersionUID = -4997239501383133209L;
 
     /**
-     * The logger for warnings emitted by any class in the {@code org.apache.sis.metadata.iso.*} packages.
-     * Warnings are emitted when an action causes the lost of data. For example the {@code "distance"} and
-     * {@code "equivalentScale"} properties in {@link org.apache.sis.metadata.iso.identification.DefaultResolution}
-     * are mutually exclusive: setting one discards the other. In such case, a warning is logged.
-     *
-     * @deprecated Messages related to XML (un)marshalling are now logged to the {@code "org.apache.sis.xml"} logger.
-     */
-    @Deprecated
-    public static final Logger LOGGER = Logging.getLogger(Loggers.ISO_19115);
-
-    /**
      * All identifiers associated with this metadata, or {@code null} if none.
      * This field is initialized to a non-null value when first needed.
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -448,39 +448,6 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Comments on or information about this identifier, or {@code null} if none.
-     *
-     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
-     *
-     * @return Optional comments about this identifier, or {@code null} if none.
-     *
-     * @deprecated Replaced by {@link #getDescription()} for non-deprecated identifiers, or by
-     *             {@link org.apache.sis.util.Deprecable#getRemarks()} for identifiers that may be deprecated.
-     */
-    @Deprecated
-    public InternationalString getRemarks() {
-        return description;
-    }
-
-    /**
-     * Returns {@code true} if the object represented by this identifier is deprecated. In such
-     * case, the {@linkplain #getRemarks() remarks} may contains the new identifier to use.
-     *
-     * <p>The default implementation returns {@code false} in all cases.</p>
-     *
-     * @see org.apache.sis.referencing.AbstractIdentifiedObject#isDeprecated()
-     *
-     * @return {@code true} if this code is deprecated.
-     *
-     * @deprecated Moved to {@link org.apache.sis.util.Deprecable#isDeprecated()} if this
-     *             {@code ImmutableIdentifier} instance implements {@code Deprecable}.
-     */
-    @Deprecated
-    public boolean isDeprecated() {
-        return false;
-    }
-
-    /**
      * Returns a hash code value for this object.
      */
     @Override

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -75,14 +75,6 @@ import static org.apache.sis.internal.ut
  */
 public final class Citations extends Static {
     /**
-     * The <a href="http://www.iso.org/">International Organization for Standardization</a>.
-     *
-     * @deprecated No replacement since ISO is an {@linkplain DefaultOrganisation organisation} rather than a citation.
-     */
-    @Deprecated
-    public static final Citation ISO = new SimpleCitation("ISO");
-
-    /**
      * The <cite>Geographic Information — Metadata</cite> standards defined by ISO 19115.
      * This list contains two standards published by the
      * <a href="http://www.iso.org/">International Organization for Standardization</a>:
@@ -119,16 +111,15 @@ public final class Citations extends Sta
     });
 
     /**
-     * The <a href="http://www.ogp.org.uk">International Association of Oil &amp; Gas Producers</a> organization.
+     * The <a href="http://www.iogp.org">International Association of Oil &amp; Gas producers</a> (IOGP) organization.
      * This organization is responsible for maintainance of {@link #EPSG} database.
      *
-     * @since 0.4
+     * <p>We do not expose this citation in public API because it is an organization rather than a reference
+     * to a document or a database (see SIS-200). However we need it as the authority of {@link #EPSG}.</p>
      *
-     * @deprecated The OGP organization is now known as IOGP. This citation will be removed in SIS 0.7
-     *             because of this name change and for avoiding confusion with {@link #EPSG} citation.
+     * @see <a href="http://issues.apache.org/jira/browse/SIS-200">SIS-200</a>
      */
-    @Deprecated
-    public static final Citation OGP = new SimpleCitation("OGP");
+    static final Citation IOGP = new SimpleCitation("IOGP");
 
     /**
      * The authority for identifiers of objects defined by the
@@ -266,17 +257,6 @@ public final class Citations extends Sta
     public static final IdentifierSpace<String> ESRI = new CitationConstant.Authority<String>("ESRI");
 
     /**
-     * The <a href="http://www.oracle.com">Oracle</a> organization.
-     *
-     * @deprecated No replacement since Oracle is an {@linkplain DefaultOrganisation organisation} rather
-     *             than a citation, and we do not have Oracle-specific objects.
-     *
-     * @since 0.4
-     */
-    @Deprecated
-    public static final Citation ORACLE = new CitationConstant("Oracle");
-
-    /**
      * The authority for identifiers of objects defined by the
      * <a href="http://www.unidata.ucar.edu/software/netcdf-java">NetCDF</a> specification.
      * The {@linkplain IdentifierSpace#getName() name} of this identifier space is fixed to {@code "NetCDF"}.
@@ -424,9 +404,7 @@ public final class Citations extends Sta
         (SimpleCitation) SIS,
         (SimpleCitation) ISO_19115.get(0),
         (SimpleCitation) ISO_19115.get(1),
-        (SimpleCitation) OGP,
-        (SimpleCitation) ISO,
-        (SimpleCitation) ORACLE
+        (SimpleCitation) IOGP
     };
 
     static {  // Must be after CITATIONS array construction.
@@ -476,11 +454,8 @@ public final class Citations extends Sta
                 return citation;
             }
         }
-        /*
-         * Temporary check to be removed after we deleted the deprecated citation.
-         */
-        if (equalsFiltered(identifier, Constants.IOGP)) {
-            return OGP;
+        if (equalsFiltered(identifier, "OGP")) {    // Old name of "IOGP" organization.
+            return IOGP;
         }
         /*
          * If we found no match, org.apache.sis.internal.metadata.ServicesForUtility expects the default citation

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -27,12 +27,10 @@ import org.opengis.metadata.citation.Cit
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.citation.PresentationForm;
 import org.opengis.metadata.citation.Responsibility;
-import org.opengis.metadata.citation.ResponsibleParty;
 import org.opengis.metadata.citation.Series;
 import org.opengis.metadata.identification.BrowseGraphic;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.iso.Types;
-import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.internal.jaxb.NonMarshalledAuthority;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.xml.IdentifierSpace;
@@ -177,36 +175,6 @@ public class DefaultCitation extends ISO
     }
 
     /**
-     * Constructs a citation with the specified responsible party.
-     * This convenience constructor initializes the citation title
-     * to the first non-null of the following properties:
-     * {@linkplain DefaultResponsibleParty#getOrganisationName() organization name},
-     * {@linkplain DefaultResponsibleParty#getPositionName() position name} or
-     * {@linkplain DefaultResponsibleParty#getIndividualName() individual name}.
-     *
-     * @param party The name and position information for an individual or organization that is
-     *              responsible for the resource, or {@code null} if none.
-     *
-     * @deprecated As of ISO 19115:2014, {@link ResponsibleParty} has been replaced by {@link Responsibility}.
-     */
-    @Deprecated
-    public DefaultCitation(final ResponsibleParty party) {
-        if (party != null) {
-            citedResponsibleParties = singleton(party, Responsibility.class);
-            title = party.getOrganisationName();
-            if (title == null) {
-                title = party.getPositionName();
-                if (title == null) {
-                    String name = party.getIndividualName();
-                    if (name != null) {
-                        title = new SimpleInternationalString(name);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
      * Constructs a new instance initialized with the values from the specified metadata object.
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -50,10 +50,9 @@ public final strictfp class CitationsTes
         assertSame(SIS,              fromName(Constants.SIS));
         assertSame(OGC,              fromName(Constants.OGC));   // Success of this test is important for remaining of SIS.
         assertSame(EPSG,             fromName(Constants.EPSG));  // Success of this test is important for remaining of SIS.
-        assertSame(OGP,              fromName(Constants.IOGP));  // TODO: return EPSG after we removed deprecated constant.
-        assertSame(OGP,              fromName("OGP"));           // TODO: return EPSG after we removed deprecated constant.
+        assertSame(IOGP,             fromName(Constants.IOGP));
+        assertSame(IOGP,             fromName("OGP"));
         assertSame(ESRI,             fromName("ESRI"));          // Handled in a way very similar to "OGC".
-        assertSame(ORACLE,           fromName("Oracle"));
         assertSame(NETCDF,           fromName("NetCDF"));
         assertSame(GEOTIFF,          fromName("GeoTIFF"));
         assertSame(PROJ4,            fromName("Proj.4"));
@@ -63,7 +62,6 @@ public final strictfp class CitationsTes
         assertSame(S57,              fromName("S57"));
         assertSame(ISBN,             fromName("ISBN"));
         assertSame(ISSN,             fromName("ISSN"));
-        assertSame(ISO,              fromName("ISO"));
         assertSame(ISO_19115.get(0), fromName("ISO 19115-1"));
         assertSame(ISO_19115.get(1), fromName("ISO 19115-2"));
         /*
@@ -87,9 +85,7 @@ public final strictfp class CitationsTes
         assertEquals("SIS",         getIdentifier(SIS));
         assertEquals("OGC",         getIdentifier(OGC));
         assertEquals("EPSG",        getIdentifier(EPSG));
-        assertEquals("OGP",         getIdentifier(OGP));
         assertEquals("ESRI",        getIdentifier(ESRI));
-        assertEquals("Oracle",      getIdentifier(ORACLE));
         assertEquals("NetCDF",      getIdentifier(NETCDF));
         assertEquals("GeoTIFF",     getIdentifier(GEOTIFF));
         assertEquals("MapInfo",     getIdentifier(MAP_INFO));
@@ -97,7 +93,6 @@ public final strictfp class CitationsTes
         assertEquals("ISSN",        getIdentifier(ISSN));
         assertEquals("Proj.4",      getIdentifier(PROJ4));  // Not a valid Unicode identifier.
         assertEquals("S-57",        getIdentifier(S57));    // Not a valid Unicode identifier.
-        assertEquals("ISO",         getIdentifier(ISO));
         assertEquals("ISO:19115-1", getIdentifier(ISO_19115.get(0)));  // The ':' separator is not usual in ISO references
         assertEquals("ISO:19115-2", getIdentifier(ISO_19115.get(1)));  // and could be changed in future SIS versions.
     }
@@ -112,9 +107,7 @@ public final strictfp class CitationsTes
         assertEquals("SIS",         getUnicodeIdentifier(SIS));
         assertEquals("OGC",         getUnicodeIdentifier(OGC));
         assertEquals("EPSG",        getUnicodeIdentifier(EPSG));
-        assertEquals("OGP",         getUnicodeIdentifier(OGP));
         assertEquals("ESRI",        getUnicodeIdentifier(ESRI));
-        assertEquals("Oracle",      getUnicodeIdentifier(ORACLE));
         assertEquals("NetCDF",      getUnicodeIdentifier(NETCDF));
         assertEquals("GeoTIFF",     getUnicodeIdentifier(GEOTIFF));
         assertEquals("MapInfo",     getUnicodeIdentifier(MAP_INFO));
@@ -122,7 +115,6 @@ public final strictfp class CitationsTes
         assertEquals("ISSN",        getUnicodeIdentifier(ISSN));
         assertNull  ("Proj4",       getUnicodeIdentifier(PROJ4));      // Not yet publicly declared as an identifier.
         assertNull  ("S57",         getUnicodeIdentifier(S57));        // Not yet publicly declared as an identifier.
-        assertEquals("ISO",         getUnicodeIdentifier(ISO));
         assertNull  ("ISO_19115-1", getUnicodeIdentifier(ISO_19115.get(0)));  // Not a valid Unicode identifier.
         assertNull  ("ISO_19115-2", getUnicodeIdentifier(ISO_19115.get(1)));
     }
@@ -137,9 +129,7 @@ public final strictfp class CitationsTes
         assertEquals("SIS",         org.apache.sis.internal.util.Citations.getCodeSpace(SIS));
         assertEquals("OGC",         org.apache.sis.internal.util.Citations.getCodeSpace(OGC));
         assertEquals("EPSG",        org.apache.sis.internal.util.Citations.getCodeSpace(EPSG));
-        assertEquals("OGP",         org.apache.sis.internal.util.Citations.getCodeSpace(OGP));
         assertEquals("ESRI",        org.apache.sis.internal.util.Citations.getCodeSpace(ESRI));
-        assertEquals("Oracle",      org.apache.sis.internal.util.Citations.getCodeSpace(ORACLE));
         assertEquals("NetCDF",      org.apache.sis.internal.util.Citations.getCodeSpace(NETCDF));
         assertEquals("GeoTIFF",     org.apache.sis.internal.util.Citations.getCodeSpace(GEOTIFF));
         assertEquals("MapInfo",     org.apache.sis.internal.util.Citations.getCodeSpace(MAP_INFO));
@@ -147,7 +137,6 @@ public final strictfp class CitationsTes
         assertEquals("ISSN",        org.apache.sis.internal.util.Citations.getCodeSpace(ISSN));
         assertEquals("Proj4",       org.apache.sis.internal.util.Citations.getCodeSpace(PROJ4));
         assertEquals("S57",         org.apache.sis.internal.util.Citations.getCodeSpace(S57));
-        assertEquals("ISO",         org.apache.sis.internal.util.Citations.getCodeSpace(ISO));
         assertNull  ("ISO_19115-1", org.apache.sis.internal.util.Citations.getCodeSpace(ISO_19115.get(0)));
         assertNull  ("ISO_19115-2", org.apache.sis.internal.util.Citations.getCodeSpace(ISO_19115.get(1)));
     }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -18,6 +18,7 @@ package org.apache.sis.referencing;
 
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
+import org.apache.sis.util.Deprecable;
 
 
 /**
@@ -29,7 +30,7 @@ import org.opengis.metadata.citation.Cit
  * @version 0.6
  * @module
  */
-final class DeprecatedName extends NamedIdentifier {
+final class DeprecatedName extends NamedIdentifier implements Deprecable {
     /**
      * For cross-version compatibility.
      */

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -227,7 +227,8 @@ public class DefaultProjectedCRS extends
     @Override
     @XmlElement(name = "baseGeodeticCRS", required = true)  // Note: older GML version used "baseGeographicCRS".
     public GeographicCRS getBaseCRS() {
-        return super.getConversionFromBase().getSourceCRS();
+        final Projection projection = super.getConversionFromBase();
+        return (projection != null) ? projection.getSourceCRS() : null;
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -28,10 +28,12 @@ import org.opengis.util.InternationalStr
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.operation.Formula;
+import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.Projection;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.SingleOperation;
+import org.opengis.referencing.crs.GeneralDerivedCRS;
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.ParameterDescriptor;
@@ -39,6 +41,7 @@ import org.apache.sis.util.Utilities;
 import org.apache.sis.util.Workaround;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.internal.util.Citations;
 import org.apache.sis.internal.metadata.WKTKeywords;
@@ -52,6 +55,8 @@ import org.apache.sis.referencing.NamedI
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.io.wkt.ElementKind;
+import org.apache.sis.io.wkt.FormattableObject;
 
 import static org.apache.sis.util.ArgumentChecks.*;
 
@@ -679,8 +684,52 @@ public class DefaultOperationMethod exte
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        super.formatTo(formatter);
-        if (formatter.getConvention().majorVersion() == 1) {
+        final boolean isWKT1 = formatter.getConvention().majorVersion() == 1;
+        /*
+         * The next few lines below are basically a copy of the work done by super.formatTo(formatter),
+         * which search for the name to write inside METHOD["name"]. The difference is in the fallback
+         * executed if we do not find a name for the given authority.
+         */
+        final Citation authority = formatter.getNameAuthority();
+        String name = IdentifiedObjects.getName(this, authority);
+        ElementKind kind = ElementKind.METHOD;
+        if (name == null) {
+            /*
+             * No name found for the given authority. We may use the primary name as a fallback.
+             * But before doing that, maybe we can find the name that we are looking for in the
+             * hard-coded values in the 'org.apache.sis.internal.referencing.provider' package.
+             * The typical use case is when this DefaultOperationMethod has been instantiated
+             * by the EPSG factory using only the information found in the EPSG database.
+             *
+             * We can find the hard-coded names by looking at the ParameterDescriptorGroup of the
+             * enclosing ProjectedCRS or DerivedCRS. This is because that parameter descriptor was
+             * typically provided by the 'org.apache.sis.internal.referencing.provider' package in
+             * order to create the MathTransform associated with the enclosing CRS.  The enclosing
+             * CRS is either the immediate parent in WKT 1, or the parent of the parent in WKT 2.
+             */
+            final FormattableObject parent = formatter.getEnclosingElement(isWKT1 ? 1 : 2);
+            if (parent instanceof GeneralDerivedCRS) {
+                final Conversion conversion = ((GeneralDerivedCRS) parent).getConversionFromBase();
+                if (conversion != null) {   // Should never be null, but let be safe.
+                    final ParameterDescriptorGroup descriptor;
+                    if (conversion instanceof Parameterized) {  // Usual case in SIS implementation.
+                        descriptor = ((Parameterized) conversion).getParameterDescriptors();
+                    } else {
+                        descriptor = conversion.getParameterValues().getDescriptor();
+                    }
+                    name = IdentifiedObjects.getName(descriptor, authority);
+                }
+            }
+            if (name == null) {
+                name = IdentifiedObjects.getName(this, null);
+                if (name == null) {
+                    name = Vocabulary.getResources(formatter.getLocale()).getString(Vocabulary.Keys.Unnamed);
+                    kind = ElementKind.NAME;  // Because the "Unnamed" string is not a real OperationMethod name.
+                }
+            }
+        }
+        formatter.append(name, kind);
+        if (isWKT1) {
             /*
              * The WKT 1 keyword is "PROJECTION", which imply that the operation method should be of type
              * org.opengis.referencing.operation.Projection. So strictly speaking only the first check in

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -36,7 +36,7 @@
  * More on this convention is explained below.</p>
  *
  * <p>Users wanting to know more about the available projections and their parameters should look at the
- * <a href="http://sis.apache.org/content/CoordinateOperationMethods.html">list of coordinate operation methods</a>.
+ * <a href="http://sis.apache.org/book/tables/CoordinateOperationMethods.html">list of coordinate operation methods</a>.
  * Only users interested in the <em>implementation</em> of those projections should look at this package.</p>
  *
  *

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -84,7 +84,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * <div class="section">Standard parameters</div>
  * {@code MathTransform} instances are created from {@linkplain org.apache.sis.parameter.DefaultParameterValueGroup
  * parameter values}. The parameters expected by each operation available in a default Apache SIS installation is
- * <a href="http://sis.apache.org/content/CoordinateOperationMethods.html">listed here</a>.
+ * <a href="http://sis.apache.org/book/tables/CoordinateOperationMethods.html">listed here</a>.
  * The set of parameters varies for each operation or projection, but the following can be considered typical:
  *
  * <ul>

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -54,7 +54,7 @@ import org.apache.sis.internal.jdk8.JDK8
 
 /**
  * Generates a list of projection parameters in a HTML page. This class is used for updating the
- * <a href="http://sis.apache.org/content/CoordinateOperationMethods.html">CoordinateOperationMethods.html</a> page.
+ * <a href="http://sis.apache.org/book/tables/CoordinateOperationMethods.html">CoordinateOperationMethods.html</a> page.
  * The {@linkplain #main(String[])} method creates the "{@code CoordinateOperationMethods.html}" file in the current
  * default directory if it does not already exists. Users is responsible for moving the generated file to the Apache
  * SIS {@code "content/"} site directory.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -81,7 +81,7 @@ public final strictfp class NamedIdentif
         // ImmutableIdentifier properties
         assertEquals("code",      "4326", identifier.getCode());
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
-        assertEquals("authority", "OGP",  Citations.getIdentifier(identifier.getAuthority()));  // May change after resolution of SIS-200.
+        assertEquals("authority", "IOGP", Citations.getIdentifier(identifier.getAuthority()));
         assertNull  ("version",           identifier.getVersion());
         assertNull  ("description",       identifier.getDescription());
 

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -101,10 +101,19 @@ public class NumberRange<E extends Numbe
     private static final WeakHashSet<NumberRange<?>> POOL = new WeakHashSet<NumberRange<?>>((Class) NumberRange.class);
 
     /**
-     * Returns a unique instance of the given range.
+     * Returns a unique instance of the given range, except if the range is empty.
+     *
+     * <div class="note"><b>Rational:</b>
+     * we exclude empty ranges because the {@link Range#equals(Object)} consider them as equal.
+     * Consequently if empty ranges were included in the pool, this method would return in some
+     * occasions an empty range with different values than the given {@code range} argument.
+     * </div>
      */
-    static <E extends Number & Comparable<? super E>, T extends NumberRange<E>> T unique(final T range) {
-        return POOL.unique(range);
+    static <E extends Number & Comparable<? super E>, T extends NumberRange<E>> T unique(T range) {
+        if (!range.isEmpty()) {
+            range = POOL.unique(range);
+        }
+        return range;
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -277,7 +277,7 @@ public class Range<E extends Comparable<
     @Override
     public final boolean isEmpty() {
         if (minValue == null || maxValue == null) {
-            return false; // Unbounded: can't be empty.
+            return false; // Unbounded: can not be empty.
         }
         final int c = minValue.compareTo(maxValue);
         if (c < 0) {
@@ -561,6 +561,15 @@ public class Range<E extends Comparable<
 
     /**
      * Compares this range with the given object for equality.
+     * Two ranges are considered equal if they have the same {@link #getElementType() element type} and:
+     *
+     * <ul>
+     *   <li>are both {@linkplain #isEmpty() empty}, or</li>
+     *   <li>have equal {@linkplain #getMinValue() minimum} and {@linkplain #getMaxValue() maximum} values
+     *       with equal inclusive/exclusive flags.</li>
+     * </ul>
+     *
+     * Note that subclasses may add other requirements, for example on units of measurement.
      *
      * @param  object The object to compare with this range for equality.
      * @return {@code true} if the given object is equal to this range.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -261,6 +261,7 @@ abstract class TreeNodeList extends Abst
      */
     @Override
     protected void removeRange(final int lower, final int upper) throws IllegalArgumentException {
+        ArgumentChecks.ensureValidIndexRange(size, lower, upper);
         int i = upper;
         try {
             while (i != lower) {
@@ -269,8 +270,10 @@ abstract class TreeNodeList extends Abst
             }
         } finally {
             modCount++;
-            System.arraycopy(children, upper, children, i, size - upper);
-            Arrays.fill(children, upper, size, null);
+            if (children != null) {
+                System.arraycopy(children, upper, children, i, size - upper);
+                Arrays.fill(children, upper, size, null);
+            }
             size -= (upper - i);
         }
     }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -28,8 +28,8 @@ import org.apache.sis.util.Classes;
 
 
 /**
- * A set of utilities method for configuring loggings in SIS. Library implementors shall fetch
- * their loggers using the {@link #getLogger(Class)} static method defined in this {@code Logging}
+ * A set of utilities method for configuring loggings in SIS. Library implementors should fetch
+ * their loggers using the {@link #getLogger(String)} static method defined in this {@code Logging}
  * class rather than the one defined in the standard {@link Logger} class, in order to give SIS a
  * chance to redirect the logs to an other framework like
  * <a href="http://commons.apache.org/logging/">Commons-logging</a> or
@@ -41,13 +41,13 @@ import org.apache.sis.util.Classes;
  *       the logger name}, {@linkplain LogRecord#setSourceClassName(String) source class name} and
  *       {@linkplain LogRecord#setSourceMethodName(String) source method name} of the given record
  *       before to log it.</li>
- *   <li>{@link #unexpectedException(Class, String, Throwable)} for reporting an anomalous but
+ *   <li>{@link #unexpectedException(Logger, Class, String, Throwable)} for reporting an anomalous but
  *       nevertheless non-fatal exception.</li>
  * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.6
  * @module
  */
 public final class Logging extends Static {
@@ -134,12 +134,12 @@ public final class Logging extends Stati
     }
 
     /**
-     * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory} has
-     * been set, then this method first {@linkplain LoggerFactory#getLogger asks to the factory}.
+     * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory} has been set,
+     * then this method first {@linkplain LoggerFactory#getLogger(String) asks to the factory}.
      * This rule gives SIS a chance to redirect logging events to
      * <a href="http://commons.apache.org/logging/">commons-logging</a> or some equivalent framework.
      * Only if no factory was found or if the factory choose to not redirect the loggings, then this
-     * method delegate to <code>{@linkplain Logger#getLogger Logger.getLogger}(name)</code>.
+     * method delegate to <code>{@linkplain Logger#getLogger(String) Logger.getLogger}(name)</code>.
      *
      * @param  name The logger name.
      * @return A logger for the specified name.
@@ -161,11 +161,8 @@ public final class Logging extends Stati
      *
      * @param  classe The class for which to obtain a logger.
      * @return A logger for the specified class.
-     *
-     * @deprecated Use {@link #getLogger(String)}, because the class name is sometime too close to implementation details.
      */
-    @Deprecated   // Make package-private (do not delete) after we removed from public API.
-    public static Logger getLogger(Class<?> classe) {
+    static Logger getLogger(Class<?> classe) {
         Class<?> outer;
         while ((outer = classe.getEnclosingClass()) != null) {
             classe = outer;
@@ -211,34 +208,30 @@ public final class Logging extends Stati
     }
 
     /**
-     * Invoked when an unexpected error occurs. This method logs a message at {@link Level#WARNING} to the
+     * Invoked when an unexpected error occurred. This method logs a message at {@link Level#WARNING} to the
      * specified logger. The originating class name and method name are inferred from the error stack trace,
      * using the first {@linkplain StackTraceElement stack trace element} for which the class name is inside
      * a package or sub-package of the logger name.
      *
-     * <div class="note"><b>Example:</b>
-     * if the logger name is {@code "org.apache.sis.image"}, then this method will uses the first stack
-     * trace element where the fully qualified class name starts with {@code "org.apache.sis.image"} or
-     * {@code "org.apache.sis.image.io"}, but not {@code "org.apache.sis.imageio"}.</div>
+     * @param  logger Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param  error  The error that occurred, or {@code null} if none.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at {@link Level#WARNING}.
      *
-     * @param  logger Where to log the error.
-     * @param  error  The error that occurred.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         does not log anything at {@link Level#WARNING}.
+     * @deprecated Use {@link #unexpectedException(Logger, Class, String, Throwable)} instead.
      */
+    @Deprecated
     public static boolean unexpectedException(final Logger logger, final Throwable error) {
         return unexpectedException(logger, null, null, error, Level.WARNING);
     }
 
     /**
-     * Invoked when an unexpected error occurs. This method logs a message at {@link Level#WARNING}
+     * Invoked when an unexpected error occurred. This method logs a message at {@link Level#WARNING}
      * to the specified logger. The originating class name and method name can optionally be specified.
-     * If any of them is {@code null}, then it will be inferred from the error stack trace as in
-     * {@link #unexpectedException(Logger, Throwable)}.
-     *
-     * <p>Explicit value for class and method names are sometime preferred to automatic
-     * inference for the following reasons:</p>
+     * If any of them is {@code null}, then it will be inferred from the error stack trace as described below.
      *
+     * <div class="note"><b>Recommended usage:</b>
+     * explicit value for class and method names are preferred to automatic inference for the following reasons:
      * <ul>
      *   <li>Automatic inference is not 100% reliable, since the Java Virtual Machine
      *       is free to omit stack frame in optimized code.</li>
@@ -247,14 +240,23 @@ public final class Logging extends Stati
      *       since the user is not expected to know anything about the existence of the
      *       private method. If a developer really want to know about the private method,
      *       the stack trace is still available anyway.</li>
-     * </ul>
+     * </ul></div>
      *
-     * @param logger  Where to log the error.
-     * @param classe  The class where the error occurred, or {@code null}.
-     * @param method  The method where the error occurred, or {@code null}.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         does not log anything at {@link Level#WARNING}.
+     * If the {@code classe} or {@code method} arguments are null, then the originating class name and method name
+     * are inferred from the given {@code error} using the first {@linkplain StackTraceElement stack trace element}
+     * for which the class name is inside a package or sub-package of the same name than the logger name.
+     *
+     * <div class="note"><b>Example:</b>
+     * if the logger name is {@code "org.apache.sis.image"}, then this method will uses the first stack
+     * trace element where the fully qualified class name starts with {@code "org.apache.sis.image"} or
+     * {@code "org.apache.sis.image.io"}, but not {@code "org.apache.sis.imageio"}.</div>
+     *
+     * @param logger  Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param classe  The class where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param method  The method where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param error   The error, or {@code null} if none.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at {@link Level#WARNING}.
      *
      * @see #recoverableException(Logger, Class, String, Throwable)
      * @see #severeException(Logger, Class, String, Throwable)
@@ -267,35 +269,15 @@ public final class Logging extends Stati
     }
 
     /**
-     * Invoked when an unexpected error occurs. This method logs a message at the
-     * {@link Level#WARNING WARNING} level to a logger inferred from the given class.
-     *
-     * @param classe  The class where the error occurred.
-     * @param method  The method where the error occurred, or {@code null}.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         doesn't log anything at {@link Level#WARNING}.
-     *
-     * @see #recoverableException(Class, String, Throwable)
-     *
-     * @deprecated A logger should be specified explicitely with
-     * {@link #unexpectedException(Logger, Class, String, Throwable)}.
-     */
-    @Deprecated
-    public static boolean unexpectedException(Class<?> classe, String method, Throwable error) {
-        return unexpectedException((Logger) null, classe, method, error);
-    }
-
-    /**
      * Implementation of {@link #unexpectedException(Logger, Class, String, Throwable)}.
      *
-     * @param logger  Where to log the error, or {@code null}.
-     * @param classe  The fully qualified class name where the error occurred, or {@code null}.
-     * @param method  The method where the error occurred, or {@code null}.
-     * @param error   The error.
+     * @param logger  Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param classe  The fully qualified class name where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param method  The method where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param error   The error, or {@code null} if none.
      * @param level   The logging level.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         doesn't log anything at the specified level.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at the specified level.
      */
     private static boolean unexpectedException(Logger logger, String classe, String method,
                                                final Throwable error, final Level level)
@@ -317,7 +299,7 @@ public final class Logging extends Stati
         /*
          * Loggeable, so complete the null argument from the stack trace if we can.
          */
-        if (logger==null || classe==null || method==null) {
+        if (logger == null || classe == null || method == null) {
             String paquet = (logger != null) ? logger.getName() : null;
             for (final StackTraceElement element : error.getStackTrace()) {
                 /*
@@ -421,14 +403,14 @@ public final class Logging extends Stati
      * {@code jre/lib/logging.properties} file is illegal, then {@link MonolineFormatter} will log
      * this problem and use a default time pattern.</div>
      *
-     * @param logger  Where to log the error.
-     * @param classe  The class where the error occurred.
-     * @param method  The method name where the error occurred.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         doesn't log anything at {@link Level#CONFIG}.
+     * @param logger  Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param classe  The class where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param method  The method name where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param error   The error, or {@code null} if none.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at {@link Level#CONFIG}.
      *
-     * @see #unexpectedException(Class, String, Throwable)
+     * @see #unexpectedException(Logger, Class, String, Throwable)
      */
     static boolean configurationException(final Logger logger, final Class<?> classe, final String method, final Throwable error) {
         final String classname = (classe != null) ? classe.getName() : null;
@@ -436,37 +418,16 @@ public final class Logging extends Stati
     }
 
     /**
-     * Invoked when a recoverable error occurs. This method is similar to
-     * {@link #unexpectedException(Class,String,Throwable) unexpectedException}
-     * except that it doesn't log the stack trace and uses a lower logging level.
-     *
-     * @param classe  The class where the error occurred.
-     * @param method  The method name where the error occurred.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         doesn't log anything at {@link Level#FINE}.
-     *
-     * @see #unexpectedException(Class, String, Throwable)
-     *
-     * @deprecated A logger should be specified explicitely with
-     * {@link #recoverableException(Logger, Class, String, Throwable)}.
-     */
-    @Deprecated
-    public static boolean recoverableException(final Class<?> classe, final String method, final Throwable error) {
-        return recoverableException(null, classe, method, error);
-    }
-
-    /**
-     * Invoked when a recoverable error occurs. This method is similar to
+     * Invoked when a recoverable error occurred. This method is similar to
      * {@link #unexpectedException(Logger,Class,String,Throwable) unexpectedException(…)}
      * except that it does not log the stack trace and uses a lower logging level.
      *
-     * @param logger  Where to log the error.
-     * @param classe  The class where the error occurred.
-     * @param method  The method name where the error occurred.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         does not log anything at {@link Level#FINE}.
+     * @param logger  Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param classe  The class where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param method  The method name where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param error   The error, or {@code null} if none.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at {@link Level#FINE}.
      *
      * @see #unexpectedException(Logger, Class, String, Throwable)
      * @see #severeException(Logger, Class, String, Throwable)
@@ -479,16 +440,16 @@ public final class Logging extends Stati
     }
 
     /**
-     * Invoked when a severe error occurs. This method is similar to
+     * Invoked when a severe error occurred. This method is similar to
      * {@link #unexpectedException(Logger,Class,String,Throwable) unexpectedException}
      * except that it logs the message at the {@link Level#SEVERE SEVERE} level.
      *
-     * @param logger  Where to log the error.
-     * @param classe  The class where the error occurred.
-     * @param method  The method name where the error occurred.
-     * @param error   The error.
-     * @return {@code true} if the error has been logged, or {@code false} if the logger
-     *         doesn't log anything at {@link Level#SEVERE}.
+     * @param logger  Where to log the error, or {@code null} for inferring a default value from other arguments.
+     * @param classe  The class where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param method  The method name where the error occurred, or {@code null} for inferring a default value from other arguments.
+     * @param error   The error, or {@code null} if none.
+     * @return {@code true} if the error has been logged, or {@code false} if the given {@code error}
+     *         was null or if the logger does not log anything at {@link Level#SEVERE}.
      *
      * @see #unexpectedException(Logger, Class, String, Throwable)
      * @see #recoverableException(Logger, Class, String, Throwable)

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java?rev=1706801&r1=1706800&r2=1706801&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java [UTF-8] Mon Oct  5 11:11:11 2015
@@ -27,7 +27,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.6
  * @module
  */
 public final strictfp class AssertTest extends TestCase {
@@ -58,7 +58,7 @@ public final strictfp class AssertTest e
      * Tests the {@link Assert#assertSerializedEquals(Object)} method.
      */
     @Test
-    public void testSerialize() {
+    public void testAssertSerializedEquals() {
         final String local = "Le silence éternel de ces espaces infinis m'effraie";
         assertNotSame(local, assertSerializedEquals(local));
     }



Mime
View raw message