langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Fri Dec 16 12:08:46 2016 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Fri Dec 16 15:27:34 2016 +0000
@@ -97,15 +97,12 @@
/* Internal version of call exposing Main.Result. */
public Main.Result doCall() {
try {
- return handleExceptions(new Callable<Main.Result>() {
- @Override
- public Main.Result call() throws Exception {
- prepareCompiler(false);
- if (compiler.errorCount() > 0)
- return Main.Result.ERROR;
- compiler.compile(args.getFileObjects(), args.getClassNames(), processors);
- return (compiler.errorCount() > 0) ? Main.Result.ERROR : Main.Result.OK; // FIXME?
- }
+ return handleExceptions(() -> {
+ prepareCompiler(false);
+ if (compiler.errorCount() > 0)
+ return Main.Result.ERROR;
+ compiler.compile(args.getFileObjects(), args.getClassNames(), processors);
+ return (compiler.errorCount() > 0) ? Main.Result.ERROR : Main.Result.OK; // FIXME?
}, Main.Result.SYSERR, Main.Result.ABNORMAL);
} finally {
try {
@@ -228,12 +225,7 @@
@Override @DefinedBy(Api.COMPILER_TREE)
public Iterable<? extends CompilationUnitTree> parse() {
- return handleExceptions(new Callable<Iterable<? extends CompilationUnitTree>>() {
- @Override
- public Iterable<? extends CompilationUnitTree> call() {
- return parseInternal();
- }
- }, List.<CompilationUnitTree>nil(), List.<CompilationUnitTree>nil());
+ return handleExceptions(this::parseInternal, List.<CompilationUnitTree>nil(), List.<CompilationUnitTree>nil());
}
private Iterable<? extends CompilationUnitTree> parseInternal() {
@@ -360,12 +352,7 @@
@Override @DefinedBy(Api.COMPILER_TREE)
public Iterable<? extends Element> analyze() {
- return handleExceptions(new Callable<Iterable<? extends Element>>() {
- @Override
- public Iterable<? extends Element> call() {
- return analyze(null);
- }
- }, List.<Element>nil(), List.<Element>nil());
+ return handleExceptions(() -> analyze(null), List.<Element>nil(), List.<Element>nil());
}
/**
@@ -427,12 +414,7 @@
@Override @DefinedBy(Api.COMPILER_TREE)
public Iterable<? extends JavaFileObject> generate() {
- return handleExceptions(new Callable<Iterable<? extends JavaFileObject>>() {
- @Override
- public Iterable<? extends JavaFileObject> call() {
- return generate(null);
- }
- }, List.<JavaFileObject>nil(), List.<JavaFileObject>nil());
+ return handleExceptions(() -> generate(null), List.<JavaFileObject>nil(), List.<JavaFileObject>nil());
}
/**