提交 99f43d6f 编写于 作者: A alanb

8031394: (sl) Fix exception handling in ServiceLoader

Reviewed-by: ahgross, mchung, weijun
上级 b40cbb6b
......@@ -382,7 +382,7 @@ public final class ServiceLoader<S>
return p;
} catch (Throwable x) {
fail(service,
"Provider " + cn + " could not be instantiated: " + x,
"Provider " + cn + " could not be instantiated",
x);
}
throw new Error(); // This cannot happen
......
......@@ -299,7 +299,7 @@ public final class Service<S> {
return service.cast(c.newInstance());
} catch (Throwable x) {
fail(service,
"Provider " + cn + " could not be instantiated: " + x,
"Provider " + cn + " could not be instantiated",
x);
}
return null; /* This cannot happen */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册