Community
Participate
Working Groups
- "Convert local variable to field" on "colorNames" - The name proposed is "nameses" - No exceptions in log - Eclipse RC2 public class Foo { public void bar() { String[] colorNames={"red","green", "blue"}; } }
Adam, do we use core functionality for name proposing in this case ?
yes, seems like NamingConventions problem
I think this behaviour is new since RC2, I can't remember bumping into the problem earlier. Øyvind
yes, we moved to using the NamingConventions class for M3 or a bit later
I don't understand why this refactoring doesn't just leave the variable name as it is...?
normally people have conventions for instance field names, so their names would start with '_' or 'f' or something so if you have a temp named colorNames, and your pref set to 'f' prefix for field names, the refactoring should suggest 'fColorNames' as the field name
some people have name convention for fields. Some of us hate such standards and avoid it like the plague. Regardless, changing the "launcherLabel" to "label" doesn't make sense.
New naming conventions. If it is an array type which ends with "ss" then append "es" which ends with "y" then remove "y" and append "ies" which ends with "s" do nothing otherwise append "s" Fixed end tests added NamingConventions#testSuggestFieldName017 NamingConventions#testSuggestFieldName018 NamingConventions#testSuggestFieldName019 NamingConventions#testSuggestFieldName020
So, what does happen to colorNames, now? "names" or "colorNames"? In my humble opinion, the latter would make more sense...
NamingConventions propose "colorNames" and "names". Convert local variable to field refactoring must choose only one name and currently it is "colorNames".
Nice, thanks!
Those rules are good but only if you are coding in english. Not that I am coding in any other language but just a thought.
Re comments 7, 9, and 10: those issues have been resolved with bug 54444.
Verified in 200405180816