From: Roland Häder Date: Mon, 6 Jun 2016 09:09:47 +0000 (+0200) Subject: added debug lines + list.add() and assert around it does not work (why?) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e85a263d6e5d040296a7a9521e7e376fcff75c8b;p=jcontacts-core.git added debug lines + list.add() and assert around it does not work (why?) --- diff --git a/src/org/mxchange/jcontacts/contact/gender/Gender.java b/src/org/mxchange/jcontacts/contact/gender/Gender.java index 890eb93..c298e3d 100644 --- a/src/org/mxchange/jcontacts/contact/gender/Gender.java +++ b/src/org/mxchange/jcontacts/contact/gender/Gender.java @@ -88,6 +88,7 @@ public enum Gender implements Serializable { *

* @return Valid chars */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") public static char[] validChars () { // Is cache set? if (validChars != null) { @@ -106,6 +107,7 @@ public enum Gender implements Serializable { // Debug message //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("gender={0} - adding at pos {1} ...", gender, i)); + // Get access key as this is also the access valid[i] = gender.getAccessChar(); diff --git a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java index b8ec349..92e4426 100644 --- a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java +++ b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java @@ -17,7 +17,6 @@ package org.mxchange.jcontacts.contact.gender; import java.io.Serializable; -import java.text.MessageFormat; import java.util.LinkedList; import java.util.List; @@ -39,15 +38,24 @@ public class GenderUtils implements Serializable { * @return Selectable genders (not UNKNOWN) */ public static List selectableGenders () { + // Trace message + //* NOISY-DEBUG: */ System.out.println("GenderUtils.selectableGenders: CALLED!"); //NOI18N + // Init list List list = new LinkedList<>(); // Walk through all genders for (final Gender gender : Gender.values()) { + // Debug message + //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("GenderUtils.selectableGenders: gender={0}", gender)); //NOI18N + // Add it and check if it has been added - assert (list.add(gender)) : MessageFormat.format("gender {0} not added.", gender); //NOI18N + list.add(gender); } + // Trace message + //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("GenderUtils.selectableGenders: list.size()={0} - EXIT!", list.size())); //NOI18N + // Return it return list; }