/** 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")) && isUnset(XLINT_CUSTOM, "-" + s); } }
/** 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")) && isUnset(XLINT_CUSTOM, "-" + s); } }
private void initOptions(Options options) { this.dumpOnError = options.isSet(DOE); this.promptOnError = options.isSet(PROMPT); this.emitWarnings = options.isUnset(XLINT_CUSTOM, "none"); this.suppressNotes = options.isSet("suppressNotes"); this.MaxErrors = getIntOption(options, XMAXERRS, getDefaultMaxErrors()); this.MaxWarnings = getIntOption(options, XMAXWARNS, getDefaultMaxWarnings()); boolean rawDiagnostics = options.isSet("rawDiagnostics"); this.diagFormatter = rawDiagnostics ? new RawDiagnosticFormatter(options) : new BasicDiagnosticFormatter(options, messages); String ek = options.get("expectKeys"); if (ek != null) expectDiagKeys = new HashSet<String>(Arrays.asList(ek.split(", *"))); }
private void initOptions(Options options) { this.dumpOnError = options.isSet(DOE); this.promptOnError = options.isSet(PROMPT); this.emitWarnings = options.isUnset(XLINT_CUSTOM, "none"); this.suppressNotes = options.isSet("suppressNotes"); this.MaxErrors = getIntOption(options, XMAXERRS, getDefaultMaxErrors()); this.MaxWarnings = getIntOption(options, XMAXWARNS, getDefaultMaxWarnings()); boolean rawDiagnostics = options.isSet("rawDiagnostics"); this.diagFormatter = rawDiagnostics ? new RawDiagnosticFormatter(options) : new BasicDiagnosticFormatter(options, messages); String ek = options.get("expectKeys"); if (ek != null) expectDiagKeys = new HashSet<String>(Arrays.asList(ek.split(", *"))); }
private void checkForObsoleteOptions(Target target) { // Unless lint checking on options is disabled, check for // obsolete source and target options. boolean obsoleteOptionFound = false; if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) { if (source.compareTo(Source.JDK1_5) <= 0) { log.warning(LintCategory.OPTIONS, "option.obsolete.source", source.name); obsoleteOptionFound = true; } if (target.compareTo(Target.JDK1_5) <= 0) { log.warning(LintCategory.OPTIONS, "option.obsolete.target", target.name); obsoleteOptionFound = true; } if (obsoleteOptionFound) log.warning(LintCategory.OPTIONS, "option.obsolete.suppression"); } }
private void checkForObsoleteOptions(Target target) { // Unless lint checking on options is disabled, check for // obsolete source and target options. boolean obsoleteOptionFound = false; if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) { if (source.compareTo(Source.JDK1_5) <= 0) { log.warning(LintCategory.OPTIONS, "option.obsolete.source", source.name); obsoleteOptionFound = true; } if (target.compareTo(Target.JDK1_5) <= 0) { log.warning(LintCategory.OPTIONS, "option.obsolete.target", target.name); obsoleteOptionFound = true; } if (obsoleteOptionFound) log.warning(LintCategory.OPTIONS, "option.obsolete.suppression"); } }
/** Construct a class writer, given an options table. */ protected ClassWriter(Context context) { context.put(classWriterKey, this); log = Log.instance(context); names = Names.instance(context); options = Options.instance(context); target = Target.instance(context); source = Source.instance(context); types = Types.instance(context); fileManager = context.get(JavaFileManager.class); signatureGen = new CWSignatureGenerator(types); verbose = options.isSet(VERBOSE); scramble = options.isSet("-scramble"); scrambleAll = options.isSet("-scrambleAll"); retrofit = options.isSet("-retrofit"); genCrt = options.isSet(XJCOV); debugstackmap = options.isSet("debugstackmap"); emitSourceFile = options.isUnset(G_CUSTOM) || options.isSet(G_CUSTOM, "source"); String dumpModFlags = options.get("dumpmodifiers"); dumpClassModifiers = (dumpModFlags != null && dumpModFlags.indexOf('c') != -1); dumpFieldModifiers = (dumpModFlags != null && dumpModFlags.indexOf('f') != -1); dumpInnerClassModifiers = (dumpModFlags != null && dumpModFlags.indexOf('i') != -1); dumpMethodModifiers = (dumpModFlags != null && dumpModFlags.indexOf('m') != -1); }
/** Construct a class writer, given an options table. */ protected ClassWriter(Context context) { context.put(classWriterKey, this); log = Log.instance(context); names = Names.instance(context); options = Options.instance(context); target = Target.instance(context); source = Source.instance(context); types = Types.instance(context); fileManager = context.get(JavaFileManager.class); signatureGen = new CWSignatureGenerator(types); verbose = options.isSet(VERBOSE); scramble = options.isSet("-scramble"); scrambleAll = options.isSet("-scrambleAll"); retrofit = options.isSet("-retrofit"); genCrt = options.isSet(XJCOV); debugstackmap = options.isSet("debugstackmap"); emitSourceFile = options.isUnset(G_CUSTOM) || options.isSet(G_CUSTOM, "source"); String dumpModFlags = options.get("dumpmodifiers"); dumpClassModifiers = (dumpModFlags != null && dumpModFlags.indexOf('c') != -1); dumpFieldModifiers = (dumpModFlags != null && dumpModFlags.indexOf('f') != -1); dumpInnerClassModifiers = (dumpModFlags != null && dumpModFlags.indexOf('i') != -1); dumpMethodModifiers = (dumpModFlags != null && dumpModFlags.indexOf('m') != -1); }
protected Infer(Context context) { context.put(inferKey, this); rs = Resolve.instance(context); chk = Check.instance(context); syms = Symtab.instance(context); types = Types.instance(context); diags = JCDiagnostic.Factory.instance(context); log = Log.instance(context); inferenceException = new InferenceException(diags); Options options = Options.instance(context); allowGraphInference = Source.instance(context).allowGraphInference() && options.isUnset("useLegacyInference"); }
boolean batchMode = (options.isUnset("nonBatchMode") && System.getProperty("nonBatchMode") == null); if (batchMode)
protected Infer(Context context) { context.put(inferKey, this); rs = Resolve.instance(context); chk = Check.instance(context); syms = Symtab.instance(context); types = Types.instance(context); diags = JCDiagnostic.Factory.instance(context); log = Log.instance(context); inferenceException = new InferenceException(diags); Options options = Options.instance(context); allowGraphInference = Source.instance(context).allowGraphInference() && options.isUnset("useLegacyInference"); }
boolean batchMode = (options.isUnset("nonBatchMode") && System.getProperty("nonBatchMode") == null); if (batchMode)
debugResolve = options.isSet("debugresolve"); compactMethodDiags = options.isSet(Option.XDIAGS, "compact") || options.isUnset(Option.XDIAGS) && options.isUnset("rawDiagnostics"); verboseResolutionMode = VerboseResolutionMode.getVerboseResolutionMode(options); Target target = Target.instance(context);
cacheCompletionFailure = options.isUnset("dev"); preferSource = "source".equals(options.get("-Xprefer"));
cacheCompletionFailure = options.isUnset("dev"); preferSource = "source".equals(options.get("-Xprefer"));
debugResolve = options.isSet("debugresolve"); compactMethodDiags = options.isSet(Option.XDIAGS, "compact") || options.isUnset(Option.XDIAGS) && options.isUnset("rawDiagnostics"); verboseResolutionMode = VerboseResolutionMode.getVerboseResolutionMode(options); Target target = Target.instance(context);
attrParseOnly = options.isSet("-attrparseonly"); encoding = options.get(ENCODING); lineDebugInfo = options.isUnset(G_CUSTOM) || options.isSet(G_CUSTOM, "lines"); genEndPos = options.isSet(XJCOV) || if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) { if (fileManager instanceof BaseFileManager) { if (((BaseFileManager) fileManager).isDefaultBootClassPath()) : CompileState.GENERATE; if (options.isUnset("oldDiags")) log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));
attrParseOnly = options.isSet("-attrparseonly"); encoding = options.get(ENCODING); lineDebugInfo = options.isUnset(G_CUSTOM) || options.isSet(G_CUSTOM, "lines"); genEndPos = options.isSet(XJCOV) || if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) { if (fileManager instanceof BaseFileManager) { if (((BaseFileManager) fileManager).isDefaultBootClassPath()) : CompileState.GENERATE; if (options.isUnset("oldDiags")) log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));