From: Roland Haeder Date: Mon, 10 Aug 2015 13:38:18 +0000 (+0200) Subject: Saved direct enum name + used it again makes the code much sweeter, still the Console... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8012c0a106ddcc1139cbe132218a2ad440be50f9;p=jaddressbook-share-lib.git Saved direct enum name + used it again makes the code much sweeter, still the ConsoleClient wants fromChar() and cannot use valueOf() Signed-off-by:Roland Häder --- 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 7442ef7..97593c6 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