Java Code Examples for com.sun.tools.javac.api.BasicJavacTask#getContext()

The following examples show how to use com.sun.tools.javac.api.BasicJavacTask#getContext() . 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: AbstractCodingRulesAnalyzer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 2
Source File: AbstractCodingRulesAnalyzer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 3
Source File: AbstractCodingRulesAnalyzer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 4
Source File: AbstractCodingRulesAnalyzer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 5
Source File: AbstractCodingRulesAnalyzer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public AbstractCodingRulesAnalyzer(JavacTask task) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    options = Options.instance(context);
    rawDiagnostics = options.isSet("rawDiagnostics");
    diags = JCDiagnostic.Factory.instance(context);
    messages = new Messages();
    syms = Symtab.instance(context);
    elements = JavacElements.instance(context);
    types = JavacTypes.instance(context);
}
 
Example 6
Source File: CodingRulesAnalyzerPlugin.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@DefinedBy(Api.COMPILER_TREE)
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    task.addTaskListener(new PostAnalyzeTaskListener(
            new MutableFieldsAnalyzer(task),
            new AssertCheckAnalyzer(task),
            new DefinedByAnalyzer(task)
    ));
}
 
Example 7
Source File: AbstractCodingRulesAnalyzer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 8
Source File: AbstractCodingRulesAnalyzer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 9
Source File: AbstractCodingRulesAnalyzer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(JavacTask task, String... args) {
    BasicJavacTask impl = (BasicJavacTask)task;
    Context context = impl.getContext();
    log = Log.instance(context);
    trees = Trees.instance(task);
    messages = new Messages();
    task.addTaskListener(new PostAnalyzeTaskListener());
}
 
Example 10
Source File: ClassSymbols.java    From manifold with Apache License 2.0 4 votes vote down vote up
public Pair<Symbol.ClassSymbol, JCTree.JCCompilationUnit> getClassSymbol( BasicJavacTask javacTask, TypeProcessor tp, String fqn )
{
  Context ctx = tp == null ? javacTask.getContext() : tp.getContext();
  JCTree.JCCompilationUnit cu = tp == null ? null : (JCTree.JCCompilationUnit)tp.getCompilationUnit();
  return getClassSymbol( ctx, cu, fqn );
}