marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject git commit: reduce probability of hash code clashes
Date Wed, 22 Oct 2014 09:42:19 GMT
Repository: marmotta
Updated Branches:
  refs/heads/develop ec317f293 -> b91cfb8c2


reduce probability of hash code clashes


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

Branch: refs/heads/develop
Commit: b91cfb8c2a0283254ff7de9918cfaefa5c578bf4
Parents: ec317f2
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Wed Oct 22 11:42:45 2014 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Wed Oct 22 11:42:45 2014 +0200

----------------------------------------------------------------------
 .../org/apache/marmotta/commons/sesame/model/LiteralCommons.java   | 2 +-
 .../java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b91cfb8c/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
index 9ccf335..3eee735 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
@@ -104,7 +104,7 @@ public class LiteralCommons {
      * @return a 64bit hash key for the literal
      */
     public static String createCacheKey(Literal l) {
-        Hasher hasher = Hashing.goodFastHash(64).newHasher();
+        Hasher hasher = Hashing.goodFastHash(128).newHasher();
         hasher.putString(l.getLabel(), Charset.defaultCharset());
         if(l.getDatatype() != null) {
             hasher.putString(l.getDatatype().stringValue(), Charset.defaultCharset());

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b91cfb8c/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
index 2c68a78..59e0f96 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
@@ -895,7 +895,7 @@ public class KiWiConnection implements AutoCloseable {
     public KiWiBooleanLiteral loadLiteral(boolean value) throws SQLException {
         // look in cache
         KiWiLiteral element = literalCache.get(LiteralCommons.createCacheKey(Boolean.toString(value),null,Namespaces.NS_XSD
+ "boolean"));
-        if(element != null) {
+        if(element != null && element instanceof KiWiBooleanLiteral) {
             return (KiWiBooleanLiteral)element;
         }
 


Mime
View raw message