From 058e92883e2ee5966a48ba5f971a50fd8a8426da Mon Sep 17 00:00:00 2001 From: jjg Date: Fri, 4 Oct 2013 14:46:46 -0700 Subject: [PATCH] 6525408: DiagnosticListener should receive MANDATORY_WARNING in standard compiler mode Reviewed-by: darcy --- .../com/sun/tools/javac/main/JavaCompiler.java | 2 +- src/share/classes/javax/tools/Diagnostic.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java index 89b95f0b..d6d32dde 100644 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -741,7 +741,7 @@ public class JavaCompiler { out.close(); } return outFile; - } + }'' } /** Generate code and emit a class file for a given class diff --git a/src/share/classes/javax/tools/Diagnostic.java b/src/share/classes/javax/tools/Diagnostic.java index fd781aab..03b11fd9 100644 --- a/src/share/classes/javax/tools/Diagnostic.java +++ b/src/share/classes/javax/tools/Diagnostic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,15 @@ public interface Diagnostic { /** * Kinds of diagnostics, for example, error or warning. + * + * The kind of a diagnostic can be used to determine how the + * diagnostic should be presented to the user. For example, + * errors might be colored red or prefixed with the word "Error", + * while warnings might be colored yellow or prefixed with the + * word "Warning". There is no requirement that the Kind + * should imply any inherent semantic meaning to the message + * of the diagnostic: for example, a tool might provide an + * option to report all warnings as errors. */ enum Kind { /** @@ -63,7 +72,7 @@ public interface Diagnostic { /** * Problem similar to a warning, but is mandated by the tool's * specification. For example, the Java™ Language - * Specification, 3rd Ed. mandates warnings on certain + * Specification mandates warnings on certain * unchecked operations and the use of deprecated methods. */ MANDATORY_WARNING, -- GitLab