Commit 7dff53fc authored by Adrien's avatar Adrien Committed by Romain Bioteau

fix issue caused by replaceAll("\") on Windows -> replaceAll("\") is a (#1513)

special case, and anyway it is "/" on all os (managed by eclipse)
parent 911f9d1a
......@@ -14,7 +14,6 @@
*/
package org.bonitasoft.studio.groovy.ui.providers;
import java.io.File;
import java.util.List;
import java.util.Objects;
......@@ -49,7 +48,7 @@ public abstract class AbstractGroovyScriptConfigurationSynchronizer implements I
@Override
public void synchronize(Configuration configuration, AbstractProcess process, CompoundCommand cc,
EditingDomain editingDomain) {
GroovyRepositoryStore store = (GroovyRepositoryStore) RepositoryManager.getInstance()
GroovyRepositoryStore store = RepositoryManager.getInstance()
.getRepositoryStore(GroovyRepositoryStore.class);
addNewPackage(configuration, process, store, cc, editingDomain);
removeDeletedPackage(configuration, store, cc, editingDomain);
......@@ -83,8 +82,12 @@ public abstract class AbstractGroovyScriptConfigurationSynchronizer implements I
List<Expression> expressions = ModelHelper.getAllItemsOfType(process,
ExpressionPackage.Literals.EXPRESSION);
newFragment.setExported(false);
String qualifiedName = path.replaceAll(File.separator, ".").substring(0,
path.lastIndexOf(".groovy"));
String qualifiedName = path;
if (path.contains("/")) {
qualifiedName = qualifiedName.replaceAll("/", ".");
}
qualifiedName = qualifiedName.substring(0,
qualifiedName.lastIndexOf(".groovy"));
for (Expression exp : expressions) {
if (exp.getType() != null && exp.getType().equals(ExpressionConstants.SCRIPT_TYPE)) {
if (exp.getContent() != null && exp.getContent().contains(qualifiedName)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment