Java transitive reach (impact all hops) is heavily over-reported; precision against what the test suites run was 0.25 on the tuning projects. Three causes:
- Type initializer hop too wide. A
static { } block was reached from every use of its type, including instance-method calls. Per JLS 12.4.1 it runs on new, a static method call or a static field use; an instance initializer runs inside the constructors. It also hopped (defines) into the lambdas and anonymous classes written in it, which the block does not run: one accessor in a static block reached 1,800 callables this way.
- Platform receivers read as unresolved.
final StringBuilder sb = new StringBuilder() (a pinned local of an unstaged platform type) took no type, and Objects.equals(..) / Character.charCount(..) (a static call on an unstaged type name) were unresolved, so each became a call by name to every project method of that name.
- Overloads with operator arguments.
new Bag(all.size() - 1), drop(--i), flag(a > b) kept the reference-typed overloads.
Fixed by #1898.
Java transitive reach (
impactall hops) is heavily over-reported; precision against what the test suites run was 0.25 on the tuning projects. Three causes:static { }block was reached from every use of its type, including instance-method calls. Per JLS 12.4.1 it runs onnew, a static method call or a static field use; an instance initializer runs inside the constructors. It also hopped (defines) into the lambdas and anonymous classes written in it, which the block does not run: one accessor in a static block reached 1,800 callables this way.final StringBuilder sb = new StringBuilder()(a pinned local of an unstaged platform type) took no type, andObjects.equals(..)/Character.charCount(..)(a static call on an unstaged type name) were unresolved, so each became a call by name to every project method of that name.new Bag(all.size() - 1),drop(--i),flag(a > b)kept the reference-typed overloads.Fixed by #1898.