527 else { |
527 else { |
528 if (werror && log.nerrors == 0 && log.nwarnings > 0) { |
528 if (werror && log.nerrors == 0 && log.nwarnings > 0) { |
529 log.error("warnings.and.werror"); |
529 log.error("warnings.and.werror"); |
530 } |
530 } |
531 } |
531 } |
532 return log.nerrors; |
532 return log.nerrors; |
533 } |
533 } |
534 |
534 |
535 protected final <T> Queue<T> stopIfError(CompileState cs, Queue<T> queue) { |
535 protected final <T> Queue<T> stopIfError(CompileState cs, Queue<T> queue) { |
536 return shouldStop(cs) ? ListBuffer.<T>lb() : queue; |
536 return shouldStop(cs) ? ListBuffer.<T>lb() : queue; |
537 } |
537 } |
866 private List<JCClassDecl> rootClasses; |
866 private List<JCClassDecl> rootClasses; |
867 |
867 |
868 /** |
868 /** |
869 * Parses a list of files. |
869 * Parses a list of files. |
870 */ |
870 */ |
871 public List<JCCompilationUnit> parseFiles(List<JavaFileObject> fileObjects) throws IOException { |
871 public List<JCCompilationUnit> parseFiles(Iterable<JavaFileObject> fileObjects) throws IOException { |
872 if (shouldStop(CompileState.PARSE)) |
872 if (shouldStop(CompileState.PARSE)) |
873 return List.nil(); |
873 return List.nil(); |
874 |
874 |
875 //parse all files |
875 //parse all files |
876 ListBuffer<JCCompilationUnit> trees = lb(); |
876 ListBuffer<JCCompilationUnit> trees = lb(); |
979 * @param roots a list of compilation units |
979 * @param roots a list of compilation units |
980 * @return an instance of the compiler in which to complete the compilation |
980 * @return an instance of the compiler in which to complete the compilation |
981 */ |
981 */ |
982 public JavaCompiler processAnnotations(List<JCCompilationUnit> roots, |
982 public JavaCompiler processAnnotations(List<JCCompilationUnit> roots, |
983 List<String> classnames) |
983 List<String> classnames) |
984 throws IOException { // TODO: see TEMP note in JavacProcessingEnvironment |
984 throws IOException { // TODO: see TEMP note in JavacProcessingEnvironment |
985 if (shouldStop(CompileState.PROCESS)) { |
985 if (shouldStop(CompileState.PROCESS)) { |
986 // Errors were encountered. If todo is empty, then the |
986 // Errors were encountered. |
987 // encountered errors were parse errors. Otherwise, the |
987 // If log.unrecoverableError is set, the errors were parse errors |
988 // errors were found during the enter phase which should |
988 // or other errors during enter which cannot be fixed by running |
989 // be ignored when processing annotations. |
989 // any annotation processors. |
990 |
990 if (log.unrecoverableError) |
991 if (todo.isEmpty()) |
|
992 return this; |
991 return this; |
993 } |
992 } |
994 |
993 |
995 // ASSERT: processAnnotations and procEnvImpl should have been set up by |
994 // ASSERT: processAnnotations and procEnvImpl should have been set up by |
996 // by initProcessAnnotations |
995 // by initProcessAnnotations |