1.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Feb 28 10:25:53 2012 -0800 1.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Feb 28 10:33:49 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -44,6 +44,7 @@ 1.11 import com.sun.tools.javac.comp.*; 1.12 import com.sun.tools.javac.file.JavacFileManager; 1.13 import com.sun.tools.javac.main.*; 1.14 +import com.sun.tools.javac.main.JavaCompiler; 1.15 import com.sun.tools.javac.model.*; 1.16 import com.sun.tools.javac.parser.Parser; 1.17 import com.sun.tools.javac.parser.ParserFactory; 1.18 @@ -51,7 +52,6 @@ 1.19 import com.sun.tools.javac.tree.JCTree.*; 1.20 import com.sun.tools.javac.util.*; 1.21 import com.sun.tools.javac.util.List; 1.22 -import com.sun.tools.javac.main.JavaCompiler; 1.23 1.24 /** 1.25 * Provides access to functionality specific to the JDK Java Compiler, javac. 1.26 @@ -64,18 +64,16 @@ 1.27 * @author Peter von der Ahé 1.28 * @author Jonathan Gibbons 1.29 */ 1.30 -public class JavacTaskImpl extends JavacTask { 1.31 +public class JavacTaskImpl extends BasicJavacTask { 1.32 private ClientCodeWrapper ccw; 1.33 private Main compilerMain; 1.34 private JavaCompiler compiler; 1.35 private Locale locale; 1.36 private String[] args; 1.37 private String[] classNames; 1.38 - private Context context; 1.39 private List<JavaFileObject> fileObjects; 1.40 private Map<JavaFileObject, JCCompilationUnit> notYetEntered; 1.41 private ListBuffer<Env<AttrContext>> genList; 1.42 - private TaskListener taskListener; 1.43 private AtomicBoolean used = new AtomicBoolean(); 1.44 private Iterable<? extends Processor> processors; 1.45 1.46 @@ -86,6 +84,7 @@ 1.47 String[] classNames, 1.48 Context context, 1.49 List<JavaFileObject> fileObjects) { 1.50 + super(null, false); 1.51 this.ccw = ClientCodeWrapper.instance(context); 1.52 this.compilerMain = compilerMain; 1.53 this.args = args; 1.54 @@ -190,11 +189,7 @@ 1.55 } 1.56 1.57 private void initContext() { 1.58 - context.put(JavacTaskImpl.class, this); 1.59 - if (context.get(TaskListener.class) != null) 1.60 - context.put(TaskListener.class, (TaskListener)null); 1.61 - if (taskListener != null) 1.62 - context.put(TaskListener.class, ccw.wrap(taskListener)); 1.63 + context.put(JavacTask.class, this); 1.64 //initialize compiler's default locale 1.65 context.put(Locale.class, locale); 1.66 } 1.67 @@ -224,10 +219,6 @@ 1.68 return fm.getRegularFile(file); 1.69 } 1.70 1.71 - public void setTaskListener(TaskListener taskListener) { 1.72 - this.taskListener = taskListener; 1.73 - } 1.74 - 1.75 /** 1.76 * Parse the specified files returning a list of abstract syntax trees. 1.77 *