diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java index 19bd5dab22..b1125e588c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java @@ -3189,25 +3189,25 @@ public void addTags(Properties prop) { if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_SYSTEM)) { String systemTags = prop.getProperty(CommonConfigurationKeys .HADOOP_TAGS_SYSTEM); - Arrays.stream(systemTags.split(",")).forEach(tag -> TAGS.add(tag)); + TAGS.addAll(Arrays.asList(systemTags.split(","))); } // Get all custom tags if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_CUSTOM)) { String customTags = prop.getProperty(CommonConfigurationKeys .HADOOP_TAGS_CUSTOM); - Arrays.stream(customTags.split(",")).forEach(tag -> TAGS.add(tag)); + TAGS.addAll(Arrays.asList(customTags.split(","))); } if (prop.containsKey(CommonConfigurationKeys.HADOOP_SYSTEM_TAGS)) { String systemTags = prop.getProperty(CommonConfigurationKeys .HADOOP_SYSTEM_TAGS); - Arrays.stream(systemTags.split(",")).forEach(tag -> TAGS.add(tag)); + TAGS.addAll(Arrays.asList(systemTags.split(","))); } // Get all custom tags if (prop.containsKey(CommonConfigurationKeys.HADOOP_CUSTOM_TAGS)) { String customTags = prop.getProperty(CommonConfigurationKeys .HADOOP_CUSTOM_TAGS); - Arrays.stream(customTags.split(",")).forEach(tag -> TAGS.add(tag)); + TAGS.addAll(Arrays.asList(customTags.split(","))); } } catch (Exception ex) {