|
|
@@ -87,7 +87,10 @@ public class STextGlobalScopeProvider extends ImportUriGlobalScopeProvider {
|
|
|
public IScope getScope(Resource context, EReference reference, Predicate<IEObjectDescription> filter) {
|
|
|
IScope parentScope = super.getScope(context, reference, filter);
|
|
|
parentScope = new SimpleScope(parentScope, filterPropertiesOfLibrary(context, reference, filter).getAllElements());
|
|
|
- final Statechart statechart = getStatechart(context);
|
|
|
+ Statechart statechart = getStatechart(context);
|
|
|
+ if(statechart == null)
|
|
|
+ return IScope.NULLSCOPE;
|
|
|
+ final String statechartDomain = statechart.getDomainID();
|
|
|
parentScope = new TypeSystemAwareScope(parentScope, typeSystem, qualifiedNameProvider,
|
|
|
reference.getEReferenceType());
|
|
|
IScope result = new FilteringScope(parentScope, new Predicate<IEObjectDescription>() {
|
|
|
@@ -97,7 +100,7 @@ public class STextGlobalScopeProvider extends ImportUriGlobalScopeProvider {
|
|
|
if (userData == null)
|
|
|
return true;
|
|
|
|
|
|
- return statechart.getDomainID().equals(userData);
|
|
|
+ return statechartDomain.equals(userData);
|
|
|
}
|
|
|
});
|
|
|
result = filterAnnotations(reference, result);
|
|
|
@@ -155,6 +158,9 @@ public class STextGlobalScopeProvider extends ImportUriGlobalScopeProvider {
|
|
|
return EcoreUtil.getObjectsByType(specification.getScopes(), StextPackage.Literals.IMPORT_SCOPE);
|
|
|
} else {
|
|
|
Statechart statechart = getStatechart(resource);
|
|
|
+ if (statechart == null) {
|
|
|
+ return new LinkedHashSet<>();
|
|
|
+ }
|
|
|
return EcoreUtil.getObjectsByType(statechart.getScopes(), StextPackage.Literals.IMPORT_SCOPE);
|
|
|
}
|
|
|
}
|