--- old/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java 2017-10-11 09:55:31.905017429 -0700 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java 2017-10-11 09:55:31.525017416 -0700 @@ -92,6 +92,9 @@ /** The name table. */ private Names names; + /** The lint settings. */ + private Lint lint; + /** End position mappings container */ protected final AbstractEndPosTable endPosTable; @@ -186,6 +189,7 @@ this.keepLineMap = keepLineMap; this.errorTree = F.Erroneous(); endPosTable = newEndPosTable(keepEndPositions); + this.lint = fac.lint; } protected AbstractEndPosTable newEndPosTable(boolean keepEndPositions) { @@ -639,7 +643,10 @@ } } else if (token.kind == UNDERSCORE) { if (allowUnderscoreIdentifier) { - warning(token.pos, "underscore.as.identifier"); + if (lint.isEnabled(Lint.LintCategory.FUTURE) && + !lint.isSuppressed(Lint.LintCategory.FUTURE)) { + warning(token.pos, "underscore.as.identifier"); + } } else { error(token.pos, "underscore.as.identifier"); }