From: David ‘Bombe’ Roden Date: Tue, 5 Aug 2014 00:22:22 +0000 (+0200) Subject: Check the argument, not the state. X-Git-Tag: 0.9-rc1^2~3^2~161 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c07b7c86e363cddee344527e7e19472e3744b0c1;p=Sone.git Check the argument, not the state. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Profile.java b/src/main/java/net/pterodactylus/sone/data/Profile.java index 5a4fde0..4bf26cc 100644 --- a/src/main/java/net/pterodactylus/sone/data/Profile.java +++ b/src/main/java/net/pterodactylus/sone/data/Profile.java @@ -326,7 +326,7 @@ public class Profile implements Fingerprintable { public Field addField(String fieldName) throws IllegalArgumentException { checkNotNull(fieldName, "fieldName must not be null"); checkArgument(fieldName.length() > 0, "fieldName must not be empty"); - checkState(getFieldByName(fieldName) == null, "fieldName must be unique"); + checkArgument(getFieldByName(fieldName) == null, "fieldName must be unique"); @SuppressWarnings("synthetic-access") Field field = new Field().setName(fieldName); fields.add(field);