Maksim Dmitriev
Maksim Dmitriev

Reputation: 6209

Eclipse. Move a static final variable to a static nested class

How to do that? I have got the static variable in the class called Constants. Now I'd like to move it to the static nested class called Constants.States. If I just right-click and select Refactor - Move, I won't see Constants.States class among proposed destinations.

Upvotes: 0

Views: 152

Answers (1)

tobias_k
tobias_k

Reputation: 82899

Just tried this. While static nested classes indeed seem not to be among the proposed classes, you can select the Constants class from the proposals and then simply add .States to the text field. Eclipse recognized the class (does not complain about the class not existing) and the refactoring worked as expected.

enter image description here

Upvotes: 1

Related Questions