RFR: 8294982: Implementation of Classfile API [v20]

Adam Sotona asotona at openjdk.org
Mon Feb 27 09:17:51 UTC 2023


On Fri, 17 Feb 2023 17:09:51 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Yes, the print structure does not exactly correspond to the Classfile API architecture, but rather to the classfile physical structure and it is partly similar to `javap` output.
>> The common tree structure has been reverse-designed from the desired visual representations in all supported text formats and in all verbosity levels.
>
> Not sure I get this. It seems to me that the same attributes are being printed twice. But, perhaps, the first pass only creates a list with the attribute _names_ and then there is a later pass which print the attributes in full?

Yes, the first is just a list of attribute names, while later there might be printed more attribute details (depending on the verbosity).
Combined or dynamically changed list formats would be inconsistent in various verbosity levels, so duplicate print is preferred for better human and machine readability and consistency. 
There are other cases of duplication in favour of readability. For example some code attributes are printed standalone in a table form, as well as their individual elements are attached to the corresponding bytecode instructions.

-------------

PR: https://git.openjdk.org/jdk/pull/10982



More information about the build-dev mailing list