From: <ms...@us...> - 2009-02-02 20:36:05
|
Revision: 8883 http://wonder.svn.sourceforge.net/wonder/?rev=8883&view=rev Author: mschrag Date: 2009-02-02 20:36:00 +0000 (Mon, 02 Feb 2009) Log Message: ----------- moved fast parsing to ERXSimpleTemplateParser static method Modified Paths: -------------- trunk/Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSystem.java Modified: trunk/Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSystem.java =================================================================== --- trunk/Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSystem.java 2009-02-02 20:35:05 UTC (rev 8882) +++ trunk/Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXSystem.java 2009-02-02 20:36:00 UTC (rev 8883) @@ -9,7 +9,6 @@ import java.util.Enumeration; import java.util.Properties; -import com.webobjects.appserver.WOApplication; import com.webobjects.foundation.NSKeyValueCoding; import com.webobjects.foundation.NSKeyValueCodingAdditions; import com.webobjects.foundation.NSProperties; @@ -46,24 +45,7 @@ */ public static String getProperty(String key) { String originalValue = (String) ERXSystem.sharedInstance.valueForKey(key); - - String convertedValue = originalValue; - if (originalValue == null || originalValue.indexOf("@@") == -1) { - return originalValue; - } - - String lastConvertedValue = null; - while (convertedValue != lastConvertedValue && convertedValue.indexOf("@@") > -1) { - lastConvertedValue = convertedValue; - convertedValue = new ERXSimpleTemplateParser("ERXSystem:KEY_NOT_FOUND").parseTemplateWithObject(convertedValue, "@@", ERXSystem.sharedInstance, WOApplication.application()); - } - - // MS: Should we warn here? This is awfully quiet ... - if (convertedValue.indexOf("ERXSystem:KEY_NOT_FOUND") > -1) { - return originalValue; // not all keys are present - } - - return convertedValue; + return ERXSimpleTemplateParser.parseTemplatedStringWithObject(originalValue, ERXSystem.sharedInstance); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |