This commit is contained in:
Sebastian Stenzel
2017-06-28 11:10:35 +02:00
parent 4de1ac6e40
commit 4e5edc834f
4 changed files with 19 additions and 18 deletions

View File

@@ -48,7 +48,7 @@ public final class LazyInitializer {
try {
return reference.updateAndGet(invokeFactoryIfNull(factory));
} catch (InitializationException e) {
Throwables.throwIfUnchecked(e);
Throwables.throwIfUnchecked(e.getCause());
Throwables.throwIfInstanceOf(e.getCause(), exceptionType);
throw e;
}
@@ -61,7 +61,6 @@ public final class LazyInitializer {
try {
return factory.get();
} catch (Exception e) {
Throwables.throwIfUnchecked(e); // don't catch unchecked exceptions
throw new InitializationException(e);
}
} else {