sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1394424 - in /sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis: internal/util/Objects.java internal/util/package-info.java util/collection/WeakValueHashMap.java
Date Fri, 05 Oct 2012 09:53:36 GMT
Author: desruisseaux
Date: Fri Oct  5 09:53:35 2012
New Revision: 1394424

URL: http://svn.apache.org/viewvc?rev=1394424&view=rev
Log:
Minor documentation formatting and renaming of private methods.

Modified:
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java?rev=1394424&r1=1394423&r2=1394424&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
(original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
Fri Oct  5 09:53:35 2012
@@ -23,7 +23,7 @@ import java.util.Arrays;
  * Place holder for {@link java.util.Objects}. This class will be deleted when we will be
allowed
  * to compile for JDK7.
  *
- * @author Martin Desruisseaux (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from GeoAPI)
  * @version 0.3
  * @module

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java?rev=1394424&r1=1394423&r2=1394424&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
(original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
Fri Oct  5 09:53:35 2012
@@ -23,7 +23,7 @@
  * This package is for internal use by SIS only. Classes in this package
  * may change in incompatible ways in any future version without notice.
  *
- * @author Martin Desruisseaux (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.0)
  * @version 0.3
  * @module

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java?rev=1394424&r1=1394423&r2=1394424&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
(original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
Fri Oct  5 09:53:35 2012
@@ -149,7 +149,7 @@ public class WeakValueHashMap<K,V> exten
         public boolean equals(final Object other) {
             if (other instanceof Map.Entry<?,?>) {
                 final Map.Entry<?,?> that = (Map.Entry<?,?>) other;
-                return equal(key, that.getKey()) && Objects.equals(get(), that.getValue());
+                return keyEquals(key, that.getKey()) && Objects.equals(get(), that.getValue());
             }
             return false;
         }
@@ -160,7 +160,7 @@ public class WeakValueHashMap<K,V> exten
          */
         @Override
         public int hashCode() {
-            int code = hash(key);
+            int code = keyHashCode(key);
             final V val = get();
             if (val != null) {
                 code ^= val.hashCode();
@@ -279,14 +279,14 @@ public class WeakValueHashMap<K,V> exten
     /**
      * Returns the hash code value for the given key.
      */
-    final int hash(final Object key) {
+    final int keyHashCode(final Object key) {
         return mayContainArrays ? Utilities.deepHashCode(key) : key.hashCode();
     }
 
     /**
      * Returns {@code true} if the two given keys are equal.
      */
-    final boolean equal(final Object k1, final Object k2) {
+    final boolean keyEquals(final Object k1, final Object k2) {
         return mayContainArrays ? Objects.deepEquals(k1, k2) : k1.equals(k2);
     }
 
@@ -328,9 +328,9 @@ public class WeakValueHashMap<K,V> exten
         assert isValid();
         if (key != null) {
             final Entry[] table = this.table;
-            final int index = (hash(key) & HASH_MASK) % table.length;
+            final int index = (keyHashCode(key) & HASH_MASK) % table.length;
             for (Entry e = table[index]; e != null; e = (Entry) e.next) {
-                if (equal(key, e.key)) {
+                if (keyEquals(key, e.key)) {
                     return e.get();
                 }
             }
@@ -349,10 +349,10 @@ public class WeakValueHashMap<K,V> exten
          */
         V oldValue = null;
         Entry[] table = this.table;
-        final int hash = hash(key) & HASH_MASK;
+        final int hash = keyHashCode(key) & HASH_MASK;
         int index = hash % table.length;
         for (Entry e = table[index]; e != null; e = (Entry) e.next) {
-            if (equal(key, e.key)) {
+            if (keyEquals(key, e.key)) {
                 oldValue = e.get();
                 e.dispose();
                 table = this.table; // May have changed.



Mime
View raw message