Community
Participate
Working Groups
E.g. void doTheWork(int workItemCount) {} void caller() { doTheWork(17); //extract "17" into local variable } -> proposed name: "i" -> better suggestions: "workItemCount", "itemCount", "count". This can be used in ExtractTemp, ConvertTempToField, IntroduceParameter, and maybe also in ExtractConstant refactorings. Priorities for guessing types: 1. guessTempNamesFromMethodInvocation() 2. guessTempNamesFromArgument() 3. guessTempNamesFromExpression(). This whole guessing code should be extracted into StubUtility.
Good suggestion. We should consider this for 3.1
Quick fixes use ASTResolving.suggestLocalVariableNames(IJavaProject, ITypeBinding, Expression, String[]) to guess the name from an expression. It doesn't use parameter names so far. Would make sense to move to StubUtility.
Dup of bug 207185?
verified that the example works with the fix for bug 207185 *** This bug has been marked as a duplicate of bug 207185 ***
Reopening to add support in Introduce Parameter as well.