Adjusting to NB-JDK8 changes jdk8
authorJan Lahoda <jlahoda@netbeans.org>
Sun, 03 Feb 2013 00:13:11 +0100
branchjdk8
changeset 926d1e1adedc8cc
parent 925 9132c333319f
child 935 81e13ebd29cf
Adjusting to NB-JDK8 changes
cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingImpl.java
     1.1 --- a/cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingImpl.java	Sun Feb 03 00:11:08 2013 +0100
     1.2 +++ b/cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingImpl.java	Sun Feb 03 00:13:11 2013 +0100
     1.3 @@ -38,11 +38,13 @@
     1.4   */
     1.5  package org.netbeans.modules.jackpot30.compiler;
     1.6  
     1.7 +import com.sun.source.util.JavacTask;
     1.8  import com.sun.source.util.TaskEvent;
     1.9  import com.sun.source.util.TaskListener;
    1.10  import com.sun.source.util.TreePath;
    1.11  import com.sun.source.util.Trees;
    1.12  import com.sun.tools.javac.api.JavacTrees;
    1.13 +import com.sun.tools.javac.api.MultiTaskListener;
    1.14  import com.sun.tools.javac.jvm.Gen;
    1.15  import com.sun.tools.javac.parser.ParserFactory;
    1.16  import com.sun.tools.javac.processing.JavacProcessingEnvironment;
    1.17 @@ -112,10 +114,8 @@
    1.18          }
    1.19  
    1.20          Context c = ((JavacProcessingEnvironment) processingEnv).getContext();
    1.21 -        TaskListener prev = c.get(TaskListener.class);
    1.22 -
    1.23 -        c.put(TaskListener.class, (TaskListener) null);
    1.24 -        c.put(TaskListener.class, new TaskListenerImpl(prev));
    1.25 +        
    1.26 +        MultiTaskListener.instance(c).add(new TaskListenerImpl());
    1.27      }
    1.28  
    1.29      @Override
    1.30 @@ -222,25 +222,14 @@
    1.31  
    1.32      private final class TaskListenerImpl implements TaskListener {
    1.33  
    1.34 -        private final TaskListener delegate;
    1.35 -
    1.36 -        public TaskListenerImpl(TaskListener delegate) {
    1.37 -            this.delegate = delegate;
    1.38 -        }
    1.39 +        public TaskListenerImpl() { }
    1.40  
    1.41          @Override
    1.42          public void started(TaskEvent te) {
    1.43 -            if (delegate != null) {
    1.44 -                delegate.started(te);
    1.45 -            }
    1.46          }
    1.47  
    1.48          @Override
    1.49          public void finished(TaskEvent te) {
    1.50 -            if (delegate != null) {
    1.51 -                delegate.finished(te);
    1.52 -            }
    1.53 -
    1.54              if (te.getKind() == TaskEvent.Kind.ANALYZE) {
    1.55                  TypeElement toProcess = te.getTypeElement();
    1.56