Bug 103970 - [astrewrite] problem replacing parentized expression
Summary: [astrewrite] problem replacing parentized expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 107283 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-15 04:07 EDT by Rafi Rubin CLA
Modified: 2005-09-20 09:45 EDT (History)
2 users (show)

See Also:


Attachments
Simple test case to demonstrate inference error (142 bytes, text/x-java)
2005-07-15 04:09 EDT, Rafi Rubin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafi Rubin CLA 2005-07-15 04:07:07 EDT
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));
        }
}
Comment 1 Rafi Rubin CLA 2005-07-15 04:09:37 EDT
Created attachment 24831 [details]
Simple test case to demonstrate inference error

Try infering generics on this class
Comment 2 Dirk Baeumer CLA 2005-08-10 06:52:42 EDT
Markus, can you please investigate. Is this something we want to fix for 3.1.1 ?
Comment 3 Markus Keller CLA 2005-08-10 07:10:55 EDT
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.
Comment 4 Martin Aeschlimann CLA 2005-08-18 05:28:27 EDT
*** Bug 107283 has been marked as a duplicate of this bug. ***
Comment 5 Martin Aeschlimann CLA 2005-08-19 12:28:44 EDT
fixed > 20050819
Comment 6 Benno Baumgartner CLA 2005-09-20 08:55:37 EDT
verified using I20050920-0010