| Summary: | strange while-loop in xtext popup editors (org.eclipse.papyrus.xxxx.editor.xtext.ui) | ||
|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | m kranz <Marco.Kranz> |
| Component: | Core | Assignee: | Camille Letavernier <cletavernier> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | arnaud.cuccuru |
| Version: | 1.0.0 | ||
| Target Milestone: | M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Not able to reproduce the bug in Kepler M5, since Xtext embedded editors are not connected yet. hello arnaud you do not have to run the code, just look at the while loop. the object (xtextObject) that is used in the while-condition is never actually altered within the loop, so the loop's infinite. cheers mkranz ok, looking at the code again it will most likely end up in a nullpointer exception since modifiedObject might be null sooner or later and then modifiedObject.eContainer() will break things. Fixed in 9356316, pushed to master |
Build Identifier: 20110615-0604 the code in question is located in org.eclipse.papyrus.message.editor.xtext.ui.contributions.MessagePopupEditor.java, line 193 ff. it seems to be the same for all xxxPopupEditors as far as i checked. code snippet: public void reconcile(EObject modelObject, EObject xtextObject) { // first: retrieves / determines if the xtextObject is a MessageRule object EObject modifiedObject = xtextObject; if(!(modelObject instanceof Message)) return; while(xtextObject != null && !(xtextObject instanceof MessageRule)) { modifiedObject = modifiedObject.eContainer(); } if(modifiedObject == null) return; MessageRule messageRuleObject = (MessageRule)xtextObject; not sure what this code was supposed to do, but as far as i see the while-loop is infinite. it does not seem to ever be entered however(as far as i noticed). cheers marco Reproducible: Always