Improving javap output for annotations
wdietl at gmail.com
Sat Feb 9 18:20:41 PST 2013
I hadn't look at how to implement this - I assumed that performing the
substitutions wouldn't be much trouble.
I think this would make the javap output for annotations much more readable.
On Sat, Feb 9, 2013 at 9:01 AM, Jonathan Gibbons
<jonathan.gibbons at oracle.com> wrote:
> On 02/09/2013 01:21 AM, Werner Dietl wrote:
>> The current output from javap -v is quite hard to read when it comes
>> to annotations.
>> For a declaration annotation, it displays:
>> 0: #29()
>> Similarly, for a complex type annotation, we see:
>> 2: #18(#19=s#20,#21=I#22,#23=[I#24,I#22,I#25]):
>> METHOD_REFERENCE, offset=0, location=[TYPE_ARGUMENT(1)]
>> The value of constant pool references is resolved in other locations -
>> as a comment. For example:
>> 0: invokedynamic #2, 0 // InvokeDynamic
>> Would it be possible to implement similar logic for annotations? Or is
>> there an option I'm missing?
>> cu, WMD.
> The annotations attributes are complex, and so it has proved
> a challenge to come up with a reasonable display for javap
> to use to show the contents of the annotations. If you have
> any suggestions, I'd be interested. That being said, a multi-line
> display similar to that used by the recent DPrinter utility might
> work well.
> -- Jon
More information about the type-annotations-dev