Need to force lexical form into existence in .equals(). Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/7cf034e5 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/7cf034e5 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/7cf034e5
Branch: refs/heads/hadoop-rdf Commit: 7cf034e58c31c5dd0df784effef81d782ec2f1a5 Parents: 0fd37f5 Author: Andy Seaborne <[email protected]> Authored: Sat Nov 22 15:53:36 2014 +0000 Committer: Andy Seaborne <[email protected]> Committed: Sat Nov 22 15:53:36 2014 +0000 ---------------------------------------------------------------------- .../com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/7cf034e5/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java ---------------------------------------------------------------------- diff --git a/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java b/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java index 50a3979..97d6015 100644 --- a/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java +++ b/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/LiteralLabelImpl.java @@ -361,16 +361,17 @@ final /*public*/ class LiteralLabelImpl implements LiteralLabel { } LiteralLabel otherLiteral = (LiteralLabel) other; - boolean typeEqual = Objects.equals(dtype, otherLiteral.getDatatype()) ; - if ( !typeEqual ) + boolean typeEquals = Objects.equals(dtype, otherLiteral.getDatatype()) ; + if ( !typeEquals ) return false ; - boolean lexEquals = Objects.equals(lexicalForm, otherLiteral.getLexicalForm()); + // Don't just use this.lexcialForm -- need to force delayed calculation from values. + boolean lexEquals = Objects.equals(getLexicalForm(), otherLiteral.getLexicalForm()); if ( ! lexEquals ) return false ; - boolean langEqual = Objects.equals(lang, otherLiteral.language()) ; - if ( ! langEqual ) + boolean langEquals = Objects.equals(lang, otherLiteral.language()) ; + if ( ! langEquals ) return false ; // Ignore xml flag as it is calculated from the lexical form + datatype // Ignore value as lexical form + datatype -> value is a function.
