Skip to content

Commit 1fa0066

Browse files
committed
Just catch, do not inspect ServiceConfigurationError
1 parent 0e61467 commit 1fa0066

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/main/java/org/cryptomator/integrations/common/IntegrationsLoader.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,10 @@ private static <T> Stream<T> instantiateServiceProvider(ServiceLoader.Provider<T
7474
return Stream.of(provider.get());
7575
} catch (ServiceConfigurationError err) {
7676
//ServiceLoader.Provider::get throws this error if (from javadoc)
77-
if (err.getCause() == null || //the public static "provider()" method of a provider factory returns null
78-
err.getCause() instanceof ExceptionInInitializerError || // * the service provider cannot be instantiated,
79-
err.getCause() instanceof NoClassDefFoundError ||
80-
err.getCause() instanceof RuntimeException) {
81-
LOG.warn("Unable to load service provider {}.", provider.type().getName(), err);
82-
return Stream.empty();
83-
} else {
84-
throw err;
85-
}
77+
// * the public static "provider()" method of a provider factory returns null
78+
// * the service provider cannot be instantiated due to an error/throw
79+
LOG.warn("Unable to load service provider {}.", provider.type().getName(), err);
80+
return Stream.empty();
8681
}
8782
}
8883

0 commit comments

Comments
 (0)