diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSimpleTemplateParser.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSimpleTemplateParser.java index ba105c19a48..27cb89ea096 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSimpleTemplateParser.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSimpleTemplateParser.java @@ -35,7 +35,7 @@ public class ERXSimpleTemplateParser { public static final String DEFAULT_DELIMITER = "@@"; /** logging support */ - private static final Logger log = LoggerFactory.getLogger(ERXSimpleTemplateParser.class); + private static final Logger LOG = LoggerFactory.getLogger(ERXSimpleTemplateParser.class); /** holds a reference to the shared instance of the parser */ private static ERXSimpleTemplateParser _sharedInstance; @@ -108,7 +108,7 @@ public NSArray keysInTemplate(String template, String delimiter) { } NSArray components = NSArray.componentsSeparatedByString(template, delimiter); if (! isLoggingDisabled) { - log.debug("Components: {}", components); + LOG.debug("Components: {}", components); } boolean deriveElement = false; // if the template starts with delim, the first component will be a zero-length string for (Enumeration e = components.objectEnumerator(); e.hasMoreElements();) { @@ -174,14 +174,14 @@ public String parseTemplateWithObject(String template, String delimiter, Object delimiter = DEFAULT_DELIMITER; } if (! isLoggingDisabled) { - log.debug("Parsing template: {} with delimiter: {} object: {}",template, delimiter, object); - log.debug("Template: {}", template); - log.debug("Delim: {}", delimiter); - log.debug("otherObject: {}", otherObject); + LOG.debug("Parsing template: {} with delimiter: {} object: {}",template, delimiter, object); + LOG.debug("Template: {}", template); + LOG.debug("Delim: {}", delimiter); + LOG.debug("otherObject: {}", otherObject); } NSArray components = NSArray.componentsSeparatedByString(template, delimiter); if (! isLoggingDisabled) { - log.debug("Components: {}", components); + LOG.debug("Components: {}", components); } boolean deriveElement = false; // if the template starts with delim, the first component will be a zero-length string StringBuilder sb = new StringBuilder(); @@ -194,11 +194,11 @@ public String parseTemplateWithObject(String template, String delimiter, Object for (Enumeration e = components.objectEnumerator(); e.hasMoreElements();) { String element = (String)e.nextElement(); if(!isLoggingDisabled) { - log.debug("Processing Element: {}", element); + LOG.debug("Processing Element: {}", element); } if(deriveElement) { if(!isLoggingDisabled) { - log.debug("Deriving value ..."); + LOG.debug("Deriving value ..."); } if(element.length() == 0) { throw new IllegalArgumentException("\"\" is not a valid keypath in template: " + template); @@ -209,7 +209,7 @@ public String parseTemplateWithObject(String template, String delimiter, Object if(o != null && result == _undefinedKeyLabel) { try { if(!isLoggingDisabled) { - log.debug("calling valueForKeyPath({}, {})", o, element); + LOG.debug("calling valueForKeyPath({}, {})", o, element); } result = doGetValue(element, o); // For just in case the above doesn't throw an exception when the @@ -229,7 +229,7 @@ public String parseTemplateWithObject(String template, String delimiter, Object } if(result == _undefinedKeyLabel) { if (!isLoggingDisabled) { - log.debug("Could not find a value for '{}' of template, '{}' in either the object or extra data.", element, template); + LOG.debug("Could not find a value for '{}' of template, '{}' in either the object or extra data.", element, template); } } sb.append(result.toString()); @@ -241,7 +241,7 @@ public String parseTemplateWithObject(String template, String delimiter, Object deriveElement = true; } if(!isLoggingDisabled) { - log.debug("Buffer: {}", sb); + LOG.debug("Buffer: {}", sb); } } return sb.toString(); @@ -295,8 +295,8 @@ public static String parseTemplatedStringWithObject(String templateString, Objec convertedValue = new ERXSimpleTemplateParser("ERXSystem:KEY_NOT_FOUND").parseTemplateWithObject(convertedValue, DEFAULT_DELIMITER, templateObject, WOApplication.application()); } - // MS: Should we warn here? This is awfully quiet ... if (convertedValue.indexOf("ERXSystem:KEY_NOT_FOUND") > -1) { + LOG.warn("Not all keys in templateString were present in templateObject, returning unmodified templateString."); return templateString; // not all keys are present }