Class TransitiveInjectionOrderingOrError

java.lang.Object
org.ek9lang.compiler.phase5.TransitiveInjectionOrderingOrError

final class TransitiveInjectionOrderingOrError extends Object
Post-parallel detector for transitive injection ordering validation (E08200), run once the call graph is built.

For each statement of an application block - a registration or a block statement - InjectionOrderingOrError records what it starts running: its calls (a registration's constructor, the calls in its arguments, its aspects' constructors), and the dynamic functions and classes it creates. This follows each through CallGraph.getReachableIncludingReferences(Set, Function) - the same fail-closed over-approximation DI completeness uses (E08210/E08220), with construction taken from ReachableConstructions - and reports, at the statement, every injection reachable from it whose type is not registered above it: an injection in the body of a reached function, method or constructor, or an injection field of a type a reached callable constructs. An injection is a load from the application when it runs, so a type registered later loads nothing.

Only what runs DURING the statement is followed: the members a constructed type makes callable with no call site are not added (they run later, once the application is prepared), so a component method that injects a type registered below it stays legal.

When the transitive analysis encounters a call to an abstract method, it uses the ConcreteSubtypeFinder to resolve all concrete implementations and checks their override methods for injection-related constructor calls. This handles the abstract method boundary problem where abstract methods have no body and thus no outgoing call edges in the call graph.