Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354458 - SimpleURI Proxy in LazyLinkingResource#resolveLazyCrossReference(...)
Summary: SimpleURI Proxy in LazyLinkingResource#resolveLazyCrossReference(...)
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 03:13 EDT by Benjamin Schwertfeger CLA
Modified: 2017-09-19 17:09 EDT (History)
4 users (show)

See Also:
sven.efftinge: indigo+


Attachments
Patch for URI-Check in LazyLinkingResource (1.58 KB, patch)
2011-08-11 04:32 EDT, Benjamin Schwertfeger CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schwertfeger CLA 2011-08-11 03:13:47 EDT
Build Identifier: 

The LazyLinkingResource tries to resolve all CrossLinkFragments as local cross links. If the Proxy is a reference from another model which can't be resolved, the resolution will fail, if you are lucky, or return the wrong element, if the Feature index combination matches.

Even worse, the resolve is triggered from isAffected if you change/save any file in the workspace.

Reproducible: Always

Steps to Reproduce:
1. Create two model files with cross references, the reference from the second is broken.
2. Write some code (i.e. a check) that get the proxy from the second file and reference it in the first file.
3. Open both files with a check which set the referenced element from another model in the file in the background.
3. After the check succeeded every change leeds to a call of isAffected and the NullPointerException is shown in a pop up window.
Comment 1 Sebastian Zarnekow CLA 2011-08-11 03:40:08 EDT
Just a minor remark: You should not modify the model during validation. Validation is a readOnly action and not guarded against concurrent modifications besides for proxy resolution.

However, resolveLazyCrossReferences should check the resource-part of the uri, too, for the sake of robustness.
Comment 2 Benjamin Schwertfeger CLA 2011-08-11 04:32:34 EDT
Created attachment 201297 [details]
Patch for URI-Check in LazyLinkingResource
Comment 3 Sven Efftinge CLA 2011-08-15 04:44:17 EDT
pushed to master
Comment 4 Karsten Thoms CLA 2017-09-19 16:58:36 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:09:51 EDT
Closing all bugs that were set to RESOLVED before Neon.0