GitHub user metlos opened a pull request:

    https://github.com/apache/tinkerpop/pull/518

    Honor the equals() contract on Property impls by allowing nulls as valid 
comparisons.

    If user code put the properties into some kind of collection together with 
`null` values, things would blow up.
    
    Note that `ElementHelper.areEqual(Element, Object)` allows for `null` 
values, but `ElementHelper.areEqual(Property, Object)` does not. I assume the 
reason for this discrepancy is that properties are never supposed to be null 
but merely not present.
    
    While this assumption is valid in Tinkerpop impl, I think it cannot be 
imposed on the user code, which assumes a valid implementation of `equals()` 
which *should not* blow up on null arguments.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/metlos/tinkerpop null-equality-on-props

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/518.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #518
    
----
commit a0b604c10f3ffbf96fbe444bc5059e2c9d0030a3
Author: Lukas Krejci <[email protected]>
Date:   2016-12-21T10:34:34Z

    Honor the equals() contract on Property impls by allowing nulls as valid
    comparisons.
    
    If user code put the properties into some kind of collection together with
    null values, things would blow up.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to