8058542: Devise scheme for better diagnostic creation

Add support for generating (at build-time) an enum-like class containing all javac diagnostics, which allows for safe diagnostic creation.

Reviewed-by: jlahoda, jjg, vromero, erikj, jfranck
This commit is contained in:
Maurizio Cimadamore 2015-01-08 14:43:05 +00:00
parent 5cb7065612
commit 56a33e4541
26 changed files with 1825 additions and 132 deletions

View file

@ -31,7 +31,9 @@ import java.util.regex.Pattern;
*/
class MessageFile {
static final Pattern emptyOrCommentPattern = Pattern.compile("( *#.*)?");
static final Pattern infoPattern = Pattern.compile("# ([0-9]+: [-A-Za-z ]+, )*[0-9]+: [-A-Za-z ]+");
static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([A-Za-z 0-9]+\\))?");
static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
typePattern.pattern(), typePattern.pattern()));
/**
* A line of text within the message file.