Bug 24622 - ast: problems with missing ParenthesizedExpression nodes #2
Summary: ast: problems with missing ParenthesizedExpression nodes #2
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-10 08:43 EDT by Adam Kiezun CLA
Modified: 2002-10-17 10:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.