Community
Participate
Working Groups
Preferences are set up so that local variables have prefix "the" and fields have prefix "its". The "Convert local to field" refactoring should strip the local variable prefix, and replace it by the field prefix. Current behaviour is only to prepend the field prefix. For instance if in a method I have this variable: String theName = "name"; Invoking the refactoring proposes the following name is suggested: "itsTheName".
Agree. Markus, please fix for 3.1
Moving to jdt.core. The bug is in org.eclipse.jdt.core.NamingConventions: public static char[] removePrefixAndSuffixForLocalVariableName( IJavaProject javaProject, char[] localName) { AssistOptions assistOptions = new AssistOptions(javaProject.getOptions(true)); return removePrefixAndSuffix( localName, assistOptions.argumentPrefixes, assistOptions.argumentSuffixes); } => Should be *local*Prefixes/Suffixes.
Thanks, Markus. That fixed it. Added regression test. Fixed and released in HEAD.
Could not find regression test. Olivier what is the regression test ?
The test is NamingConventionTests.testRemovePrefixAndSuffixForLocalName001()
Verified (in I200412140800) that the test ensures that the prefix and suffix are correctly removed.