AbstractClientConnector violates basic Java contract of equals and hashcode and therefore should be replaced
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Vaadin Framework version: 8.x
In AbstractClientConnector.equals you define your own implementation of how vaadin handles equality of UI classes in order to handle proxies (see https://github.com/vaadin/framework/issues/5655). Since you are using this implementation in several other classes internally in vaadin core one should not be able to override this with different behaviour. So equals method of AbstractClientConnector should either be final or another internal method should be used for proxy handling.
A follow up problem of this design glitch is that any class inheriting from vaadin component will cause a sonar violation (java:S2160) unless you provide your own equals method. In order to not break the vaadin ccore code by accident this implementation could only be: return super.equals(); This will for sure cause antoher sonar violation...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with AbstractClientConnector.equals and trace its use in the other Vaadin core classes mentioned in the issue. Review issue #5655 and Sonar rule java:S2160; done means proxy equality remains intact, subclasses cannot accidentally change the internal behavior, and the contract violation is addressed without breaking core code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100