--- old/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java 2016-10-17 14:53:07.867196863 -0700 +++ new/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java 2016-10-17 14:53:07.755192006 -0700 @@ -27,7 +27,6 @@ import java.util.*; -import com.sun.tools.javac.code.Source; import com.sun.tools.javac.main.Option; import static com.sun.tools.javac.main.Option.*; @@ -113,6 +112,18 @@ return (values.get(option.primaryName + value) != null); } + /** Check if the value for a lint option has been explicitly set, either with -Xlint:opt + * or if all lint options have enabled and this one not disabled with -Xlint:-opt. + */ + public boolean isLintSet(String s) { + // return true if either the specific option is enabled, or + // they are all enabled without the specific one being + // disabled + return + isSet(XLINT_CUSTOM, s) || + (isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) && isUnset(XLINT_CUSTOM, "-" + s); + } + /** * Check if the value for an undocumented option has not been set. */ @@ -170,25 +181,4 @@ for (Runnable r: listeners) r.run(); } - - /** Check for a lint suboption. */ - public boolean lint(String s) { - // return true if either the specific option is enabled, or - // they are all enabled without the specific one being - // disabled - return - isSet(XLINT_CUSTOM, s) || - (isSet(XLINT) || isSet(XLINT_CUSTOM, "all") || (s.equals("dep-ann") && depAnnOnByDefault())) && - isUnset(XLINT_CUSTOM, "-" + s); - } - // where - private boolean depAnnOnByDefault() { - String sourceName = get(Option.SOURCE); - Source source = null; - if (sourceName != null) - source = Source.lookup(sourceName); - if (source == null) - source = Source.DEFAULT; - return source.compareTo(Source.JDK1_9) >= 0; - } }