When creating a new class, it is useful to generate all the boilerplate by IDE (unless e.g. Lombok is used, of course). I tried to do it with IntelliJ Idea and I didn't like the equals and hashCode
methods.
In fact, not even Idea itself liked the equals method. The code inspection says that the statement can be simplified. Well, it looks slightly better after applying Simplify n+1
times where n
is amount of fields used in the methods, but it is still not the intended result.
Objects.equals(objA, objB)
and Objects.hash(Object...)
are considered best practice where I work. Is it possible to modify the templates used in Quick Generation feature?
If not, is there any update planned to enhance its behavior so that it at least passes inspections?