pnowojski commented on a change in pull request #10816: [Flink-15355] Fixed
parsing of plugin parent-first patterns.
URL: https://github.com/apache/flink/pull/10816#discussion_r364750757
##########
File path:
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -147,8 +150,8 @@
public static String[] getPluginParentFirstLoaderPatterns(Configuration
config) {
String base =
config.getString(PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS);
String append =
config.getString(PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL);
-
- return ArrayUtils.concat(base.split(";"), append.split(";"));
+ final Splitter splitter = Splitter.on(';').omitEmptyStrings();
+ return Iterables.toArray(Iterables.concat(splitter.split(base),
splitter.split(append)), String.class);
}
Review comment:
Can you deduplicate this code with `getParentFirstLoaderPatterns`? Provide a
base method `private static String[] getParentFirstLoaderPatterns(String base,
String append)`? Especially that the original method that was copied/duplicated
didn't have the bug.
Also maybe a unit test since this has failed/caused a bug?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services