sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1657950 - in /sis/branches/JDK8/core: sis-referencing/src/main/java/org/apache/sis/referencing/ sis-utility/src/main/java/org/apache/sis/internal/system/
Date Fri, 06 Feb 2015 20:25:36 GMT
Author: desruisseaux
Date: Fri Feb  6 20:25:35 2015
New Revision: 1657950

URL: http://svn.apache.org/r1657950
Log:
Javadoc, consistency in the way to access AbstractIdentifiedObject members, and parameter
renaming for clarity.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1657950&r1=1657949&r2=1657950&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] Fri Feb  6 20:25:35 2015
@@ -768,7 +768,7 @@ public class AbstractIdentifiedObject ex
      * @see IdentifiedObjects#isHeuristicMatchForName(IdentifiedObject, String)
      */
     public boolean isHeuristicMatchForName(final String name) {
-        return IdentifiedObjects.isHeuristicMatchForName(this, alias, name);
+        return IdentifiedObjects.isHeuristicMatchForName(this.name, alias, name);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1657950&r1=1657949&r2=1657950&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] Fri Feb  6 20:25:35 2015
@@ -392,31 +392,30 @@ public final class IdentifiedObjects ext
             return ((AbstractIdentifiedObject) object).isHeuristicMatchForName(name);
         } else {
             ensureNonNull("object", object);
-            return isHeuristicMatchForName(object, object.getAlias(), name);
+            return isHeuristicMatchForName(object.getName(), object.getAlias(), name);
         }
     }
 
     /**
-     * Returns {@code true} if the {@linkplain AbstractIdentifiedObject#getName() primary
name} of the given object
-     * or one of the given alias matches the given name. The comparison ignores case, some
Latin diacritical signs
+     * Returns {@code true} if the given {@linkplain AbstractIdentifiedObject#getName() primary
name} or one
+     * of the given aliases matches the given name. The comparison ignores case, some Latin
diacritical signs
      * and any characters that are not letters or digits.
      *
-     * @param  object  The object to check.
-     * @param  aliases The list of alias in {@code object} (may be {@code null}).
-     *                 This method will never modify this list. Consequently, the
-     *                 given list can be a direct reference to an internal list.
-     * @param  name    The name for which to check for equality.
+     * @param  name     The name of the {@code IdentifiedObject} to check.
+     * @param  aliases  The list of alias in the {@code IdentifiedObject} (may be {@code
null}).
+     *                  This method will never modify this list. Consequently, the
+     *                  given list can be a direct reference to an internal list.
+     * @param  toSearch The name for which to check for equality.
      * @return {@code true} if the primary name or at least one alias matches the given {@code
name}.
      */
-    static boolean isHeuristicMatchForName(final IdentifiedObject object, final Collection<GenericName>
aliases,
-            CharSequence name)
+    static boolean isHeuristicMatchForName(final Identifier name, final Collection<GenericName>
aliases,
+            CharSequence toSearch)
     {
-        name = CharSequences.toASCII(name);
-        final Identifier id = object.getName();
-        if (id != null) { // Paranoiac check.
-            final CharSequence code = CharSequences.toASCII(id.getCode());
+        toSearch = CharSequences.toASCII(toSearch);
+        if (name != null) { // Paranoiac check.
+            final CharSequence code = CharSequences.toASCII(name.getCode());
             if (code != null) { // Paranoiac check.
-                if (CharSequences.equalsFiltered(name, code, LETTERS_AND_DIGITS, true)) {
+                if (CharSequences.equalsFiltered(toSearch, code, LETTERS_AND_DIGITS, true))
{
                     return true;
                 }
             }
@@ -425,7 +424,7 @@ public final class IdentifiedObjects ext
             for (final GenericName alias : aliases) {
                 if (alias != null) { // Paranoiac check.
                     final CharSequence tip = CharSequences.toASCII(alias.tip().toString());
-                    if (CharSequences.equalsFiltered(name, tip, LETTERS_AND_DIGITS, true))
{
+                    if (CharSequences.equalsFiltered(toSearch, tip, LETTERS_AND_DIGITS, true))
{
                         return true;
                     }
                     /*

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java?rev=1657950&r1=1657949&r2=1657950&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java
[UTF-8] Fri Feb  6 20:25:35 2015
@@ -190,6 +190,8 @@ public final class DelayedExecutor exten
      * Returns {@code true} if this thread seems to be stalled. This method checks the head
      * of the queue. If the delay for that head has expired and the head is not removed in
      * the next 5 seconds, then we will presume that the thread is stalled or dead.
+     *
+     * @return {@inheritDoc}
      */
     @Override
     protected boolean isStalled() {



Mime
View raw message