Invert if-statements to increase readability

This commit is contained in:
Paul Schaub 2019-08-31 17:07:17 +02:00
parent 6749a1d9d9
commit 6b4e2c3842
1 changed files with 41 additions and 37 deletions

View File

@ -1,6 +1,6 @@
/**
*
* Copyright 2017 Fernando Ramirez
* Copyright 2017 Fernando Ramirez, 2019 Paul Schaub
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,6 +32,7 @@ import org.jivesoftware.smackx.avatar.UserAvatarManager;
* This class contains metadata about published avatars.
*
* @author Fernando Ramirez
* @author Paul Schaub
* @see <a href="https://xmpp.org/extensions/xep-0084.html">XEP-0084: User
* Avatar</a>
*/
@ -110,7 +111,10 @@ public class MetadataExtension implements ExtensionElement {
}
private void appendInfoElements(XmlStringBuilder xml) {
if (infos != null) {
if (infos == null) {
return;
}
xml.rightAngleBracket();
for (MetadataInfo info : infos) {
@ -131,10 +135,11 @@ public class MetadataExtension implements ExtensionElement {
xml.closeEmptyElement();
}
}
}
private void appendPointerElements(XmlStringBuilder xml) {
if (pointers != null) {
if (pointers == null) {
return;
}
for (MetadataPointer pointer : pointers) {
xml.openElement("pointer");
@ -159,7 +164,6 @@ public class MetadataExtension implements ExtensionElement {
}
}
}
private void closeElement(XmlStringBuilder xml) {
if (infos != null || pointers != null) {