I have a question why Eclipse shows the same reference in Expressions tab for two different objects but same type.

I have an original object and create copy of him and assign it to different reference:

InvestigationItemGWT itemToValidate = (InvestigationItemGWT) getItem().copy();

Copy function creates new Object of InvestigationItemGWT and copy all attributes of original objects to newly created object.

BaseModel copy = this.createEmptyObject();
for (String prop: this.getPropertyNames()) {
    copy.set(prop, copyProperty(this.get(prop)));
}
return copy;

InvestigationItemGWT inherits BaseModel.

And then in next line after copy creation I evaluate values in eclipse Expression (debug mode):

getItem() ->      (id=241) [email protected]
itemToValidate -> (id=311) [email protected]

But when I evaluate getItem() == itemToValidate it returns false

Is is some Eclipse bug ?

0 Answers