]> git.mxchange.org Git - jcontacts-core.git/commitdiff
added debug lines + list.add() and assert around it does not work (why?)
authorRoland Häder <roland@mxchange.org>
Mon, 6 Jun 2016 09:09:47 +0000 (11:09 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 6 Jun 2016 09:09:47 +0000 (11:09 +0200)
src/org/mxchange/jcontacts/contact/gender/Gender.java
src/org/mxchange/jcontacts/contact/gender/GenderUtils.java

index 890eb93ba7107cba536f06d3fe2bd3fb291628c0..c298e3d83cd30624e37d295d7ae626248b443943 100644 (file)
@@ -88,6 +88,7 @@ public enum Gender implements Serializable {
         * <p>
         * @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();
 
index b8ec349b9d8fa23b8a7141854c94138fc035d4d4..92e4426123b1314d1b39167c182c94d5762baaa6 100644 (file)
@@ -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<Gender> selectableGenders () {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println("GenderUtils.selectableGenders: CALLED!"); //NOI18N
+
                // Init list
                List<Gender> 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;
        }