paulk-asert commented on code in PR #2841:
URL: https://github.com/apache/groovy/pull/2841#discussion_r3887973919


##########
src/main/java/org/codehaus/groovy/control/messages/Message.java:
##########
@@ -58,10 +60,54 @@ public static Message create(final SyntaxException error, 
final SourceUnit owner
      */
     public abstract void write(PrintWriter writer, Janitor janitor);
 
+    /**
+     * Writes this message to the specified {@link PrintWriter} in the 
requested format.
+     * The default implementation ignores the format; subclasses which can 
render a
+     * {@link ErrorFormat#SHORT} form override this (GROOVY-12312).
+     *
+     * @param writer the destination writer
+     * @param janitor the cleanup helper for temporary source access
+     * @param format how the message should be rendered
+     * @since 6.0.0
+     */
+    public void write(final PrintWriter writer, final Janitor janitor, final 
ErrorFormat format) {
+        write(writer, janitor);
+    }
+
     /**
      * Writes this message to the specified {@link PrintWriter}.
      */
     public final void write(final PrintWriter writer) {
         write(writer, null);
     }
+
+    
//--------------------------------------------------------------------------
+
+    /**
+     * Renders one diagnostic as a single {@code file:line:column: severity: 
message} line.
+     * Absent parts are dropped rather than guessed: a message with no source 
unit omits the
+     * file, and one with no position omits the line and column.
+     */
+    static void writeShort(final PrintWriter writer, final String name, final 
int line,

Review Comment:
   rewritten to try to achieve this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to