RE: Hashcodes vs rendering components

I do not know details of your implementation. There are places in Vaadin framework, where objects are identified by using e.g. equals. And if equals say that objects are the same, then certain things are done or not done. So I would say, that would you see, is most likely intented behavior and not a bug.

Hi,
After upgrading to version 8.1.x I’ve found that components with same hashcode are not rendered. F.e. I create two or more custom buttons which overrides metods equals & hashcode.
Is it bug or proper behaviour ?

From Vaadin’s perspective every component instance is different and unique since it uses its own unique connector to connect to a its own client-side widget. Vaadin thus does not override equals/hashCode() and thus Object identity is used, to reflect this component uniqueness. Overriding this behavior and making different instances of components being equal is quite dangerous and I would strongly advise against that since unexpected bugs may occur (such as the one you discovered).

I’ve suggested to make equals()/hashCode() final to reflect the component uniqueness: it’s not possible with Vaadin 8 (since Component is an interface), but it’s possible with Vaadin 10. Please follow
https://github.com/vaadin/flow/issues/2984
for the discussion.