RED-9472: seperation of system rules
fixed checkstyle
This commit is contained in:
parent
9cb19fb0f7
commit
88155dc211
@ -75,17 +75,14 @@ public class RuleFileBluePrint {
|
|||||||
Set<String> newGlobals = Arrays.stream(other.getGlobals().split("\n"))
|
Set<String> newGlobals = Arrays.stream(other.getGlobals().split("\n"))
|
||||||
.map(String::trim)
|
.map(String::trim)
|
||||||
.filter(line -> !line.isEmpty())
|
.filter(line -> !line.isEmpty())
|
||||||
|
.map(line -> line.startsWith(GLOBAL_PREFIX) ? line : GLOBAL_PREFIX + line)
|
||||||
.collect(Collectors.toCollection(LinkedHashSet::new));
|
.collect(Collectors.toCollection(LinkedHashSet::new));
|
||||||
|
|
||||||
|
// Combine globals while maintaining order and format
|
||||||
StringBuilder globalsBuilder = new StringBuilder();
|
StringBuilder globalsBuilder = new StringBuilder();
|
||||||
Stream.concat(existingGlobals.stream(), newGlobals.stream())
|
Stream.concat(existingGlobals.stream(), newGlobals.stream())
|
||||||
.distinct()
|
.distinct()
|
||||||
.forEach(global -> {
|
.forEach(globalLine -> globalsBuilder.append(globalLine).append("\n"));
|
||||||
if (!global.startsWith(GLOBAL_PREFIX)) {
|
|
||||||
global = GLOBAL_PREFIX + global;
|
|
||||||
}
|
|
||||||
globalsBuilder.append(global).append("\n");
|
|
||||||
});
|
|
||||||
|
|
||||||
this.globals = globalsBuilder.toString().trim();
|
this.globals = globalsBuilder.toString().trim();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user