<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Thomas,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>are we talking about com.sap.furcas.test/scenarioFixtures/BibText.ecore? The model I see there in the current version of the master branch has Containment set to true for BibText/author/revenues.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I suppose the problem may have originated from the issue described in my other mail regarding a multiple foreach result. In this case, one of the elements is removed again due to the bug and therefore loses its containment parent.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I'm confused by the code in DelayedReferencesHelper.setReference where DelayedReference.setRealValue(...) is called with one of the objects resulting from running <i>one</i> production rule determined by the foreach predicate. This suggests to me that if there are multiple objects that result from the foreach expression, then for the same DelayedReference multiple calls to setRealValue(...) will be executed, and only the last element produced will remain as the "real value" of that reference. Intentional? Or bug? What's the "protocol" or "invariant" for the DelayedReference.realValue field? Is it some coincidence that generally the realValue field is still set to the most current result of a foreach predicate so that when immediately after calling the production the onRuleElementResolvedOutOfContext is called, the realValue field still holds the correct value?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I generally have trouble understanding this: the onRuleElementResolvedOutOfContext call leads to the entering of an element into the referencedElements of the responsible text block. If the DelayedReference is a foreach-predicate, shouldn't the elements end up in the correspondingElements instead?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Can you shed some light on these issues?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks and best,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-- Axel<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> furcas-discussion-bounces@lists.furcas.org [mailto:furcas-discussion-bounces@lists.furcas.org] <b>On Behalf Of </b>Thomas Goldschmidt<br><b>Sent:</b> Thursday, February 17, 2011 8:48 AM<br><b>To:</b> furcas-discussion<br><b>Subject:</b> Re: [furcas-discussion] NPE during ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi Axel,</span> <br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>If I see it right </span><tt><span style='font-size:10.0pt'>ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext</span></tt><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> should be called after the DelayedReference has been resolved. Which also should have resulted in adding the element to the specified feature "revenues". Are you sure that revenues has set "containment = true"? In the current version in the repository this is false. Therefore, no resource will be set on that object.</span> <br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>Cheers,</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>Thomas</span> <o:p></o:p></p><table class=MsoNormalTable border=0 cellpadding=0><tr><td valign=top style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><img id="_x0000_i1029" src="cid:image001.gif@01CBCE88.92A5E1D0"><o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal> <o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><b><span style='font-size:7.5pt;font-family:"Verdana","sans-serif"'>Thomas Goldschmidt </span></b><span style='font-size:7.5pt;font-family:"Verdana","sans-serif"'><br><br>ABB AG<br>Forschungszentrum<br>Wallstadter Straße 59<br>68526 Ladenburg<br>Office Phone: +49 6203 716134<br>Office Fax: +49 6203 716253<br>e-mail:<span style='color:blue'> thomas.goldschmidt@de.abb.com</span></span><o:p></o:p></p></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><br><br><span style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray'><br>ABB AG<br>Sitz/Head Office: Mannheim <br>Registergericht/Registry Court: Mannheim<br>Handelsregisternummer/Commercial Register No.: HRB 4664<br>Geschäftsführung/Managing Board: Peter Smits (Vorsitzender), Joachim Schneider, Markus Ochsner, Hans-Georg Krabbe<br>Vorsitzender des Aufsichtsrats/Chairman of Supervisory Board: Bernhard Jucker<br><br>Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. <br><br>This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.</span> <o:p></o:p></p><table class=MsoNormalTable border=0 cellpadding=0 width="100%" style='width:100.0%'><tr><td width="32%" valign=top style='width:32.0%;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>"Uhl, Axel" <axel.uhl@sap.com></span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'> <br>Sent by: furcas-discussion-bounces@lists.furcas.org</span> <o:p></o:p></p><p><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>16.02.2011 16:03</span> <o:p></o:p></p></td><td width="67%" valign=top style='width:67.0%;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><o:p> </o:p></p><table class=MsoNormalTable border=0 cellpadding=0 width="100%" style='width:100.0%'><tr><td width="7%" valign=top style='width:7.0%;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>To</span><o:p></o:p></p></td><td width="92%" valign=top style='width:92.0%;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>furcas-discussion <furcas-discussion@lists.furcas.org></span> <o:p></o:p></p></td></tr><tr><td valign=top style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>cc</span><o:p></o:p></p></td><td valign=top style='padding:.75pt .75pt .75pt .75pt'></td></tr><tr><td valign=top style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>Subject</span><o:p></o:p></p></td><td valign=top style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>[furcas-discussion] NPE during ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext</span><o:p></o:p></p></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><table class=MsoNormalTable border=0 cellpadding=0><tr><td valign=top style='padding:.75pt .75pt .75pt .75pt'></td><td valign=top style='padding:.75pt .75pt .75pt .75pt'></td></tr></table></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><br><br><br><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>Hi,</tt><br><br><tt>I'm getting the below NPE while parsing the text</tt><br><br><tt> "article{ Shrt, \"John Doe\"}" +</tt><br><tt> "article{ Medium, \"John Doe\"}" +</tt><br><tt> "article{ LongLongLong, \"Jane Doll\"}" +</tt><br><tt> "author = \"John Doe\"." +</tt><br><tt> "author = \"Jane Doll\"."</tt><br><br><tt>for the mapping attached. The offending object is a RevenueLedger object for the "Shrt" article. The article reference for the RevenueLedger seems properly set. However, it isn't (yet?) entered into its supposed container object (should be the Author object for "John Doe"). This leads to a problem during identifying its resource set because its resource is determined as null.</tt><br><br><tt>Now I'm not sure if at this point in time during reference resolution the RevenueLedger object should already be hooked up with its container. If that can't be guaranteed at this point then the logic in notifyModelElementResolvedOutOfContext probably has to be considered a bug.</tt><br><br><tt>Suggestions?</tt><br><br><tt>-- Axel</tt><br><br><tt>Thread [main] (Suspended (breakpoint at line 118 in Query2OppositeEndFinder)) </tt><br><tt> Query2OppositeEndFinder.navigateOppositePropertyWithBackwardScope(EReference, EObject) line: 118 </tt><br><tt> ParserTextBlocksHandler.getTextBlockForElementAt(EObject, ANTLR3LocationToken) line: 656 </tt><br><tt> ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext(Object, Object, Token, DelayedReference) line: 550 </tt><br><tt> BibtexWithComplexForeachPropertyInitsParser(ObservablePatchedParser).onRuleElementResolvedOutOfContext(Object, Object, ANTLR3LocationToken, DelayedReference) line: 111 </tt><br><tt> BibtexWithComplexForeachPropertyInitsParser(ObservableInjectingParser).setDelayedReferencesAfterParsing() line: 683 </tt><br><tt> ReferenceHandlerImpl.resolveRemainingReferences() line: 272 </tt><br><tt> IncrementalParser.incrementalParse(TextBlock, boolean) line: 299 </tt><br><tt> IncrementalParser.incrementalParse(TextBlock) line: 130 </tt><br><tt> IncrementalParserFacade.parseIncrementally(TextBlock) line: 208 </tt><br><tt> TestPropertyInitReEvaluationWithComplexForeach(AbstractReferenceResolvingTestWithTextBlocks).parseFile(String) line: 128 </tt><br><tt> TestPropertyInitReEvaluationWithComplexForeach(AbstractReferenceResolvingTestWithTextBlocks).setupModelFromTextToParse(String) line: 117 </tt><br><tt> TestPropertyInitReEvaluationWithComplexForeach.setupInitialModel() line: 72 </tt><br><tt> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] </tt><br><tt> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 </tt><br><tt> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 </tt><br><tt> Method.invoke(Object, Object...) line: 597 </tt><br><tt> FrameworkMethod$1.runReflectiveCall() line: 44 </tt><br><tt> FrameworkMethod$1(ReflectiveCallable).run() line: 15 </tt><br><tt> FrameworkMethod.invokeExplosively(Object, Object...) line: 41 </tt><br><tt> RunBefores.evaluate() line: 27 </tt><br><tt> RunAfters.evaluate() line: 31 </tt><br><tt> BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 76 </tt><br><tt> BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 50 </tt><br><tt> ParentRunner$3.run() line: 193 </tt><br><tt> ParentRunner$1.schedule(Runnable) line: 52 </tt><br><tt> BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191 </tt><br><tt> ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42 </tt><br><tt> ParentRunner$2.evaluate() line: 184 </tt><br><tt> RunBefores.evaluate() line: 28 </tt><br><tt> BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236 </tt><br><tt> JUnit4TestClassReference(JUnit4TestReference).run(TestExecution) line: 49 </tt><br><tt> TestExecution.run(ITestReference[]) line: 38 </tt><br><tt> RemotePluginTestRunner(RemoteTestRunner).runTests(String[], String, TestExecution) line: 467 </tt><br><tt> RemotePluginTestRunner(RemoteTestRunner).runTests(TestExecution) line: 683 </tt><br><tt> RemotePluginTestRunner(RemoteTestRunner).run() line: 390 </tt><br><tt> RemotePluginTestRunner.main(String[]) line: 62 </tt><br><tt> CoreTestApplication.run(Object) line: 23 </tt><br><tt> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] </tt><br><tt> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 </tt><br><tt> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 </tt><br><tt> Method.invoke(Object, Object...) line: 597 </tt><br><tt> EclipseAppContainer.callMethodWithException(Object, String, Class[], Object[]) line: 587 </tt><br><tt> EclipseAppHandle.run(Object) line: 198 </tt><br><tt> EclipseAppLauncher.runApplication(Object) line: 110 </tt><br><tt> EclipseAppLauncher.start(Object) line: 79 </tt><br><tt> EclipseStarter.run(Object) line: 369 </tt><br><tt> EclipseStarter.run(String[], Runnable) line: 179 </tt><br><tt> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] </tt><br><tt> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 </tt><br><tt> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 </tt><br><tt> Method.invoke(Object, Object...) line: 597 </tt><br><tt> Main.invokeFramework(String[], URL[]) line: 619 </tt><br><tt> Main.basicRun(String[]) line: 574 </tt><br><tt> Main.run(String[]) line: 1407 </tt><br><tt> Main.main(String[]) line: 1383 </tt><br><tt>[attachment "BibtexWithComplexForeachPropertyInits.tcs" deleted by Thomas Goldschmidt/DEABB/ABB] _______________________________________________</tt><br><tt>Furcas-discussion mailing list</tt><br><tt>Furcas-discussion@lists.furcas.org</tt></span><u><span style='color:blue'><br></span></u><a href="http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion"><tt><span style='font-size:10.0pt'>http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion</span></tt></a><o:p></o:p></p></div></div></body></html>