SoftwareAG/cumulocity-clients-java

Problem with com.cumulocity.rest.representation.alarm.AlarmRepresentation

matthiaswessel opened this issue · 1 comments

We updated to Version Cumulocity SDK Version 1015.77.0.
There was a change in the AlarmRepresentation-Class. It calls super for the equals and hashcode methode now. In our old version it does not call super for equals and hashcode.
The parent class has an attribute of Type ManagedObjectRepresentation. Because of super call of hashcode and equals and the equals and hashcode implementation of the super class(EventRepresentation) the equals and hashcode methode of the ManagedObjectRepresentation class is called. The ManagedObjectRepresentation class does not implement equals and hashcode. The two compared ManagedObjectRepresentation classes have the same id, but they have not the same address in memory. The equals and hashcode method is not implemented and so the result of equals methode is false and so the two Alarmrepresentation Objects are also unequal. Why does the ManagedObjectRepresentation-Class not implement the equals and hashcode methode???

Hello Matthias, we decided to fix EventRepresentation, EventRepresentation and AuditRepresentation equals and hashcode methods to only include ID from ManagedObjectRepresentation. There is no change in ManagedObjectRepresentation, you can compare those objects differently based on your scenario, by ID, by standard properties or by all properties including extensible properties.