private void initContext() {
   context.put(JavacTaskImpl.class, this);
   if (context.get(TaskListener.class) != null)
     context.put(TaskListener.class, (TaskListener) null);
   if (taskListener != null) context.put(TaskListener.class, ccw.wrap(taskListener));
   // initialize compiler's default locale
   context.put(Locale.class, locale);
 }
 /**
  * Construct a JavaFileObject from the given file.
  *
  * <p><b>TODO: this method is useless here</b>
  *
  * @param file a file
  * @return a JavaFileObject from the standard file manager.
  */
 public JavaFileObject asJavaFileObject(File file) {
   JavacFileManager fm = (JavacFileManager) context.get(JavaFileManager.class);
   return fm.getRegularFile(file);
 }