Record Class InjectionCycles

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.InjectionCycles
Record Components:
members - fully qualified names of the component types on a cycle
interfaces - fully qualified names of the types those members are registered as

record InjectionCycles(Set<String> members, Set<String> interfaces) extends Record
THE components of an application that sit on a circular injection chain (E08190), as InjectionCycleOrError found them - and THE rule that E08190 suppresses E08200 for them (Steve, 2026-10-11): in a cycle no registration order works, so "reorder registrations" is advice that cannot be followed. An injection is left unreported by the ordering checks (InjectionOrderingOrError, TransitiveInjectionOrderingOrError, both through UnsatisfiedInjectionReporter) only when BOTH its owner is a cycle member and the type it injects is registered to a cycle member; any other out-of-order use, a cycle member used by an ordinary component included, is still E08200.

Never a second cycle detector: the members are recorded on the application by the E08190 check (squirrelled, DI_CYCLE_MEMBERS) and read back here.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final InjectionCycles
    No cycle: nothing is suppressed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    InjectionCycles(Set<String> members, Set<String> interfaces)
    Creates an instance of a InjectionCycles record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    (package private) boolean
    explains(String ownerFqn, ISymbol injected)
    True when the injection of injected into ownerFqn is explained by a cycle, not by the order.
    final int
    Returns a hash code value for this object.
    Returns the value of the interfaces record component.
    Returns the value of the members record component.
    (package private) Set<ISymbol>
    notExplained(String ownerFqn, Set<ISymbol> injections)
    The injections of ownerFqn the ordering checks still judge: those no cycle explains.
    (package private) static InjectionCycles
    of(AggregateSymbol application)
    The cycles recorded on the application (none when the E08190 check found none).
    (package private) static void
    record(AggregateSymbol application, Set<String> members)
    Record the cycle members on the application, for the ordering checks that run after the E08190 check.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NONE

      static final InjectionCycles NONE
      No cycle: nothing is suppressed.
  • Constructor Details

    • InjectionCycles

      InjectionCycles(Set<String> members, Set<String> interfaces)
      Creates an instance of a InjectionCycles record class.
      Parameters:
      members - the value for the members record component
      interfaces - the value for the interfaces record component
  • Method Details

    • record

      static void record(AggregateSymbol application, Set<String> members)
      Record the cycle members on the application, for the ordering checks that run after the E08190 check.
    • of

      static InjectionCycles of(AggregateSymbol application)
      The cycles recorded on the application (none when the E08190 check found none).
    • explains

      boolean explains(String ownerFqn, ISymbol injected)
      True when the injection of injected into ownerFqn is explained by a cycle, not by the order.
    • notExplained

      Set<ISymbol> notExplained(String ownerFqn, Set<ISymbol> injections)
      The injections of ownerFqn the ordering checks still judge: those no cycle explains.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • members

      public Set<String> members()
      Returns the value of the members record component.
      Returns:
      the value of the members record component
    • interfaces

      public Set<String> interfaces()
      Returns the value of the interfaces record component.
      Returns:
      the value of the interfaces record component