From 8012c0a106ddcc1139cbe132218a2ad440be50f9 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 10 Aug 2015 15:38:18 +0200 Subject: [PATCH] =?utf8?q?Saved=20direct=20enum=20name=20+=20used=20it=20a?= =?utf8?q?gain=20makes=20the=20code=20much=20sweeter,=20still=20the=20Cons?= =?utf8?q?oleClient=20wants=20fromChar()=20and=20cannot=20use=20valueOf()?= =?utf8?q?=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../frontend/contact/AddressbookContactDatabaseFrontend.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java b/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java index 7442ef72..97593c63 100644 --- a/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java +++ b/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java @@ -376,9 +376,9 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp this.getLogger().debug(MessageFormat.format("strippedToken={0},num={1},bool={2}", strippedToken, num, bool)); //NOI18N // Now, let's try a gender check, if no null - if ((strippedToken != null) && (num == null) && (bool == null) && ((strippedToken.equals("M")) || (strippedToken.equals("F")) || (strippedToken.equals("C")))) { //NOI18N + if ((strippedToken != null) && (num == null) && (bool == null) && (Gender.valueOf(strippedToken) instanceof Gender)) { //NOI18N // Get first character - gender = Gender.fromChar(strippedToken.charAt(0)); + gender = Gender.valueOf(strippedToken); // Debug message this.getLogger().debug(MessageFormat.format("strippedToken={0},gender={1}", strippedToken, gender)); //NOI18N -- 2.39.5