Release Note: `java.lang.classfile.ClassFileBuilder` has Type Variable Declaration Changes

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Withdrawn
    • Priority: P4
    • None
    • Affects Version/s: 25
    • Component/s: core-libs

      When `java.lang.classfile.ClassFileBuilder` was added in release 24, it only has two type variables representing the `ClassFileElement` type and its self type.

      In release 25, it has an additional type variable to represent `ClassFileTransform` that integrates with it, so callers no longer need explicitly casts for lambda transforms for `transform(CompoundElement, ClassFileTransform)`, and for the new API `transforming(ClassFileTransform, Consumer)`.

      The usages of parameterized `ClassFileBuilder` can be updated:
        - If the type arguments are not unbounded wildcards, use the concrete subtypes like `CodeBuilder` or `ClassBuilder`;
        - If the type arguments are unbounded wildcards, update to add a new unbounded wildcard argument;
        - If backward compatibility with release 24 is desired, use the raw type `ClassFileBuilder` instead.

            Assignee:
            Chen Liang
            Reporter:
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: