Bug 193979 - AST parser generates wrong AST
Summary: AST parser generates wrong AST
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-22 09:50 EDT by Benno Baumgartner CLA
Modified: 2007-08-07 06:26 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix + regression test (8.65 KB, patch)
2007-06-22 14:01 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2007-06-22 09:50:27 EDT
N20070621-0010

Given:
package test;
public class E01 {
	public String foo() {
		return((true ? "" : ("" + "") + ""));
	}
}
1. Look at conditional expression with ASTView

Is:
CondititionalExpression
-+BooleanLiteral
 +StringLiteral
 +ParameterizedExpression
 -+InfixExpression

Should:
CondititionalExpression
-+BooleanLiteral
 +StringLiteral
 +InfixExpression
 -+ParameterizedExpression
  +StringLiteral
Comment 1 Benno Baumgartner CLA 2007-06-22 10:02:31 EDT
Hint that I've found that kind of code in the class TokenMgrError which is generated by JavaCC and used a couple of times in the SDK.
Comment 2 Olivier Thomann CLA 2007-06-22 12:42:57 EDT
Philippe,

This would be a candidate for 3.3.1.
I am testing a fix for it.
Comment 3 Olivier Thomann CLA 2007-06-22 14:01:23 EDT
Created attachment 72206 [details]
Proposed fix + regression test
Comment 4 Olivier Thomann CLA 2007-07-04 11:00:43 EDT
Released for 3.4M1.
Added regression test in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#test0678

Philippe, let me know if you want it for 3.3.1.
Comment 5 Frederic Fusier CLA 2007-08-07 06:26:53 EDT
Verified for 3.4M1 using build I20070806-1800.