RFR: 8374953: Add note on about implicit state when comparing TypeMirrors
Attila Szegedi
attila at openjdk.org
Sun Jan 11 14:40:46 UTC 2026
On Sat, 10 Jan 2026 23:17:15 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> The API note about comparing Element's:
>
>> The identity of an element involves implicit state not directly accessible from the element's methods, including state about the presence of unrelated types. Element objects created by different implementations of these interfaces should not be expected to be equal even if "the same" element is being modeled; this is analogous to the inequality of Class objects for the same class file loaded through different class loaders.
>
> is equally applicable to comparing TypeMirror and an analagous note should be present on the methods used to compare TypeMirror's.
Clear and concise!
-------------
Marked as reviewed by attila (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29153#pullrequestreview-3647775624
More information about the compiler-dev
mailing list