@@ -48,22 +48,14 @@ public void printSummary(Context ctx) {
48
48
public void doReport (Diagnostic dia , Context ctx ) {
49
49
Severity severity = severityOf (dia .level ());
50
50
Position position = positionOf (dia .pos ().nonInlined ());
51
-
52
- StringBuilder rendered = new StringBuilder ();
53
- rendered .append (messageAndPos (dia , ctx ));
54
51
Message message = dia .msg ();
55
- StringBuilder messageBuilder = new StringBuilder ();
56
- messageBuilder .append (message .message ());
52
+ StringBuilder messageBuilder = new StringBuilder (message .message ());
57
53
String diagnosticCode = String .valueOf (message .errorId ().errorNumber ());
58
- boolean shouldExplain = Diagnostic .shouldExplain (dia , ctx );
59
54
List <CodeAction > actions = CollectionConverters .asJava (message .actions (ctx ));
60
- if (shouldExplain && !message .explanation ().isEmpty ()) {
61
- rendered .append (explanation (message , ctx ));
55
+ if (Diagnostic .shouldExplain (dia , ctx ) && !message .explanation ().isEmpty ())
62
56
messageBuilder .append (System .lineSeparator ()).append (explanation (message , ctx ));
63
- }
64
-
65
- delegate .log (new Problem (position , messageBuilder .toString (), severity , rendered .toString (), diagnosticCode , actions ,
66
- lookupVirtualFileId ));
57
+ Problem problem = new Problem (position , messageBuilder .toString (), severity , messageAndPos (dia , ctx ), diagnosticCode , actions , lookupVirtualFileId );
58
+ delegate .log (problem );
67
59
}
68
60
69
61
public void reportBasicWarning (String message ) {
0 commit comments