Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8335935

Chained builders not sending transformed models to next transforms

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 24
    • 23, 24
    • core-libs

        In chained builders, we have code like `downstream.with` which should instead become `consumer.accept` so the builder's buffered model is sent to the andThen transforms.

        This is definitely a bug: currently, they are not only not sending the models to next transforms, but they also return the downstream instead of this builder for chaining. This is a violation of API specification too.

        Simple reproducer attached. The "methodB" does not appear in the console output but appears in the class printer output.

        A similar problems happens to BlockCodeBuilder writing bypassing downstream ChainedCodeBuilder, initially reported in JDK-8335642; that bug should be fixed in the same patch as all these bugs are of the same nature.

        And as a consequence, we can remove TransformingCodeBuilder in favor of ChainedCodeBuilder.

              liach Chen Liang
              liach Chen Liang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: