[ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1419507] |
Mon, 08 September 2014 14:20  |
Eclipse User |
|
|
|
HI,
I have some model instances in ECP project when I modify them, it causes a hang inside org.eclipse.emf.ecp.validation module in validate method:
Two questions:
1.what is this validation module doing and why?
2. Any ideas on why it would hang?
Some info on the model:
it has about 70-200k sub items there are some circular references.
public IValidationService getValidationService(final Object validationServiceObject) {
if (!mapping.containsKey(validationServiceObject)) {
IValidationService validationService = new ValidationService(new IExcludedObjectsCallback() {
public boolean isExcluded(Object object) {
if(InternalProject.class.isInstance(validationServiceObject)){
return ((InternalProject)validationServiceObject).isModelRoot(object);
}
return false;
}
});
mapping.put(validationServiceObject, validationService);
if (validationServiceObject instanceof ECPProject) {
ECPProject project = (ECPProject) validationServiceObject;
validationService.[b]validate[/b](getAllChildEObjects(project));
}
return validationService;
}
return mapping.get(validationServiceObject);
}
Which then calls update
/**
* Updates the cached entry for the given {@link EObject} with the given value.<br/>
* If the cached entry does not yet exist, it will be created.
*
* @param eObject
* the {@link EObject}
* @param value
* the value associated with the {@link EObject}
* @return set of affected eobjects
*/
public Set<EObject> update(EObject eObject, T value) {
if (excludedCallback.isExcluded(eObject)) {
return Collections.emptySet();
}
final CachedTreeNode<T> node = createNodeIfNecessary(eObject, value);
node.setOwnValue(value);
updateNodeObject(eObject);
rootValue.putIntoCache(eObject, node.getOwnValue());
final Set<EObject> affectedElements = removeOutdatedParentCacheIfNeeded(eObject);
// propagate upwards
EObject parent = eObject.eContainer();
while (parent != null && !excludedCallback.isExcluded(parent)) {// !isExcludedType(excludedTypes,
// parent.getClass())
updateParentNode(parent, eObject, nodes.get(eObject).getDisplayValue());
eObject = parent;
parent = parent.eContainer();
affectedElements.add(eObject);
}
return affectedElements;
}
My guess the while condition becomes an infinite loop.
Thanks,
Pouya
[Updated on: Mon, 08 September 2014 16:58] by Moderator
|
|
|
|
|
Re: [ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1421321 is a reply to message #1421119] |
Thu, 11 September 2014 03:57  |
Eclipse User |
|
|
|
Hi,
there is currently no way to turn the validation on and off in the UI
(would be quite simple to implement). If you disable the validation,
there will be no validation markers in the model explorer anymore. The *
sign is added by EMFStore, so it will still be there.
Best Regards
Jonas
Am 11.09.2014 02:30, schrieb Roza Ghamari:
> Hi Jonas,
>
> Is it possible to turn this validation off for specific projects or
> models? Do we have any control on running the validation? Also, is we
> disable the validation does it mean the model explorer wouldn't show the
> * sign next to the modified projects? I would like to know what would be
> the consequence of disabling the validation.
>
> Thanks,
> Roza
>
|
|
|
Powered by
FUDForum. Page generated in 0.03945 seconds