Java Code Examples for com.sun.tools.javac.code.Lint.LintCategory#UNCHECKED

The following examples show how to use com.sun.tools.javac.code.Lint.LintCategory#UNCHECKED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Check.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");
    warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 2
Source File: Check.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");
    warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 3
Source File: Check.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    log = Log.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    infer = Infer.instance(context);
    this.types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    complexInference = options.isSet(COMPLEXINFERENCE);
    skipAnnotations = options.isSet("skipAnnotations");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.immediateHandler;
}
 
Example 4
Source File: Check.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");
    warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 5
Source File: Check.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    typeAnnotations = TypeAnnotations.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    fileManager = context.get(JavaFileManager.class);

    source = Source.instance(context);
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    allowPrivateSafeVarargs = source.allowPrivateSafeVarargs();
    allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
    warnOnAnyAccessToMembers = options.isSet("warnOnAccessToMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseRemoval = lint.isEnabled(LintCategory.REMOVAL);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean enforceMandatoryWarnings = true;

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    removalHandler = new MandatoryWarningHandler(log, verboseRemoval,
            enforceMandatoryWarnings, "removal", LintCategory.REMOVAL);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, false,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 6
Source File: Check.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");
    warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 7
Source File: Check.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    log = Log.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    infer = Infer.instance(context);
    this.types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    complexInference = options.isSet(COMPLEXINFERENCE);
    skipAnnotations = options.isSet("skipAnnotations");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.immediateHandler;
}
 
Example 8
Source File: Check.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    typeAnnotations = TypeAnnotations.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    fileManager = context.get(JavaFileManager.class);

    source = Source.instance(context);
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    allowPrivateSafeVarargs = source.allowPrivateSafeVarargs();
    allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
    warnOnAnyAccessToMembers = options.isSet("warnOnAccessToMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseRemoval = lint.isEnabled(LintCategory.REMOVAL);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean enforceMandatoryWarnings = true;

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    removalHandler = new MandatoryWarningHandler(log, verboseRemoval,
            enforceMandatoryWarnings, "removal", LintCategory.REMOVAL);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, false,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 9
Source File: Check.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");
    warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 10
Source File: Check.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}
 
Example 11
Source File: Check.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Check(Context context) {
    context.put(checkKey, this);

    names = Names.instance(context);
    dfltTargetMeta = new Name[] { names.PACKAGE, names.TYPE,
        names.FIELD, names.METHOD, names.CONSTRUCTOR,
        names.ANNOTATION_TYPE, names.LOCAL_VARIABLE, names.PARAMETER};
    log = Log.instance(context);
    rs = Resolve.instance(context);
    syms = Symtab.instance(context);
    enter = Enter.instance(context);
    deferredAttr = DeferredAttr.instance(context);
    infer = Infer.instance(context);
    types = Types.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    Options options = Options.instance(context);
    lint = Lint.instance(context);
    treeinfo = TreeInfo.instance(context);
    fileManager = context.get(JavaFileManager.class);

    Source source = Source.instance(context);
    allowGenerics = source.allowGenerics();
    allowVarargs = source.allowVarargs();
    allowAnnotations = source.allowAnnotations();
    allowCovariantReturns = source.allowCovariantReturns();
    allowSimplifiedVarargs = source.allowSimplifiedVarargs();
    allowDefaultMethods = source.allowDefaultMethods();
    allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
    complexInference = options.isSet("complexinference");
    warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
    suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
    enableSunApiLintControl = options.isSet("enableSunApiLintControl");

    Target target = Target.instance(context);
    syntheticNameChar = target.syntheticNameChar();

    profile = Profile.instance(context);

    boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
    boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
    boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
    boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();

    deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
            enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
    uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
            enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
    sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
            enforceMandatoryWarnings, "sunapi", null);

    deferredLintHandler = DeferredLintHandler.instance(context);
}