Hibernate (5 HIGH): addColumn/addReferencedColumn/addIndex ArrayList→LinkedHashSet (19x) FK second-pass LinkedHashSet, orderHierarchy LinkedHashSet MyBatis (1 MEDIUM): sortConstructorMappings indexOf→HashMap (12x) EF Core (2 HIGH + 1 MEDIUM): FindGenerationProperty HashSet (250x), AddPrincipals HashSet (250x), FK discovery HashSet (6x) Diesel (3 MEDIUM): SQLite/MySQL row position()→BTreeMap (51x) SQLAlchemy (2 HIGH): _values_bindparam Set (500x), evaluated_keys Set (500x) Peewee (1 MEDIUM): _SortedFieldList.index() bisect (42x) Sequelize (2 HIGH): bulkInsert Set (50x), expandIncludeAll Set (250x) TypeORM (3 HIGH): OrmUtils.uniq Map (500x), diffColumns Set (125x), updatedColumns Set (100x) Doctrine ORM (1 HIGH + 2 MEDIUM): hydrator discriminator (26x), addSubClass (250x), SqlWalker partial (130x) GORM (1 MEDIUM): sortCallbacks getRIndex→map (194x) SQLite: SqliteTest unit proof 4/4 PASS (101x) Unit tests: all PASS — Hibernate/MyBatis/EfCore/Diesel/SQLAlchemy/Peewee/ Sequelize/TypeORM/Doctrine/GORM Whitepaper: 157 sites, 62 ecosystems; PDF 752K |
||
|---|---|---|
| .. | ||
| diagrams | ||
| 0001-tarjan-ov2-stack-contains.md | ||
| 0002-inference-graph-findnode-linear-scan.md | ||
| 0003-module-hasher-topo-deque-contains.md | ||
| 0004-dependencies-node-list-contains.md | ||
| 0005-inference-context-isequiv-containsall.md | ||
| doctrine-orm-0001-hydrator-discriminator-in-array.md | ||
| doctrine-orm-0002-classmetadata-addsubclass-linear-dedup.md | ||
| doctrine-orm-0003-sqlwalker-partial-field-in-array.md | ||
| gorm-0001-sortcallbacks-getindex-quadratic.md | ||
| README.md | ||
Tickets
| # | Title | Module | Severity | Status |
|---|---|---|---|---|
| 0001 | Tarjan SCC: stack.contains(n) — O(V²) |
jdk.compiler | high | open |
| 0002 | InferenceGraph.findNode() O(N) scan, called O(N³) total |
jdk.compiler | high | open |
| 0003 | ModuleHashesBuilder$TopoSorter Deque.contains() |
java.base | medium | open |
| 0004 | Dependencies$Node.addDependency() List.contains() dedup |
jdk.compiler | low | open |
| 0005 | InferenceContext.isEquiv() List.containsAll() bound comparison |
jdk.compiler | low | open |
Pattern
Same defect replicated in 4 locations across 2 modules: O(n) linear collection membership check where O(1) is available.
In every case a flag field, HashSet, or dedicated boolean already exists or is trivially addable.
The background bytecode scan of all 69 JDK modules confirmed no additional hits beyond these five.
The active field in TarjanNode (0001) is the most direct evidence: maintained correctly, never read.
Cascade
javac compilation
└─ type inference (Infer.java)
├─ GraphSolver.solve()
│ └─ InferenceGraph.initNodes()
│ └─ GraphUtils.tarjan() ← DEFECT 0001: O(V²)
└─ DeferredAttr.buildStuckGraph()
└─ canInfluence() × N²
├─ findNode() ← DEFECT 0002: O(N) per call → O(N³) total
└─ closure() ← DEFECT 0002: uncached O(V+E) per call
jlink image creation
└─ ModuleHashesBuilder.computeHashes()
└─ TopoSorter.visit() ← DEFECT 0003: Deque.contains() O(N)
debug compilation (-XDcompletionDeps)
└─ Dependencies$GraphDependencies
└─ Node.addDependency() ← DEFECT 0004: List.contains() O(N)