rzwitserloot/lombok — pull request #52 by Maaartinus (2014-08-21 05:43:21+00:00)
Title: Improve @Tolerate, so it really works with @EqualsAndHashCode.

It was possible to e.g. let Lombok ignore a preexisting `hashCode` using `@Tolerate`, but then both `equals` and `hashCode` were generated.

That's totally wrong. Generating the missing method only makes sense and there are two good use cases:

1. For perfect reproducibility, I need a deterministic `hashCode` (so that my HashSet gets always iterated in the same order), but there are some fields of type `Enum` or `Class`. When I compute the `hashCode` manually I can easily handle such fields specially. The generated `equals` has no such problem, so I want to use it.

2. With a value object, I precompute and store the `hashCode` for speed. Again, the generated `equals` fits perfectly. This is something Lombok could do itself, but for now there's just this workaround.