diff --git a/src/main/java/eu/siacs/conversations/entities/ServiceDiscoveryResult.java b/src/main/java/eu/siacs/conversations/entities/ServiceDiscoveryResult.java index 6c3787b61..8c63a2670 100644 --- a/src/main/java/eu/siacs/conversations/entities/ServiceDiscoveryResult.java +++ b/src/main/java/eu/siacs/conversations/entities/ServiceDiscoveryResult.java @@ -210,21 +210,19 @@ public class ServiceDiscoveryResult { .append("<"); } - List features = this.getFeatures(); + final List features = this.getFeatures(); Collections.sort(features); - - for (String feature : features) { + for (final String feature : features) { s.append(clean(feature)).append("<"); } - Collections.sort(forms, Comparator.comparing(Data::getFormType)); - - for (Data form : forms) { + Collections.sort(forms, Comparator.comparing(Data::getFormType)); + for (final Data form : forms) { s.append(clean(form.getFormType())).append("<"); - List fields = form.getFields(); - Collections.sort( + final List fields = form.getFields(); + Collections.sort( fields, Comparator.comparing(lhs -> Strings.nullToEmpty(lhs.getFieldName()))); - for (Field field : fields) { + for (final Field field : fields) { s.append(Strings.nullToEmpty(field.getFieldName())).append("<"); final List values = field.getValues(); Collections.sort(values, Comparator.comparing(ServiceDiscoveryResult::blankNull));