Resolve RED-9472 "Feature/" #537

Open
yannik.hampe wants to merge 113 commits from feature/RED-9472 into master
Showing only changes of commit 88155dc211 - Show all commits

View File

@ -75,17 +75,14 @@ public class RuleFileBluePrint {
Set<String> newGlobals = Arrays.stream(other.getGlobals().split("\n"))
.map(String::trim)
.filter(line -> !line.isEmpty())
.map(line -> line.startsWith(GLOBAL_PREFIX) ? line : GLOBAL_PREFIX + line)
.collect(Collectors.toCollection(LinkedHashSet::new));
// Combine globals while maintaining order and format
StringBuilder globalsBuilder = new StringBuilder();
Stream.concat(existingGlobals.stream(), newGlobals.stream())
.distinct()
.forEach(global -> {
if (!global.startsWith(GLOBAL_PREFIX)) {
global = GLOBAL_PREFIX + global;
}
globalsBuilder.append(global).append("\n");
});
.forEach(globalLine -> globalsBuilder.append(globalLine).append("\n"));
this.globals = globalsBuilder.toString().trim();
}