Skip to content

Error when renaming overridden method in enum constant #389

@mauromol

Description

@mauromol

This was (in part) GRECLIPSE-1538.

Consider the following:

package b; 

enum R { 
	A() { 
		@Override 
		String getFoo() { 
			
		} 
	}, 
	B() {
		 @Override 
		 String getFoo() { 
			 "bar" 
		 } 
	} 
	
	String getFoo() { 
		
	} 
} 

Now, select getFoo in either A or B definition and hit Ctrl+Shift+R to rename. Change it to getBar and hit enter: the following error dialog is shown:

Could not create a method handle for project 'null' with handle identifier '=MyGroovyProject/src/main/groovy<b{R.groovy[R[b.R$1~getFoo'

However, if you issue the same refactoring from the base getFoo() declaration, it works correctly.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions