private void runLastRound(PrintWriter xout, int roundNumber, boolean errorStatus, TaskListener taskListener) throws IOException { roundNumber++; List<ClassSymbol> noTopLevelClasses = List.nil(); Set<TypeElement> noAnnotations = Collections.emptySet(); printRoundInfo(xout, roundNumber, noTopLevelClasses, noAnnotations, true); Set<Element> emptyRootElements = Collections.emptySet(); // immutable RoundEnvironment renv = new JavacRoundEnvironment(true, errorStatus, emptyRootElements, JavacProcessingEnvironment.this); if (taskListener != null) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); try { discoveredProcs.iterator().runContributingProcs(renv); } finally { if (taskListener != null) taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); } }
/** Run a processing round. */ void run(boolean lastRound, boolean errorStatus) { printRoundInfo(lastRound); if (!taskListener.isEmpty()) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); try { if (lastRound) { filer.setLastRound(true); Set<Element> emptyRootElements = Collections.emptySet(); // immutable RoundEnvironment renv = new JavacRoundEnvironment(true, errorStatus, emptyRootElements, JavacProcessingEnvironment.this); discoveredProcs.iterator().runContributingProcs(renv); } else { discoverAndRunProcs(context, annotationsPresent, topLevelClasses, packageInfoFiles); } } catch (Throwable t) { // we're specifically expecting Abort here, but if any Throwable // comes by, we should flush all deferred diagnostics, rather than // drop them on the ground. deferredDiagnosticHandler.reportDeferredDiagnostics(); log.popDiagnosticHandler(deferredDiagnosticHandler); throw t; } finally { if (!taskListener.isEmpty()) taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); } }
/** Run a processing round. */ void run(boolean lastRound, boolean errorStatus) { printRoundInfo(lastRound); if (!taskListener.isEmpty()) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); try { if (lastRound) { filer.setLastRound(true); Set<Element> emptyRootElements = Collections.emptySet(); // immutable RoundEnvironment renv = new JavacRoundEnvironment(true, errorStatus, emptyRootElements, JavacProcessingEnvironment.this); discoveredProcs.iterator().runContributingProcs(renv); } else { discoverAndRunProcs(context, annotationsPresent, topLevelClasses, packageInfoFiles); } } catch (Throwable t) { // we're specifically expecting Abort here, but if any Throwable // comes by, we should flush all deferred diagnostics, rather than // drop them on the ground. deferredDiagnosticHandler.reportDeferredDiagnostics(); log.popDiagnosticHandler(deferredDiagnosticHandler); throw t; } finally { if (!taskListener.isEmpty()) taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); } }
/** * Attribute a parse tree. * @returns the attributed parse tree */ public Env<AttrContext> attribute(Env<AttrContext> env) { if (verboseCompilePolicy) log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]"); if (verbose) printVerbose("checking.attribution", env.enclClass.sym); if (taskListener != null) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym); taskListener.started(e); } JavaFileObject prev = log.useSource( env.enclClass.sym.sourcefile != null ? env.enclClass.sym.sourcefile : env.toplevel.sourcefile); try { attr.attribClass(env.tree.pos(), env.enclClass.sym); } finally { log.useSource(prev); } return env; }
TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym); taskListener.finished(e);
TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym); taskListener.finished(e);
genEndPos = true; if (!taskListener.isEmpty()) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING)); deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log); } else { // free resources
/** * Attribute a parse tree. * @returns the attributed parse tree */ public Env<AttrContext> attribute(Env<AttrContext> env) { if (compileStates.isDone(env, CompileState.ATTR)) return env; if (verboseCompilePolicy) log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]"); if (verbose) printVerbose("checking.attribution", env.enclClass.sym); if (taskListener != null) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym); taskListener.started(e); } JavaFileObject prev = log.useSource( env.enclClass.sym.sourcefile != null ? env.enclClass.sym.sourcefile : env.toplevel.sourcefile); try { attr.attribClass(env.tree.pos(), env.enclClass.sym); compileStates.put(env, CompileState.ATTR); } finally { log.useSource(prev); } return env; }
genEndPos = true; if (!taskListener.isEmpty()) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING)); deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log); } else { // free resources
keepComments = true; if (taskListener != null) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));
keepComments = true; if (taskListener != null) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));
TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym); taskListener.started(e);