Project: JDT
Bug 148011 [quick fix] 'create method': wrong result type on array indexing
Reported: 2006-06-21 06:21:03 | Status: resolved fixed

In my code I reference method 'foo()' which does not already exist. So I open the quick assist context menu (CTRL+1) on that reference and choose the 'create method' entry. There is a use case when this action produces a method stub with a wrong result type: When the method reference is followed by an array indexing: void f() { int i = nonExistingMethodReturningIntegerArray()[0]; } Here the new method should return an int _array_, but using quick assist results in the following method stub (some additional code parts due to template customization): /** * TODO: Description * @return */ private int nonExistingMethodReturningIntegerArray() { // TODO: implementation throw new UnsupportedOperationException("not yet implemented"); } Of course, after this action, the method reference in the caller method 'f()' shows an error: "the type of the expression must be an array type but is resolved to int" Bye, Michael Schneider

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java