This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch release18.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push: new e78b29f Fixed: replaceFirst sensible to variable pattern (OFBIZ-11396) e78b29f is described below commit e78b29fe14ad5b3df444fe296eec7bfe23996af6 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Sat Feb 22 09:40:56 2020 +0100 Fixed: replaceFirst sensible to variable pattern (OFBIZ-11396) When using variable pattern with replaceFirst you may cross issues if the pattern contains specific tokens. For instance on Windows with the path "C:\projectsASF\Git\ofbiz-framework/" you have inside the token "\p" which has a special meaning. --- framework/webtools/groovyScripts/service/AvailableServices.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/webtools/groovyScripts/service/AvailableServices.groovy b/framework/webtools/groovyScripts/service/AvailableServices.groovy index e3f0383..a03b027 100644 --- a/framework/webtools/groovyScripts/service/AvailableServices.groovy +++ b/framework/webtools/groovyScripts/service/AvailableServices.groovy @@ -19,6 +19,8 @@ import java.util.* import javax.wsdl.WSDLException + +import org.apache.commons.lang3.StringUtils; import org.apache.ofbiz.base.util.Debug import org.apache.ofbiz.base.util.UtilXml import org.apache.ofbiz.base.util.UtilProperties @@ -376,7 +378,7 @@ if (selectedService) { curServiceMap.defaultEntityName = defaultEntityName curServiceMap.invoke = invoke curServiceMap.location = location - curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", "") + curServiceMap.definitionLocation = StringUtils.replaceOnce(curServiceModel.definitionLocation, "file:/" + System.getProperty("ofbiz.home") + "/", "") curServiceMap.requireNewTransaction = requireNewTransaction curServiceMap.export = export curServiceMap.exportBool = exportBool @@ -564,7 +566,7 @@ if (!selectedService) { curServiceMap.defaultEntityName = defaultEntityName curServiceMap.invoke = invoke curServiceMap.location = location - curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", "") + curServiceMap.definitionLocation = StringUtils.replaceOnce(curServiceModel.definitionLocation, "file:/" + System.getProperty("ofbiz.home") + "/", "") curServiceMap.requireNewTransaction = requireNewTransaction curServiceMap.deprecated = curServiceModel.deprecatedUseInstead