AHeise commented on a change in pull request #16345:
URL: https://github.com/apache/flink/pull/16345#discussion_r665588202
##########
File path:
flink-core/src/main/java/org/apache/flink/core/classloading/ComponentClassLoader.java
##########
@@ -193,12 +193,30 @@ private boolean isChildFirstResource(final String name) {
throws IOException {
final Iterator<URL> iterator =
Iterators.concat(
- firstClassLoader.apply(name).asIterator(),
- secondClassLoader.apply(name).asIterator());
+ new
EnumerationBackedIterator<>(firstClassLoader.apply(name)),
+ new
EnumerationBackedIterator<>(secondClassLoader.apply(name)));
return new IteratorBackedEnumeration<>(iterator);
}
+ private static class EnumerationBackedIterator<T> implements Iterator<T> {
Review comment:
You could also use Guava's `Iterators#forEnumeration`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]