Commit 84251734 authored by Adrien's avatar Adrien Committed by GitHub

fix(Query expression provider) availability when switching project (#1795)

* fix(Query expression provider) availability when switching project

* The BDM file store should not be reused, it leads to errors when
switching from a project to an other

[BST-349](https://bonitasoft.atlassian.net/browse/BST-349)
parent 5248a636
......@@ -52,12 +52,6 @@ import com.google.common.collect.Iterables;
*/
public class QueryExpressionProvider implements IExpressionProvider {
private BusinessObjectModelFileStore fileStore;
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getExpressions(org.eclipse.emf.ecore.EObject)
*/
@Override
public Set<Expression> getExpressions(final EObject context) {
return Collections.emptySet();
......@@ -133,15 +127,10 @@ public class QueryExpressionProvider implements IExpressionProvider {
}
protected BusinessObjectModel getBusinessObjectModel() {
final BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> repositoryStore = RepositoryManager
.getInstance().getRepositoryStore(BusinessObjectModelRepositoryStore.class);
if (fileStore == null) {
fileStore = repositoryStore.getChild(BusinessObjectModelFileStore.BOM_FILENAME);
}
if (fileStore != null) {
return fileStore.getContent();
}
return null;
BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> repositoryStore = RepositoryManager.getInstance()
.getRepositoryStore(BusinessObjectModelRepositoryStore.class);
BusinessObjectModelFileStore fileStore = repositoryStore.getChild(BusinessObjectModelFileStore.BOM_FILENAME);
return fileStore != null ? fileStore.getContent() : null;
}
/*
......@@ -155,7 +144,9 @@ public class QueryExpressionProvider implements IExpressionProvider {
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getIcon(org.bonitasoft.studio.model.expression.Expression)
* @see
* org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getIcon(org.bonitasoft.studio.model.expression.
* Expression)
*/
@Override
public Image getIcon(final Expression expression) {
......@@ -173,7 +164,9 @@ public class QueryExpressionProvider implements IExpressionProvider {
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getProposalLabel(org.bonitasoft.studio.model.expression.Expression)
* @see
* org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getProposalLabel(org.bonitasoft.studio.model.
* expression.Expression)
*/
@Override
public String getProposalLabel(final Expression expression) {
......@@ -201,7 +194,9 @@ public class QueryExpressionProvider implements IExpressionProvider {
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getExpressionEditor(org.bonitasoft.studio.model.expression.Expression,
* @see
* org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getExpressionEditor(org.bonitasoft.studio.model.
* expression.Expression,
* org.eclipse.emf.ecore.EObject)
*/
@Override
......
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