Repository: marmotta Updated Branches: refs/heads/develop ac0efc859 -> 85e5ff3f5
safe guards for cache collisions Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/85e5ff3f Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/85e5ff3f Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/85e5ff3f Branch: refs/heads/develop Commit: 85e5ff3f5262e4502030c3bfc351bd917bb82c49 Parents: ac0efc8 Author: Sebastian Schaffert <[email protected]> Authored: Wed Oct 22 12:49:29 2014 +0200 Committer: Sebastian Schaffert <[email protected]> Committed: Wed Oct 22 12:49:29 2014 +0200 ---------------------------------------------------------------------- .../org/apache/marmotta/kiwi/persistence/KiWiConnection.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/85e5ff3f/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 135d8c3..3a0ec53 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 @@ -732,7 +732,7 @@ public class KiWiConnection implements AutoCloseable { public KiWiDateLiteral loadLiteral(Date date) throws SQLException { // look in cache KiWiLiteral element = literalCache.get(LiteralCommons.createCacheKey(DateUtils.getDateWithoutFraction(date),Namespaces.NS_XSD + "dateTime")); - if(element != null) { + if(element != null && element instanceof KiWiDateLiteral) { return (KiWiDateLiteral)element; } @@ -786,7 +786,7 @@ public class KiWiConnection implements AutoCloseable { public KiWiIntLiteral loadLiteral(long value) throws SQLException { // look in cache KiWiLiteral element = literalCache.get(LiteralCommons.createCacheKey(Long.toString(value),(String)null,Namespaces.NS_XSD + "integer")); - if(element != null) { + if(element != null && element instanceof KiWiIntLiteral) { return (KiWiIntLiteral)element; } @@ -841,7 +841,7 @@ public class KiWiConnection implements AutoCloseable { public KiWiDoubleLiteral loadLiteral(double value) throws SQLException { // look in cache KiWiLiteral element = literalCache.get(LiteralCommons.createCacheKey(Double.toString(value),(String)null,Namespaces.NS_XSD + "double")); - if(element != null) { + if(element != null && element instanceof KiWiDoubleLiteral) { return (KiWiDoubleLiteral)element; }
