eclipse - Is there a tool for the conversion of duplicate literals into final Strings/magic numbers in Java? -


i have java files use same string values 20 times each, , want tool replaces strings private static final string string_to_caps_as_constant or along lines. if can convert numbers magic numbers, great. i'm using eclipse if it's standalone tool can still make use of it.

i think eclipse provides already. if select whole string , press ctrl+1 should give opportunity choose: "extract constant". implicitly replace occurrencies of string new constant.