From e85a263d6e5d040296a7a9521e7e376fcff75c8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 6 Jun 2016 11:09:47 +0200 Subject: [PATCH] added debug lines + list.add() and assert around it does not work (why?) --- .../mxchange/jcontacts/contact/gender/Gender.java | 2 ++ .../jcontacts/contact/gender/GenderUtils.java | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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; } -- 2.39.5