if (cu.getKind() != JavaFileObject.Kind.SOURCE) // implicit null check
throw new IllegalArgumentException(kindMsg);
}
}
Context context = new Context();
if (diagnosticListener != null)
context.put(DiagnosticListener.class, diagnosticListener);
if (out == null)
context.put(Log.outKey, new PrintWriter(System.err, true));
else
context.put(Log.outKey, new PrintWriter(out, true));
if (fileManager == null)
fileManager = getStandardFileManager(diagnosticListener, null, null);
context.put(JavaFileManager.class, fileManager);
processOptions(context, fileManager, options);
Main compiler = new Main("javacTask", context.get(Log.outKey));
return new JavacTaskImpl(this, compiler, options, context, classes, compilationUnits);
}