javap and nullable projection types.

Srikanth srikanth.adayapalam at oracle.com
Sun Apr 21 17:42:12 UTC 2019


While working on JDK-8222790 (javac diagnostics don't discriminate 
between inline types and their nullable projection types.) I realized 
that it is somewhat hard for javap to properly annotate nullable 
projection types in its text output.

A method in source of the form void foo(X x, X? xq) gets disassembled as

void foo(X, X);
     descriptor: (QX;LX;)V
     flags: (0x0000)
     Code:

Note the parameter types both showing up as X. The descriptor is 
correct, but the header is misleading.
In general this looks unsolvable without the now withdrawn ValueTypes 
attribute in the class file.

This would be a problem for any tool that works only with a "local" view 
without building an elaborate symbol table of all the classes involved.

Srikanth.



More information about the valhalla-dev mailing list