Bug 24622

Summary: ast: problems with missing ParenthesizedExpression nodes #2
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2002-10-10 08:43:13 EDT
class Test{
    void test(){
        String i= 2 * 3 + "" + (true);
    }
}

'true' does live in a ParenthesizedExpression here.
strangely, if you change the line to:

String i= 3 + "" + (true);

it does.
Comment 1 Olivier Thomann CLA 2002-10-10 09:14:40 EDT
I guess you mean "it doesn't" in the first case and "it does" in the second.
I will investigate immediately.
Comment 2 Adam Kiezun CLA 2002-10-10 09:21:40 EDT
yes, sorry for the typo
Comment 3 Olivier Thomann CLA 2002-10-10 10:12:46 EDT
I located the problem. It explained why it works in the second case. When I
convert 2 * 3 + "" + (true), I realized that this won't fix in a single infix
expression using the extended list operands. Therefore I convert again the first
binary expression, but like (true) was already converted I lost its original
positions and when I convert it again, I have no idea it has parenthesis. I will
try to see how to change this algorithm. It might take a while to get it working
properly. 
Comment 4 Olivier Thomann CLA 2002-10-10 14:55:30 EDT
Fixed and released in 2.1 stream.
Thanks for your report.
Regression tests added.
Comment 5 Olivier Thomann CLA 2002-10-11 14:56:10 EDT
Change milestone
Comment 6 David Audel CLA 2002-10-17 10:33:41 EDT
Verified.