Refactoring : renaming properties, suggestion

I just discovered the rename refactoring works in properties file, allowing to rename a properties.
THis is great !

I was disapointed to discover it doesn't rename other properties that have the same prefix though.

ex :

If I decide to rename the property "log4j.appender.console" it does not rename all the following ones.

What is the feeling of the other IDEA users on this ?


Nice suggestion, please file a request to JIRA.


Ooooh! Shiny! Yes please, as soon as possible. Suffixes too!

--Dave Griffith


On 2007-03-28 01:08:58 +0400, Dave Griffith <> said:

Suffixes too!



I think that the current behaviour is fine.

As far as I know, a property key is 'opaque', there is no internal hierarchy
defined in a set of keys just because the prefixes are the same.
Other thoughts:
1) I think prefix renaming in quite rare...
2) How would you rename only the first key in your example if prefix matching
was implemented?
3) Why not just use search & replace for prefix renaming?


You are right, nothing in the properties specification assumes hierarchy.

The reason i suggested this, is that AFAIK it is a very common practice, log4j being only an example.

I guess the refactoring could provide the choice of wether to replace all or none, either with a check box (proposing to rename all properties sharing suffix/prefix), or via the confirmation window, where you would exclude any non wanted


It's not uncommon to have sets of property names which all end with some sort of role identifier (".label", ".error.string", "").

Actually, this would be somewhat handy for class renaming as well (look at classes ending with -Impl, -Ifc or -DAO), although probably less valuable.

--Dave Griffith


Please sign in to leave a comment.