Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311879 - [refactoring] adapt "change signature" refactoring
Summary: [refactoring] adapt "change signature" refactoring
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7   Edit
Hardware: Other All
: P3 enhancement (vote)
Target Milestone: 0.7.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-05-06 09:33 EDT by Stephan Herrmann CLA
Modified: 2010-09-23 12:11 EDT (History)
0 users

See Also:


Attachments
implementation incl tests (48.88 KB, patch)
2010-08-28 20:04 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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