need better printer

Werner Dietl wdietl at gmail.com
Thu Jan 24 20:03:58 PST 2013


Ups, yes I was talking about AnnotatedType.toString and the duplication
with the Printer.
cu, WMD.
On Jan 24, 2013 7:45 PM, "Jonathan Gibbons" <jonathan.gibbons at oracle.com>
wrote:

>
>
> On 01/24/2013 07:32 PM, Werner Dietl wrote:
>
>> Also note that that rudimentary logic is duplicated in
>> com.sun.tools.javac.code.**Printer.visitAnnotatedType.
>> Can we just use the Printer?
>>
>
> ??? ... I was talking about com.sun.tools.javac.code.**Printer.visitAnnotatedType
> ... ???
> I'm guessing you were talking about AnnotatedType.toString(), or you
> thought I was.
> Since no other *Type.toString() uses Printer, I'm loathe to break the
> pattern.
>
>
>> This also depends on whether we go with delegation or anon subtypes
>> for AnnotatedType.
>>
>> cu, WMD.
>>
>> On Thu, Jan 24, 2013 at 5:01 PM, Jonathan Gibbons
>> <jonathan.gibbons at oracle.com> wrote:
>>
>>> Werner,
>>>
>>> The following code in com.sun.tools.javac.code.**Printer needs to be
>>> fixed to
>>> render the annotation in JLS format, since the text can appear in
>>> diagnostic
>>> messages;
>>>
>>>      @Override
>>>      public String visitAnnotatedType(**AnnotatedType t, Locale locale)
>>> {
>>>          if (t.typeAnnotations != null &&
>>>                  t.typeAnnotations.nonEmpty()) {
>>>              // TODO: better logic for arrays, ...
>>>              return "(" + t.typeAnnotations + " :: " +
>>> visit(t.underlyingType, locale) + ")";
>>>          } else {
>>>              return "({} :: " + visit(t.underlyingType, locale) + ")";
>>>          }
>>>      }
>>>
>>> Separately, I am working on better printers for debugging.
>>>
>>> -- Jon
>>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/type-annotations-dev/attachments/20130124/aea4797b/attachment.html 


More information about the type-annotations-dev mailing list