Community
Participate
Working Groups
type inference created this return statement: returnv.get(0); (note the lack of white space) from the following test class. package foo; import java.util.Vector; public class Bar { Vector v=null; Bar firstItem() { v.add(this); return((Bar)v.get(0)); } }
Created attachment 24831 [details] Simple test case to demonstrate inference error Try infering generics on this class
Markus, can you please investigate. Is this something we want to fix for 3.1.1 ?
This is a problem of the ASTRewrite. I replace the ParenthesizedExpression "((Bar)v.get(0))" with createMoveTarget("v.get(0)") in InferTypeArgumentsRefactoring#rewriteCastVariable(). ASTRewrite should make sure that there's a whitespace or comment after keywords such as return or assert.
*** Bug 107283 has been marked as a duplicate of this bug. ***
fixed > 20050819
verified using I20050920-0010