In my Java project I was told to avoid the usage of integer and String constants in certain classes. Is there any shortcut in IntelliJ Idea to replace all usages of String and integer constants by their actual values? Something like "Extracting constants backwards". Because there are a lot of places to change and I wondered if there was some way to do it automatically.
Initial: Do you mean something like this: https://www.jetbrains.com/help/idea/extract-constant.html
Update: I will try with an example, I guess this is your case (sorry if i misunderstood again)
Lets say I have:
private static final String PAGE = "page";
private static final String LIMIT = "size";
private static final String SORT = "sort";
Then do a right click on the PAGE String: Refactor > Inline Field
and do the Refactor
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.