Updated Branches: refs/heads/maintenance-3.1.x 6fa1c4fed -> bfaf09d34
backport for MARMOTTA-401 (better hashcodes for literals) (cherry picked from commit 0596fa600d4cfc16a15dc7ebe2a1f97ebf7dffb1) Signed-off-by: Jakob Frank <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/73384681 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/73384681 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/73384681 Branch: refs/heads/maintenance-3.1.x Commit: 73384681cdaab53b82560c347c68586c7605998d Parents: 6fa1c4f Author: Sebastian Schaffert <[email protected]> Authored: Tue Dec 10 17:31:22 2013 +0100 Committer: Jakob Frank <[email protected]> Committed: Wed Dec 11 11:29:42 2013 +0100 ---------------------------------------------------------------------- .../java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/73384681/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java index e96220e..5371eef 100644 --- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java +++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java @@ -161,12 +161,12 @@ public abstract class KiWiLiteral extends KiWiNode implements Literal { return false; } - - - @Override public int hashCode() { - return this.getLabel().hashCode(); + int result = locale != null ? locale.hashCode() : 0; + result = 31 * result + (type != null ? type.hashCode() : 0); + result = 32 * result + this.getLabel().hashCode(); + return result; }
