Class DiagnosticPrettyPrinter


  • public class DiagnosticPrettyPrinter
    extends Object
    Take a Diagnostic and pretty print it, using the same formatting as you'd find in the Oracle javac implementation. This ensures that no matter which compiler is being used, output to the user is consistent.

    Output is given in the following format, where "summary" is the first line of Diagnostic.getMessage(Locale) and "Remainder of message" are all the other lines.

     Path-to-file:line-number: kind-of-error: summary\n
    
     Context from code
          ^
     Remainder of message