Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tflobbe committed Oct 3, 2023
1 parent ca6f474 commit 1b4d06f
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,19 @@ public static BackupProperties readFrom(

private static Map<String, String> extractExtraProperties(Properties props) {
Map<String, String> extraProperties = new HashMap<>();
props.forEach(
(key, value) -> {
String entryKey = key.toString();
if (entryKey.startsWith(EXTRA_PROPERTY_PREFIX)) {
extraProperties.put(
entryKey.substring(EXTRA_PROPERTY_PREFIX.length()), String.valueOf(value));
props.remove(key);
}
});
props
.entrySet()
.removeIf(
e -> {
String entryKey = e.getKey().toString();
if (entryKey.startsWith(EXTRA_PROPERTY_PREFIX)) {
extraProperties.put(
entryKey.substring(EXTRA_PROPERTY_PREFIX.length()),
String.valueOf(e.getValue()));
return true;
}
return false;
});
return extraProperties;
}

Expand Down

0 comments on commit 1b4d06f

Please sign in to comment.