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 ?

7 comments

Nice suggestion, please file a request to JIRA.

0

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

--Dave Griffith

0

On 2007-03-28 01:08:58 +0400, Dave Griffith <dave.griffith@cnn.com> said:

Suffixes too!


??!

0


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?


0

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

0

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

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

0

Please sign in to leave a comment.