Use lambdas for map entry iteration where possible
See gh-12626
This commit is contained in:
committed by
Phillip Webb
parent
78a94cafe1
commit
69bc19e0ca
@@ -22,7 +22,6 @@ import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@@ -79,10 +78,7 @@ public final class BuildPropertiesWriter {
|
||||
DateTimeFormatter.ISO_INSTANT.format(project.getTime()));
|
||||
}
|
||||
if (project.getAdditionalProperties() != null) {
|
||||
for (Map.Entry<String, String> entry : project.getAdditionalProperties()
|
||||
.entrySet()) {
|
||||
properties.put("build." + entry.getKey(), entry.getValue());
|
||||
}
|
||||
project.getAdditionalProperties().forEach((key, value) -> properties.put("build." + key, value));
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
@@ -118,11 +114,11 @@ public final class BuildPropertiesWriter {
|
||||
private static void validateAdditionalProperties(
|
||||
Map<String, String> additionalProperties) {
|
||||
if (additionalProperties != null) {
|
||||
for (Entry<String, String> property : additionalProperties.entrySet()) {
|
||||
if (property.getValue() == null) {
|
||||
throw new NullAdditionalPropertyValueException(property.getKey());
|
||||
additionalProperties.forEach((key, value) -> {
|
||||
if (value == null) {
|
||||
throw new NullAdditionalPropertyValueException(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user