Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 308650

Summary: [DI] Requestors pick up extra dependencies during updates
Product: [Eclipse Project] e4 Reporter: Oleg Besedin <ob1.eclipse>
Component: UIAssignee: Oleg Besedin <ob1.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, ob1.eclipse, remy.suen
Version: unspecified   
Target Milestone: 1.0 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JUnit test
none
Patch none

Description Oleg Besedin CLA 2010-04-09 10:24:43 EDT
When a value is changed in the context, the context object supplier calls 
 IInjector#update(requestor)

In the case of an injected method, that means that:
(1) arguments of the method call will be re-resolved
(2) method will be called with re-resolved arguments

We want to track dependencies on the context values estabilshed by (1), but not by (2).

At present, the whole IInjector#update(requestor) is called from inside IRunAndTrack, and, hence, both dependencies from (1) and (2) are recorded.

We'll need to change how changes to the [context] objects are propagated. It would have to become a two-step process, probabaly using IRequestor as the API between object suppliers and injector:

 (1) call IRequestor.resolveArgs() -> to be done inside IRunAndTrack
 (2) call IRequestor.execute() -> to be done outside IRunAndTrack
Comment 1 Oleg Besedin CLA 2010-04-09 11:18:25 EDT
Created attachment 164389 [details]
JUnit test

The JUnit illustrates the problem.
Comment 2 Oleg Besedin CLA 2010-04-09 16:56:24 EDT
Created attachment 164433 [details]
Patch

The fix - basically turn dependencies tracking off in the context while we call the injected method.
Comment 3 Oleg Besedin CLA 2010-04-12 16:09:08 EDT
Patch applied to CVS Head.