finos / rune-dsl

The project containing the Rune DSL grammar and default code generators
Apache License 2.0
27 stars 30 forks source link

Tabulator Generator does not support circular dependancies #795

Closed JayasriR closed 2 months ago

JayasriR commented 3 months ago

Generating Tabulator from

  namespace foo
  type One:
    two Two (1..1)

  type Two:
    three Three (1..1)

  type Three:
    one One (1..1)
    data string (1..1)

  annotation enrichment:

  func EnrichFunc:
      [enrichment]
      inputs:
          one One (1..1)
      output:
          three Three (1..1)

Guice circular dependency logs

    com.google.inject.ProvisionException: Unable to provision, see the following errors:

         1) [Guice/CanNotProxyClass]: Tried proxying OneEnrichFuncTypeTabulator to support a circular dependency, but it is not an interface.
      at ThreeEnrichFuncTypeTabulator.<init>(Unknown Source)
          \_ for 1st parameter
      at TwoEnrichFuncTypeTabulator.<init>(Unknown Source)
          \_ for 1st parameter
      at OneEnrichFuncTypeTabulator.<init>(Unknown Source)
          \_ for 1st parameter
      while locating OneEnrichFuncTypeTabulator

    Learn more:
      https://github.com/google/guice/wiki/CAN_NOT_PROXY_CLASS

    1 error

    ======================
    Full classname legend:
    ======================
    OneEnrichFuncTypeTabulator:   "foo.tabulator.OneEnrichFuncTypeTabulator"
    ThreeEnrichFuncTypeTabulator: "foo.tabulator.ThreeEnrichFuncTypeTabulator"
    TwoEnrichFuncTypeTabulator:   "foo.tabulator.TwoEnrichFuncTypeTabulator"
    ========================
    End of classname legend:
    ========================

at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)   

The tabulator generation could be updated in line with these recommendations to support circular dependancies

SimonCockx commented 2 months ago

Fixed in https://github.com/finos/rune-dsl/pull/806