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

Bug 342970

Summary: Change signature of IPhase#execute() to #execute(Display)
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 RC1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 341763    
Attachments:
Description Flags
Proposed changes none

Description Rüdiger Herrmann CLA 2011-04-15 09:35:59 EDT
Currently all implementations of IPhase access the current display. I.e. their method body begins with
  Display display = RWTLifeCycle.getSessionDisplay();
  // do something with display

To avoid this duplication, I suggest to change the signature of the execute method to
  void execute( Display display );
and let the (single) caller pass in the display.

What do you think?
Comment 1 Rüdiger Herrmann CLA 2011-04-15 11:31:56 EDT
With bug 340927 resolved, the JavascriptResponseWriter (former HtmlResponseWriter) no longer throws IOExceptions. Hence there is no need any more for IPhase#execute() to declare throws IOException.
Comment 2 Rüdiger Herrmann CLA 2011-04-20 10:23:36 EDT
Created attachment 193703 [details]
Proposed changes

IPhase#execute() now requires the display on which it should operate as an argument.
PhaseExecutor (used by SimpleLifeCycle) now has an abstract getDisplay() method so that the LifeCycle implementation can supply the current session display (which can change from null to non-null and back with each phase).
Comment 3 Rüdiger Herrmann CLA 2011-05-03 06:06:12 EDT
Applied patch to CVS HEAD