[furcas-discussion] NPE during ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext
Uhl, Axel
axel.uhl at sap.com
Thu Feb 17 10:35:14 CET 2011
Hi Thomas,
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.
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.
I'm confused by the code in DelayedReferencesHelper.setReference where DelayedReference.setRealValue(...) is called with one of the objects resulting from running one 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?
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?
Can you shed some light on these issues?
Thanks and best,
-- Axel
From: furcas-discussion-bounces at lists.furcas.org [mailto:furcas-discussion-bounces at lists.furcas.org] On Behalf Of Thomas Goldschmidt
Sent: Thursday, February 17, 2011 8:48 AM
To: furcas-discussion
Subject: Re: [furcas-discussion] NPE during ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext
Hi Axel,
If I see it right ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext 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.
Cheers,
Thomas
[cid:image001.gif at 01CBCE88.92A5E1D0]
Thomas Goldschmidt
ABB AG
Forschungszentrum
Wallstadter Straße 59
68526 Ladenburg
Office Phone: +49 6203 716134
Office Fax: +49 6203 716253
e-mail: thomas.goldschmidt at de.abb.com
ABB AG
Sitz/Head Office: Mannheim
Registergericht/Registry Court: Mannheim
Handelsregisternummer/Commercial Register No.: HRB 4664
Geschäftsführung/Managing Board: Peter Smits (Vorsitzender), Joachim Schneider, Markus Ochsner, Hans-Georg Krabbe
Vorsitzender des Aufsichtsrats/Chairman of Supervisory Board: Bernhard Jucker
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.
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.
"Uhl, Axel" <axel.uhl at sap.com>
Sent by: furcas-discussion-bounces at lists.furcas.org
16.02.2011 16:03
To
furcas-discussion <furcas-discussion at lists.furcas.org>
cc
Subject
[furcas-discussion] NPE during ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext
Hi,
I'm getting the below NPE while parsing the text
"article{ Shrt, \"John Doe\"}" +
"article{ Medium, \"John Doe\"}" +
"article{ LongLongLong, \"Jane Doll\"}" +
"author = \"John Doe\"." +
"author = \"Jane Doll\"."
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.
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.
Suggestions?
-- Axel
Thread [main] (Suspended (breakpoint at line 118 in Query2OppositeEndFinder))
Query2OppositeEndFinder.navigateOppositePropertyWithBackwardScope(EReference, EObject) line: 118
ParserTextBlocksHandler.getTextBlockForElementAt(EObject, ANTLR3LocationToken) line: 656
ParserTextBlocksHandler.notifyModelElementResolvedOutOfContext(Object, Object, Token, DelayedReference) line: 550
BibtexWithComplexForeachPropertyInitsParser(ObservablePatchedParser).onRuleElementResolvedOutOfContext(Object, Object, ANTLR3LocationToken, DelayedReference) line: 111
BibtexWithComplexForeachPropertyInitsParser(ObservableInjectingParser).setDelayedReferencesAfterParsing() line: 683
ReferenceHandlerImpl.resolveRemainingReferences() line: 272
IncrementalParser.incrementalParse(TextBlock, boolean) line: 299
IncrementalParser.incrementalParse(TextBlock) line: 130
IncrementalParserFacade.parseIncrementally(TextBlock) line: 208
TestPropertyInitReEvaluationWithComplexForeach(AbstractReferenceResolvingTestWithTextBlocks).parseFile(String) line: 128
TestPropertyInitReEvaluationWithComplexForeach(AbstractReferenceResolvingTestWithTextBlocks).setupModelFromTextToParse(String) line: 117
TestPropertyInitReEvaluationWithComplexForeach.setupInitialModel() line: 72
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
FrameworkMethod$1.runReflectiveCall() line: 44
FrameworkMethod$1(ReflectiveCallable).run() line: 15
FrameworkMethod.invokeExplosively(Object, Object...) line: 41
RunBefores.evaluate() line: 27
RunAfters.evaluate() line: 31
BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 76
BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 50
ParentRunner$3.run() line: 193
ParentRunner$1.schedule(Runnable) line: 52
BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191
ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42
ParentRunner$2.evaluate() line: 184
RunBefores.evaluate() line: 28
BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236
JUnit4TestClassReference(JUnit4TestReference).run(TestExecution) line: 49
TestExecution.run(ITestReference[]) line: 38
RemotePluginTestRunner(RemoteTestRunner).runTests(String[], String, TestExecution) line: 467
RemotePluginTestRunner(RemoteTestRunner).runTests(TestExecution) line: 683
RemotePluginTestRunner(RemoteTestRunner).run() line: 390
RemotePluginTestRunner.main(String[]) line: 62
CoreTestApplication.run(Object) line: 23
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
EclipseAppContainer.callMethodWithException(Object, String, Class[], Object[]) line: 587
EclipseAppHandle.run(Object) line: 198
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 369
EclipseStarter.run(String[], Runnable) line: 179
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
Main.invokeFramework(String[], URL[]) line: 619
Main.basicRun(String[]) line: 574
Main.run(String[]) line: 1407
Main.main(String[]) line: 1383
[attachment "BibtexWithComplexForeachPropertyInits.tcs" deleted by Thomas Goldschmidt/DEABB/ABB] _______________________________________________
Furcas-discussion mailing list
Furcas-discussion at lists.furcas.org
http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.furcas.org/pipermail/furcas-discussion/attachments/20110217/25b276fc/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 454 bytes
Desc: image001.gif
URL: <http://lists.furcas.org/pipermail/furcas-discussion/attachments/20110217/25b276fc/attachment-0001.gif>
More information about the Furcas-discussion
mailing list