Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilterManager can produce ConcurrentModificationException with StereotypeNotificationFilter #28

Open
pcdavid opened this issue Sep 4, 2022 · 1 comment
Labels
bugzilla Issues migrated from the old Eclipse Bugzilla

Comments

@pcdavid
Copy link
Contributor

pcdavid commented Sep 4, 2022

  • πŸ†” Bugzilla ID: #538166
  • πŸ“˜ Project: Modeling / EMF Services / Transaction
  • πŸ—“ Created: 2018-08-22T14:34:56Z
  • ❓ Status: NEW /
@pcdavid pcdavid added the bugzilla Issues migrated from the old Eclipse Bugzilla label Sep 4, 2022
@pcdavid
Copy link
Contributor Author

pcdavid commented Sep 4, 2022

Comment #0 on Wed Aug 22 2018 16:34:56 GMT+0200 (Central European Summer Time):

The org.eclipse.emf.transaction.impl.FilterManager may produce a ConcurrentModificationException together with the StereotypeNotificationFilter if the Stereotype is contained in a profile that also has a notation model which is not fully loaded. We have a profile with a stereotype and a notation model for the diagram. When the FilterManager matches on the StereotypeNotificationFilter the filter may resolve proxies (in this case from the notation model) which causes resolve proxy notifications to be added to the transaction notifications which are currently iterated by the FilterManager:

This loop in FilterManager uses the notifications list from the current transaction:

for (Notification next : notifications) {
   if (filter.matches(next)) {
	result.add(next);
   }
}


This trace shows that a new notification is added during filtering that causes the ConcurrentModificationException. 

CDOAwareTransactionalEditingDomain$4(TransactionChangeRecorder).appendNotification(Notification) line: 310	
CDOAwareTransactionalEditingDomain$4.appendNotification(Notification) line: 427	
CDOAwareTransactionalEditingDomain$4(TransactionChangeRecorder).processObjectNotification(Notification) line: 285	
CDOAwareTransactionalEditingDomain$4(TransactionChangeRecorder).notifyChanged(Notification) line: 241	
CDOAwareTransactionalEditingDomain$4.notifyChanged(Notification) line: 446	
CSSShapeImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
CSSShapeImpl(ViewImpl).getElement() line: 351	
CSSShapeImpl(ShapeImpl).eGet(int, boolean, boolean) line: 681	
CSSShapeImpl(BasicEObjectImpl).eGet(EStructuralFeature, boolean, boolean) line: 1011	
CSSShapeImpl(BasicEObjectImpl).eGet(EStructuralFeature, boolean) line: 1003	
BasicEObjectImpl$3.get(boolean) line: 1618	
StereotypePreservingCacheAdapter(ECrossReferenceAdapter).resolveProxy(Resource, EObject, EObject, EStructuralFeature$Setting) line: 474	
StereotypePreservingCacheAdapter(CacheAdapter).resolveProxy(Resource, EObject, EObject, EStructuralFeature$Setting) line: 535	
StereotypePreservingCacheAdapter(ECrossReferenceAdapter).resolveAll(EObject) line: 464	
StereotypePreservingCacheAdapter(ECrossReferenceAdapter).getNonNavigableInverseReferences(EObject, boolean) line: 370	
StereotypePreservingCacheAdapter(ECrossReferenceAdapter).getNonNavigableInverseReferences(EObject) line: 363	
StereotypePreservingCacheAdapter(CacheAdapter).getNonNavigableInverseReferences(EObject) line: 330	
UML2Util.getNonNavigableInverseReferences(EObject) line: 1115	
ElementOperations.getAppliedStereotypes(Element) line: 334	
PropertyImpl(ElementImpl).getAppliedStereotypes() line: 246	
ElementOperations.getAppliedStereotype(Element, String) line: 364	
PropertyImpl(ElementImpl).getAppliedStereotype(String) line: 259	
UMLUtil.getTaggedValue(Element, String, String) line: 12275	
UMLUtil$1.caseProperty(Property) line: 11702	
UMLUtil$1.caseProperty(Property) line: 1	
UMLUtil$1(UMLSwitch<T>).doSwitch(int, EObject) line: 780	
UMLUtil$1(Switch<T>).doSwitch(EClass, EObject) line: 53	
UMLUtil$1(Switch<T>).doSwitch(EObject) line: 69	
UMLUtil.getEcoreName(NamedElement) line: 11707	
UMLUtil.basicGetNamedElement(ENamedElement, EObject) line: 11768	
UMLUtil$OperationContext$1(UMLUtil$OperationContext).getNamedElement(ENamedElement, EObject) line: 12086	
UMLUtil.getNamedElement(ENamedElement, EObject) line: 11721	
StereotypeElementListener$StereotypeExtensionFinder.getUMLDefinition(ENamedElement, EObject) line: 332	
StereotypeElementListener$StereotypeExtensionFinder.getExtensionEnd(EObject, EStructuralFeature) line: 298	
StereotypeElementListener$StereotypeNotificationFilter.matches(Notification) line: 428	
FilterManager.select(List<Notification>, NotificationFilter, ArrayList<Notification>) line: 89	

We temporarily solved this issue by resolving the complete profile beforehand. Anyway this could always happen depending on the implementation of the specific filter.

Comment #1 on Sat May 14 2022 15:53:31 GMT+0200 (Central European Summer Time):

Eclipse EMF Validation is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/emf-validation.

If this issue is relevant to you and still present in the latest release:

* Create a new issue at https://github.com/eclipse/emf-validation/issues/.
  * Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  * In the GitHub description, start with a link to this bugzilla ticket
  * Optionally add new content to the description if it can helps towards resolution
* Update bugzilla ticket
  * Add to "See also" property (up right column) the link to the newly created GitHub issue
  * Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  * Set status as CLOSED MOVED

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for EMF Validation will be archived and made read-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from the old Eclipse Bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant