+ (usePrintSource ? " source" : "code")
+ " " + cdef.sym + "]");
}
if (taskListener != null) {
TaskEvent e = new TaskEvent(TaskEvent.Kind.GENERATE, env.toplevel, cdef.sym);
taskListener.started(e);
}
JavaFileObject prev = log.useSource(env.enclClass.sym.sourcefile != null ?
env.enclClass.sym.sourcefile :
env.toplevel.sourcefile);
try {
JavaFileObject file;
if (usePrintSource)
file = printSource(env, cdef);
else
file = genCode(env, cdef);
if (results != null && file != null)
results.add(file);
} catch (IOException ex) {
log.error(cdef.pos(), "class.cant.write",
cdef.sym, ex.getMessage());
return;
} finally {
log.useSource(prev);
}
if (taskListener != null) {
TaskEvent e = new TaskEvent(TaskEvent.Kind.GENERATE, env.toplevel, cdef.sym);
taskListener.finished(e);
}
}
}