From 6d337a85f1ce70856d438dae7379f5705a2ca020 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 10 Aug 2015 15:08:15 +0200 Subject: [PATCH] =?utf8?q?Ignored=20some=20strings=20for=20internationaliz?= =?utf8?q?ation=20+=20some=20debug=20messages=20added=20Signed-off-by:Rola?= =?utf8?q?nd=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/jcore/BaseFrameworkSystem.java | 36 +++++++++++-------- .../mxchange/jcore/contact/BaseContact.java | 4 ++- src/org/mxchange/jcore/contact/Contact.java | 1 + 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/org/mxchange/jcore/BaseFrameworkSystem.java b/src/org/mxchange/jcore/BaseFrameworkSystem.java index efee713..d31239b 100644 --- a/src/org/mxchange/jcore/BaseFrameworkSystem.java +++ b/src/org/mxchange/jcore/BaseFrameworkSystem.java @@ -613,16 +613,16 @@ public class BaseFrameworkSystem implements FrameworkInterface { */ protected Object convertNullToEmpty (final Object str) { // Trace message - this.getLogger().trace(MessageFormat.format("str={0}", str)); + this.getLogger().trace(MessageFormat.format("str={0}", str)); //NOI18N // Is it null? if (str == null) { // Return empty string - return ""; + return ""; //NOI18N } // Trace message - this.getLogger().trace(MessageFormat.format("str={0} - EXIT!", str)); + this.getLogger().trace(MessageFormat.format("str={0} - EXIT!", str)); //NOI18N // Return it return str; @@ -637,40 +637,46 @@ public class BaseFrameworkSystem implements FrameworkInterface { */ protected Iterator> fieldIterator (final FrameworkInterface instance, final String className) { // Trace message - this.getLogger().trace(MessageFormat.format("instance={0},className={1} - CALLED!", instance, className)); - + this.getLogger().trace(MessageFormat.format("instance={0},className={1} - CALLED!", instance, className)); //NOI18N + // Get all attributes from given instance Field[] fields = this.getClassFromTarget(instance, className).getDeclaredFields(); - + // Debug message - this.getLogger().debug(MessageFormat.format("Found {0} fields.", fields.length)); - + this.getLogger().debug(MessageFormat.format("Found {0} fields.", fields.length)); //NOI18N + // A simple map with K=fieldName and V=Value is fine Map map = new HashMap<>(fields.length); - + // Walk through all for (final Field field : fields) { // Debug log - this.getLogger().debug(MessageFormat.format("field={0}", field.getName())); + this.getLogger().debug(MessageFormat.format("field={0}", field.getName())); //NOI18N // Does the field start with "$"? - if (field.getName().startsWith("$")) { + if (field.getName().startsWith("$")) { //NOI18N + // Debug message + this.getLogger().debug(MessageFormat.format("Skipping field={0} as it starts with a dollar character.", field.getName())); //NOI18N + // Skip it silently continue; } + // Debug message + this.getLogger().debug(MessageFormat.format("Calling getValueFromColumn({0}) on instance {1} ...", field.getName(), instance)); + // Get value from it - Object value = this.getValueFromColumn(field.getName()); + Object value = instance.getValueFromColumn(field.getName()); // Debug message - this.getLogger().debug(MessageFormat.format("value={0}", value)); + this.getLogger().debug(MessageFormat.format("Adding field={0},value={1}", field.getName(), value)); //NOI18N // Add it to list map.put(field, value); } // Debug message - this.getLogger().debug(MessageFormat.format("Returning iterator for {0} entries ...", map.size())); + this.getLogger().debug(MessageFormat.format("Returning iterator for {0} entries ...", map.size())); //NOI18N // Return list iterator return map.entrySet().iterator(); @@ -737,7 +743,7 @@ public class BaseFrameworkSystem implements FrameworkInterface { // Is the bundle set? if (bundle instanceof ResourceBundle) { // Is already set - throw new IllegalStateException("called twice"); + throw new IllegalStateException("called twice"); //NOI18N } // Set instance diff --git a/src/org/mxchange/jcore/contact/BaseContact.java b/src/org/mxchange/jcore/contact/BaseContact.java index 75f51fd..465289a 100644 --- a/src/org/mxchange/jcore/contact/BaseContact.java +++ b/src/org/mxchange/jcore/contact/BaseContact.java @@ -171,7 +171,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return the cellphoneNumber */ @Override - public String getCellphoneNumber () { + public final String getCellphoneNumber () { return this.cellphoneNumber; } @@ -327,6 +327,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { */ @Override public String getFamilyName () { + //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!"); return this.familyName; } @@ -337,6 +338,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { */ @Override public final void setFamilyName (final String familyName) { + /* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("familyName={0} - CALLED!", familyName)); this.familyName = familyName; } diff --git a/src/org/mxchange/jcore/contact/Contact.java b/src/org/mxchange/jcore/contact/Contact.java index 85896f5..c3f5476 100644 --- a/src/org/mxchange/jcore/contact/Contact.java +++ b/src/org/mxchange/jcore/contact/Contact.java @@ -30,6 +30,7 @@ import org.mxchange.jcore.client.Client; public interface Contact extends FrameworkInterface { /** * Returns an iterator of all values from this object + * * @return An iterator */ public Iterator> iterator (); -- 2.39.5