Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property reference in with { } closure not renamed #1091

Closed
mauromol opened this issue Apr 20, 2020 · 2 comments
Closed

Property reference in with { } closure not renamed #1091

mauromol opened this issue Apr 20, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@mauromol
Copy link

Consider this:

package test62

class GBean {
	String fooBar
	String bar
}

and this:

package test62
class Test62 {
	void doSomething() {
		def g = new GBean()
		g.with { 
			fooBar = 'foo'
			bar = 'bar'
		}
	}
}

Now go to GBean, highlight GBean.fooBar, hit Alt+Shift+R and rename fooBar to foo: the reference in Test62.doSomething() is not renamed.
The strange thing is that if you do the opposite (source is foo, rename to fooBar), it works correctly.

Another strange behaviour (but I think it's for the same reason): if you issue Alt+Shift+R from Test62 instead of GBean and you try to rename fooBar to foo, after the operation is finished the editor replaces foo with fooBar.

@eric-milles
Copy link
Member

ready to test

You may need to rebuild the Java index before trying again.

@mauromol
Copy link
Author

Tested with Greclipse 3.8.0.v202004230438-e1912: even if I rebuilt the index, it didn't work at first unless Test62 applied @CompileStatic. After several attempts and a "Search for references", it seems now to work reliably, even if Test62 does not apply @CompileStatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants