vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
605 stars 166 forks source link

The component in Vaadin10+ deosn't overide the equals method #8748

Closed yurili8 closed 4 years ago

yurili8 commented 4 years ago

The following code shown bellow is copied from class AbstractClientConnector in Vaadin8, it overides the equals method, which handle the spring inject case.

@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof AbstractClientConnector) { AbstractClientConnector connector = (AbstractClientConnector) obj; return connector.isThis(this); } return false; }

But in vaadin14, there is no such method. it will cause the button.equals(btn) fail in the spring inject proxy environment.

denis-anisimov commented 4 years ago

Could you please explain what exactly implementation you expect in equals ? The provided impl contains isThis : we don't have this method and I don't know its contract.

So this ticket is unclear for me. Component is an abstract class and it doesn't have to have an impl for equals since it doesn't know how to compare two instances with real types. So we may provide only basic impl whcih should be called in the real impl of Component but still the impl should be done by every component implementor. So technically this is not an issue for Flow but rather for every Component. If you see a way which we can implement equals in Component then please explain this in details.

denis-anisimov commented 4 years ago

No info provided. Closing.