Source:
<code>public void typeProcess(TypeElement e, TreePath p) { if (e == null || p == null) { <START> throw new BugInCF("SourceChecker.typeProcess: e=%s, p=%s", e, p); <END> } Context context = ((JavacProcessingEnvironment) processingEnv).getContext(); Source source = Source.instance(context); if (!warnedAboutSourceLevel && source.compareTo(Source.lookup("8")) < 0) { messager.printMessage( javax.tools.Diagnostic.Kind.WARNING, "-source " + source.name + " does not support type annotations"); warnedAboutSourceLevel = true; } Log log = Log.instance(context); if (log.nerrors > this.errsOnLastExit) { this.errsOnLastExit = log.nerrors; previousErrorCompilationUnit = p.getCompilationUnit(); return; } if (p.getCompilationUnit() == previousErrorCompilationUnit) { return; } else { previousErrorCompilationUnit = null; } if (visitor == null) { return; } if (p.getCompilationUnit() != currentRoot) { setRoot(p.getCompilationUnit()); if (hasOption("filenames")) { message(Kind.NOTE, new java.util.Date().toString()); message( Kind.NOTE, "%s is type-checking %s", (Object) this.getClass().getSimpleName(), currentRoot.getSourceFile().getName()); } } try { visitor.visit(p); warnUnneededSuppressions(); } catch (UserError ce) { logUserError(ce); } catch (BugInCF ce) { logBugInCF(ce); } catch (Throwable t) { logBugInCF(wrapThrowableAsBugInCF("SourceChecker.typeProcess", t, p)); } finally { this.errsOnLastExit = log.nerrors; } }</code><technical_language>BugInCF here, is of try/catch do useful it. in event this happen, ugly stack trace shown. previous code produces separate understandable errors, preferable. this change</technical_language>

Target:
public void typeProcess(TypeElement e, TreePath p) { if (e == null) { messager.printMessage( javax.tools.Diagnostic.Kind.ERROR, "Refusing to process empty TypeElement"); return; } if (p == null) { messager.printMessage( javax.tools.Diagnostic.Kind.ERROR, "Refusing to process empty TreePath in TypeElement: " + e); return; } Context context = ((JavacProcessingEnvironment) processingEnv).getContext(); Source source = Source.instance(context); if (!warnedAboutSourceLevel && source.compareTo(Source.lookup("8")) < 0) { messager.printMessage( javax.tools.Diagnostic.Kind.WARNING, "-source " + source.name + " does not support type annotations"); warnedAboutSourceLevel = true; } Log log = Log.instance(context); if (log.nerrors > this.errsOnLastExit) { this.errsOnLastExit = log.nerrors; previousErrorCompilationUnit = p.getCompilationUnit(); return; } if (p.getCompilationUnit() == previousErrorCompilationUnit) { return; } else { previousErrorCompilationUnit = null; } if (visitor == null) { return; } if (p.getCompilationUnit() != currentRoot) { setRoot(p.getCompilationUnit()); if (hasOption("filenames")) { message(Kind.NOTE, new java.util.Date().toString()); message( Kind.NOTE, "%s is type-checking %s", (Object) this.getClass().getSimpleName(), currentRoot.getSourceFile().getName()); } } try { visitor.visit(p); warnUnneededSuppressions(); } catch (UserError ce) { logUserError(ce); } catch (BugInCF ce) { logBugInCF(ce); } catch (Throwable t) { logBugInCF(wrapThrowableAsBugInCF("SourceChecker.typeProcess", t, p)); } finally { this.errsOnLastExit = log.nerrors; } }