RFR: 8342090: Infer::IncorporationBinaryOp::equals can produce side-effects

Vicente Romero vromero at openjdk.org
Tue Oct 22 23:20:17 UTC 2024


Type inference uses a cache to store incorporation operations already done. This way we can avoid redoing operations that once done won't produce any change. This can reduce the compilation time when the number of inference variables involved is not trivial. The elements in the cache are implemented with class `com.sun.tools.javac.comp.Infer::IncorporationBinaryOp` the problem here is that the equals method of this class can produce side effects, implying that after a comparison the compared objects can mutate. This patch is fixing this issue,

TIA

-------------

Commit messages:
 - adding bug id
 - Merge branch 'JDK-8342090' of https://github.com/vicente-romero-oracle/jdk into JDK-8342090
 - 8342090: Test jdk/classfile/AnnotationTest.java failed to compile
 - 8342090: Infer::IncorporationBinaryOp::equals can produce side-effects

Changes: https://git.openjdk.org/jdk/pull/21651/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21651&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342090
  Stats: 115 lines in 3 files changed: 98 ins; 0 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/21651.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21651/head:pull/21651

PR: https://git.openjdk.org/jdk/pull/21651


More information about the compiler-dev mailing list