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

Class-File API debug printing capability

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 24, 25
    • core-libs
    • None
    • source
    • minimal
    • Adding a default method to a sealed interface represents a minimal compatibility risk.
    • Java API
    • SE

      Summary

      Restore debug printing capability in the Class-File API.

      Problem

      The Class-File API has lost its debug printing capability with removal of the components package and, more specifically of the ClassPrinter class as part of JDK-8345343.

      Solution

      Add a method, namely CompoundElement::toDebugString, to retrieve a textual representation of the element.

      Specification

          /**
           * {@return a text representation of the compound element and its contents for debugging purposes}
           *
           * The format, structure and exact contents of the returned string are not specified and may change at any time in the future.
           */
          default String toDebugString()

            asotona Adam Sotona
            asotona Adam Sotona
            Chen Liang, Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: