From 47f4a6392781b4e48ee99bde32dcede99309f864 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 23 Oct 2013 07:51:44 +0200 Subject: [PATCH] Fix duplicate-field detection. --- src/main/java/net/pterodactylus/sone/data/Profile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Profile.java b/src/main/java/net/pterodactylus/sone/data/Profile.java index 6201276..03e9a91 100644 --- a/src/main/java/net/pterodactylus/sone/data/Profile.java +++ b/src/main/java/net/pterodactylus/sone/data/Profile.java @@ -217,7 +217,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"); + checkState(!getFieldByName(fieldName).isPresent(), "fieldName must be unique"); @SuppressWarnings("synthetic-access") Field field = new Field(fieldName); fields.add(field); -- 2.7.4