diff -r 7ae4016c5938 -r 584365f256a7 src/share/classes/com/sun/tools/javac/parser/Scanner.java --- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java Tue Sep 07 17:31:54 2010 +0100 +++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java Tue Sep 07 17:32:27 2010 +0100 @@ -108,6 +108,10 @@ */ private boolean allowUnderscoresInLiterals; + /** Allow exotic identifiers. + */ + private boolean allowExoticIdentifiers; + /** The source language setting. */ private Source source; @@ -181,6 +185,7 @@ allowBinaryLiterals = source.allowBinaryLiterals(); allowHexFloats = source.allowHexFloats(); allowUnderscoresInLiterals = source.allowBinaryLiterals(); + allowExoticIdentifiers = source.allowExoticIdentifiers(); // for invokedynamic } private static final boolean hexFloatsWork = hexFloatsWork(); @@ -1010,6 +1015,10 @@ case '#': scanChar(); if (ch == '\"') { + if (!allowExoticIdentifiers) { + lexError("unsupported.exotic.id", source.name); + allowExoticIdentifiers = true; + } scanChar(); if (ch == '\"') lexError(pos, "empty.bytecode.ident");