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

Bug 311879

Summary: [refactoring] adapt "change signature" refactoring
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: noteworthy
Version: 0.7   
Target Milestone: 0.7.1   
Hardware: Other   
OS: All   
Whiteboard:
Attachments:
Description Flags
implementation incl tests none

Description Stephan Herrmann CLA 2010-05-06 09:33:42 EDT
When the signature of a method is changed via refactoring 
that is bound in a (callin/callout) method binding, the refactoring
currently reports this error:

"Cannot update found node: nodeType=84;..."

This is because ChangeSignatureProcessor#createOccurrenceUpdate(..)
cannot handle method spec (nodeType=84) as the parent.
Adaptation should create a special form of ReferenceUpdate instead.
Comment 1 Stephan Herrmann CLA 2010-08-28 20:04:29 EDT
Created attachment 177666 [details]
implementation incl tests

Implemented using a new team ChangeSignatureAdaptor:
- adjust any method specs that refer to a method whose signature is 
  being changed
- report if changes should propagate through the method mapping
  (which is not automated)
- if possible absorb re-ordering of arguments by adding parameter mappings

Tests are included.

Also: improve handling of parameter mappings in AstRewriteAnalyzer.
Comment 2 Stephan Herrmann CLA 2010-08-28 20:14:46 EDT
Patch has been committed as r748 - r750

One more note on the changes in AstRewriteAnalyzer: without this patch
adding parameter mappings using a ListRewrite produced overlapping edits.
The new method is a mix of rewriteMethodBody and some bits of the old
implementation.
Comment 3 Stephan Herrmann CLA 2010-09-23 12:11:38 EDT
Verified using I201009211735