1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

Merge pull request #253 from vanitasvitae/norEmpty

requireNotNullOrEmpty: Obey the rules of grammar
This commit is contained in:
Florian Schmaus 2018-07-28 12:57:49 +02:00 committed by GitHub
commit 48627bd0fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 82 additions and 52 deletions

View file

@ -87,7 +87,7 @@ public class ExplicitMessageEncryptionElement implements ExtensionElement {
}
public ExplicitMessageEncryptionElement(String encryptionNamespace, String name) {
this.encryptionNamespace = StringUtils.requireNotNullOrEmpty(encryptionNamespace,
this.encryptionNamespace = StringUtils.requireNotNullNorEmpty(encryptionNamespace,
"encryptionNamespace must not be null");
this.name = name;
}

View file

@ -34,9 +34,9 @@ public class Tag implements NamedElement {
public Tag(String name, Type type, String value) {
// TODO According to XEP-0347 § 5.2 names are case insensitive. Uppercase them all?
this.name = StringUtils.requireNotNullOrEmpty(name, "name must not be null or empty");
this.name = StringUtils.requireNotNullNorEmpty(name, "name must not be null nor empty");
this.type = Objects.requireNonNull(type);
this.value = StringUtils.requireNotNullOrEmpty(value, "value must not be null or empty");
this.value = StringUtils.requireNotNullNorEmpty(value, "value must not be null nor empty");
if (this.name.length() > 32) {
throw new IllegalArgumentException("Meta Tag names must not be longer then 32 characters (XEP-0347 § 5.2");
}

View file

@ -37,7 +37,7 @@ public final class NodeInfo {
}
public NodeInfo(String nodeId, String sourceId, String cacheType) {
this.nodeId = StringUtils.requireNotNullOrEmpty(nodeId, "Node ID must not be null or empty");
this.nodeId = StringUtils.requireNotNullNorEmpty(nodeId, "Node ID must not be null nor empty");
this.sourceId = sourceId;
this.cacheType = cacheType;
}