com.sun.tools.javac.api.MultiTaskListener Java Examples

The following examples show how to use com.sun.tools.javac.api.MultiTaskListener. 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: ReusableContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void clear() {
    drop(Arguments.argsKey);
    drop(DiagnosticListener.class);
    drop(Log.outKey);
    drop(Log.errKey);
    drop(JavaFileManager.class);
    drop(JavacTask.class);

    if (ht.get(Log.logKey) instanceof ReusableLog) {
        //log already inited - not first round
        ((ReusableLog)Log.instance(this)).clear();
        Enter.instance(this).newRound();
        ((ReusableJavaCompiler)ReusableJavaCompiler.instance(this)).clear();
        Types.instance(this).newRound();
        Check.instance(this).newRound();
        Modules.instance(this).newRound();
        Annotate.instance(this).newRound();
        CompileStates.instance(this).clear();
        MultiTaskListener.instance(this).clear();

        //find if any of the roots have redefined java.* classes
        Symtab syms = Symtab.instance(this);
        pollutionScanner.scan(roots, syms);
        roots.clear();
    }
}
 
Example #2
Source File: JavacProcessingEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #3
Source File: JavacProcessingEnvironment.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #4
Source File: JavacProcessingEnvironment.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #5
Source File: JavacProcessingEnvironment.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #6
Source File: JavacProcessingEnvironment.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #7
Source File: JavacProcessingEnvironment.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #8
Source File: JavacProcessingEnvironment.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(XPRINTPROCESSORINFO);
    printRounds = options.isSet(XPRINTROUNDS);
    verbose = options.isSet(VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    if (options.isSet(PROC, "only") || options.isSet(XPRINT)) {
        JavaCompiler compiler = JavaCompiler.instance(context);
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(WERROR);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    processorOptions = initProcessorOptions(context);
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    initProcessorClassLoader();
}
 
Example #9
Source File: JavacProcessingEnvironment.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(Option.XPRINTPROCESSORINFO);
    printRounds = options.isSet(Option.XPRINTROUNDS);
    verbose = options.isSet(Option.VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    compiler = JavaCompiler.instance(context);
    if (options.isSet(Option.PROC, "only") || options.isSet(Option.XPRINT)) {
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(Option.WERROR);
    fileManager = context.get(JavaFileManager.class);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    modules = Modules.instance(context);
    types = Types.instance(context);
    annotate = Annotate.instance(context);
    processorOptions = initProcessorOptions();
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    symtab = Symtab.instance(context);
    names = Names.instance(context);
    enter = Enter.instance(context);
    initialCompleter = ClassFinder.instance(context).getCompleter();
    chk = Check.instance(context);
    initProcessorLoader();

    allowModules = source.allowModules();
}
 
Example #10
Source File: JavacProcessingEnvironment.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected JavacProcessingEnvironment(Context context) {
    this.context = context;
    context.put(JavacProcessingEnvironment.class, this);
    log = Log.instance(context);
    source = Source.instance(context);
    diags = JCDiagnostic.Factory.instance(context);
    options = Options.instance(context);
    printProcessorInfo = options.isSet(Option.XPRINTPROCESSORINFO);
    printRounds = options.isSet(Option.XPRINTROUNDS);
    verbose = options.isSet(Option.VERBOSE);
    lint = Lint.instance(context).isEnabled(PROCESSING);
    compiler = JavaCompiler.instance(context);
    if (options.isSet(Option.PROC, "only") || options.isSet(Option.XPRINT)) {
        compiler.shouldStopPolicyIfNoError = CompileState.PROCESS;
    }
    fatalErrors = options.isSet("fatalEnterError");
    showResolveErrors = options.isSet("showResolveErrors");
    werror = options.isSet(Option.WERROR);
    fileManager = context.get(JavaFileManager.class);
    platformAnnotations = initPlatformAnnotations();

    // Initialize services before any processors are initialized
    // in case processors use them.
    filer = new JavacFiler(context);
    messager = new JavacMessager(context, this);
    elementUtils = JavacElements.instance(context);
    typeUtils = JavacTypes.instance(context);
    modules = Modules.instance(context);
    types = Types.instance(context);
    annotate = Annotate.instance(context);
    processorOptions = initProcessorOptions();
    unmatchedProcessorOptions = initUnmatchedProcessorOptions();
    messages = JavacMessages.instance(context);
    taskListener = MultiTaskListener.instance(context);
    symtab = Symtab.instance(context);
    names = Names.instance(context);
    enter = Enter.instance(context);
    initialCompleter = ClassFinder.instance(context).getCompleter();
    chk = Check.instance(context);
    initProcessorLoader();

    allowModules = source.allowModules();
}