Skip to content

Conversation

@krico
Copy link

@krico krico commented Dec 23, 2014

Fixes #19

@krico
Copy link
Author

krico commented Dec 23, 2014

To provide a little explanation why I think this is a problem, suppose you have the following Model

@Model
class Foo {
  private Key id;
  private String name;
  private ModelRef<Bar> barRef = new ModelRef<>();
  public boolean equals(Object o) {
    Foo f = (Foo) o;
    return id.equals(f.id) && name.equals(f.name) && barRef.equals(f.barRef);
  }
}

Foo foo = new Foo(id, name);
foo.equals(foo); //yields false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModelRef equals fails when key is null

1 participant