Pull request #211: RSS-292: Fixed incompatible comparision in getLongestBlockOrElse in scm
Merge in RED/redaction-report-service from RSS-292 to master * commit '43566d07b2b0a398063ef676e6823ae3842438d3': RSS-292: Fixed incompatible comparision in getLongestBlockOrElse in scm
This commit is contained in:
commit
57796c7941
@ -594,16 +594,16 @@ public class RSSPoc2Service {
|
||||
|
||||
String transformation = String.format("Longest value of type '%s' if present or else '%s'", type, elseValue);
|
||||
|
||||
var firstEntryOptional = redactionLog.getRedactionLogEntry()
|
||||
var entries = redactionLog.getRedactionLogEntry()
|
||||
.stream()
|
||||
.filter(r -> r.getType().equals(type))
|
||||
.sorted(Comparator.comparing(s -> s.getValue().length()))
|
||||
.sorted(Collections.reverseOrder())
|
||||
.findFirst();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (firstEntryOptional.isPresent()) {
|
||||
|
||||
var firstEntry = firstEntryOptional.get();
|
||||
if (!entries.isEmpty()) {
|
||||
|
||||
var firstEntry = entries.get(entries.size() - 1);
|
||||
return SCMComponent.builder().originalValue(firstEntry.getValue()).scmAnnotations(List.of(toScmAnnotations(firstEntry))).transformation(transformation).build();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user