Skip to content

Java: transitive reach over-reported through type initializers, unstaged platform receivers and operator-argument overloads #1902

Description

@swapnilpaliwal-sd

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:

  1. 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.
  2. 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.
  3. Overloads with operator arguments. new Bag(all.size() - 1), drop(--i), flag(a > b) kept the reference-typed overloads.

Fixed by #1898.

Activity

  1. swapnilpaliwal-sd commented on Oct 10, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1898, merged into apps/integration-0.1.9 and on to 0.1.9 (#1903).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingjavaJava

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions