B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections. Squash of 94 local commits onto remote master.
1.1 KiB
1.1 KiB
| id | repo | severity | status | created |
|---|---|---|---|---|
| javac-0005 | openjdk | HIGH | patched | 2026-03-23 |
Defect
File: src/jdk.compiler/.../javac/comp/InferenceContext.java:506
Pattern: List.containsAll() in inference context
Complexity: O(B²)
Language: Java
Description
InferenceContext uses List.containsAll() to check whether one set of inference variables is a subset of another. containsAll on a List performs a linear scan for each element being tested, making the overall check O(B²) where B is the size of the bounds sets. This check is performed during bounds propagation, which is called repeatedly throughout inference.
Fix
Replace: list.containsAll(otherList)
With: set.containsAll(otherCollection)
Data structure change: List<Type> freeVars → LinkedHashSet<Type> freeVars
Work required
- Patch in
defects/javac/patch/ - Unit test — asserts exact operation counts before/after (in
defects/javac/unit/) - Integration test (in
defects/javac/integration/) - Benchmark — before/after on V=100,200,400,800 (in
defects/javac/bench/) - White paper section