mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
Run automatic Java 8 conversion over codebase
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171174380
This commit is contained in:
parent
44df5da771
commit
5edb7935ed
190 changed files with 2312 additions and 3096 deletions
|
@ -95,21 +95,19 @@ final class Router {
|
|||
}
|
||||
|
||||
private static Function<Object, ?> newInstantiator(final Method method) {
|
||||
return new Function<Object, Object>() {
|
||||
@Override
|
||||
public Object apply(Object component) {
|
||||
try {
|
||||
return method.invoke(component);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(
|
||||
"Error reflectively accessing component's @Action factory method", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
// This means an exception was thrown during the injection process while instantiating
|
||||
// the @Action class; we should propagate that underlying exception.
|
||||
throwIfUnchecked(e.getCause());
|
||||
throw new AssertionError(
|
||||
"Component's @Action factory method somehow threw checked exception", e);
|
||||
}
|
||||
}};
|
||||
return component -> {
|
||||
try {
|
||||
return method.invoke(component);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(
|
||||
"Error reflectively accessing component's @Action factory method", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
// This means an exception was thrown during the injection process while instantiating
|
||||
// the @Action class; we should propagate that underlying exception.
|
||||
throwIfUnchecked(e.getCause());
|
||||
throw new AssertionError(
|
||||
"Component's @Action factory method somehow threw checked exception", e);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue