Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,21 @@ public <ClusterID> ClusterClientFactory<ClusterID> getClusterClientFactory(

final List<ClusterClientFactory> compatibleFactories = new ArrayList<>();
final Iterator<ClusterClientFactory> factories = loader.iterator();
while (factories.hasNext()) {
while (true) {
try {
// hasNext might lead to error in java 24, 25
// for more details take a look at https://bugs.openjdk.org/browse/JDK-8196182
// and https://bugs.openjdk.org/browse/JDK-8350481
if (!factories.hasNext()) {
break;
}
final ClusterClientFactory factory = factories.next();
if (factory != null && factory.isCompatibleWith(configuration)) {
compatibleFactories.add(factory);
}
} catch (Throwable e) {
if (e.getCause() instanceof NoClassDefFoundError) {
if (e instanceof NoClassDefFoundError
|| e.getCause() instanceof NoClassDefFoundError) {
LOG.info("Could not load factory due to missing dependencies.");
} else {
throw e;
Expand Down Expand Up @@ -98,16 +105,22 @@ public Stream<String> getApplicationModeTargetNames() {
final List<String> result = new ArrayList<>();

final Iterator<ClusterClientFactory> it = loader.iterator();
while (it.hasNext()) {
while (true) {
try {
// hasNext might lead to error in java 24, 25
// for more details take a look at https://bugs.openjdk.org/browse/JDK-8196182
// and https://bugs.openjdk.org/browse/JDK-8350481
if (!it.hasNext()) {
break;
}
final ClusterClientFactory clientFactory = it.next();

final Optional<String> applicationName = clientFactory.getApplicationTargetName();
if (applicationName.isPresent()) {
result.add(applicationName.get());
}

} catch (ServiceConfigurationError e) {
} catch (ServiceConfigurationError | NoClassDefFoundError e) {
// cannot be loaded, most likely because Hadoop is not
// in the classpath, we can ignore it for now.
}
Expand Down