Bug 410245 - [refactoring] renaming an argument with declared lifting via Change Method Signature fails with IOOBE
Summary: [refactoring] renaming an argument with declared lifting via Change Method Si...
Status: NEW
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 2.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Teams CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-07 17:47 EDT by Stephan Herrmann CLA
Modified: 2013-06-07 17:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2013-06-07 17:47:43 EDT
Using this team:

public team class MyTeam {

	protected class R playedBy MyBase {

	}
	
	public void process(MyBase as R argument) {
		R x = argument;
		printRole(argument);
		printRole(x);
	}
	
	void printRole(R r) {
		
	}
}

I tried to use the Change Method Signature refactoring to rename 'argument' to 'arg'.
I was greeted with:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:604)
	at java.util.ArrayList.get(ArrayList.java:382)
	at org.eclipse.jdt.core.dom.ASTNode$NodeList.get(ASTNode.java:1353)
	at org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker$MethodTypesChecker.resolveBindings(TypeContextChecker.java:177)
	at org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker$MethodTypesChecker.checkAndResolveMethodTypes(TypeContextChecker.java:126)
	at org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker.checkAndResolveMethodTypes(TypeContextChecker.java:463)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureProcessor.checkSignature(ChangeSignatureProcessor.java:401)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureProcessor.checkFinalConditions(ChangeSignatureProcessor.java:815)
Comment 1 Stephan Herrmann CLA 2013-06-07 17:48:53 EDT
See bug 394037 for initial fixes in this area.
Not sure if this bug is a regression or a different problem.