112 private int statReused = 0;
113 private int statNew = 0;
114 private int statPolluted = 0;
115 private int statRemoved = 0;
116
117 /**Creates the pool.
118 *
119 * @param maxPoolSize maximum number of tasks/context that will be kept in the pool.
120 */
121 public JavacTaskPool(int maxPoolSize) {
122 this.maxPoolSize = maxPoolSize;
123 }
124
125 /**Creates a new task as if by {@link javax.tools.JavaCompiler#getTask} and runs the provided
126 * worker with it. The task is only valid while the worker is running. The internal structures
127 * may be reused from some previous compilation.
128 *
129 * @param out a Writer for additional output from the compiler;
130 * use {@code System.err} if {@code null}
131 * @param fileManager a file manager; if {@code null} use the
132 * compiler's standard filemanager
133 * @param diagnosticListener a diagnostic listener; if {@code
134 * null} use the compiler's default method for reporting
135 * diagnostics
136 * @param options compiler options, {@code null} means no options
137 * @param classes names of classes to be processed by annotation
138 * processing, {@code null} means no class names
139 * @param compilationUnits the compilation units to compile, {@code
140 * null} means no compilation units
141 * @param worker that should be run with the task
142 * @return an object representing the compilation
143 * @throws RuntimeException if an unrecoverable error
144 * occurred in a user supplied component. The
145 * {@linkplain Throwable#getCause() cause} will be the error in
146 * user code.
147 * @throws IllegalArgumentException if any of the options are invalid,
148 * or if any of the given compilation units are of other kind than
149 * {@linkplain JavaFileObject.Kind#SOURCE source}
150 */
151 public <Z> Z getTask(Writer out,
152 JavaFileManager fileManager,
|
112 private int statReused = 0;
113 private int statNew = 0;
114 private int statPolluted = 0;
115 private int statRemoved = 0;
116
117 /**Creates the pool.
118 *
119 * @param maxPoolSize maximum number of tasks/context that will be kept in the pool.
120 */
121 public JavacTaskPool(int maxPoolSize) {
122 this.maxPoolSize = maxPoolSize;
123 }
124
125 /**Creates a new task as if by {@link javax.tools.JavaCompiler#getTask} and runs the provided
126 * worker with it. The task is only valid while the worker is running. The internal structures
127 * may be reused from some previous compilation.
128 *
129 * @param out a Writer for additional output from the compiler;
130 * use {@code System.err} if {@code null}
131 * @param fileManager a file manager; if {@code null} use the
132 * compiler's standard file manager
133 * @param diagnosticListener a diagnostic listener; if {@code
134 * null} use the compiler's default method for reporting
135 * diagnostics
136 * @param options compiler options, {@code null} means no options
137 * @param classes names of classes to be processed by annotation
138 * processing, {@code null} means no class names
139 * @param compilationUnits the compilation units to compile, {@code
140 * null} means no compilation units
141 * @param worker that should be run with the task
142 * @return an object representing the compilation
143 * @throws RuntimeException if an unrecoverable error
144 * occurred in a user supplied component. The
145 * {@linkplain Throwable#getCause() cause} will be the error in
146 * user code.
147 * @throws IllegalArgumentException if any of the options are invalid,
148 * or if any of the given compilation units are of other kind than
149 * {@linkplain JavaFileObject.Kind#SOURCE source}
150 */
151 public <Z> Z getTask(Writer out,
152 JavaFileManager fileManager,
|