cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject cayenne git commit: using randomUUID() instead of hashCode() in DefaultListBuilder
Date Thu, 26 Nov 2015 16:07:18 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 9cee90a27 -> fcc9d922d


using randomUUID() instead of hashCode() in DefaultListBuilder


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/fcc9d922
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/fcc9d922
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/fcc9d922

Branch: refs/heads/master
Commit: fcc9d922da006365557d03325a2259d24acafd45
Parents: 9cee90a
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Thu Nov 26 19:06:32 2015 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Thu Nov 26 19:06:32 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/fcc9d922/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java
index eb9654f..fcf6a28 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultListBuilder.java
@@ -29,6 +29,7 @@ import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * @since 3.1
@@ -79,7 +80,7 @@ class DefaultListBuilder<T> implements ListBuilder<T> {
         Provider<T> provider0 = new InstanceProvider<T>(object);
         Provider<T> provider1 = new FieldInjectingProvider<T>(provider0, injector);
 
-        getListProvider().add(Key.get(object.getClass(), String.valueOf(object.hashCode())),
provider1);
+        getListProvider().add(Key.get(object.getClass(), UUID.randomUUID().toString()), provider1);
         return this;
     }
 
@@ -123,7 +124,7 @@ class DefaultListBuilder<T> implements ListBuilder<T> {
             Provider<T> provider0 = new InstanceProvider<T>(object);
             Provider<T> provider1 = new FieldInjectingProvider<T>(provider0,
injector);
 
-            keyProviderMap.put(Key.get(object.getClass(), String.valueOf(object.hashCode())),
provider1);
+            keyProviderMap.put(Key.get(object.getClass(), UUID.randomUUID().toString()),
provider1);
         }
 
         getListProvider().addAll(keyProviderMap);


Mime
View raw message