Bug 109535

Summary: [DOM] Wrong infix expression when '-' is used within string literals
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.2   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Regression test none

Description Olivier Thomann CLA 2005-09-14 15:18:14 EDT
 
Comment 1 Olivier Thomann CLA 2005-09-14 15:19:47 EDT
Using latest, the following code doesn't produce the right tree.

public class X {
	String f = "" + "" - 1;
}

"" + "" - 1 produces a unique infix expression with operator '-' and an extended
operands (1).
This is wrong. It should be two infix expressions.
It works fine if only number literals are used.
Comment 2 Olivier Thomann CLA 2005-09-14 15:20:19 EDT
Fix for this one is needed for the work on the code formatter.
Comment 3 Olivier Thomann CLA 2005-09-14 19:32:30 EDT
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0618.
Comment 4 Olivier Thomann CLA 2005-09-14 19:32:54 EDT
Created attachment 27145 [details]
Proposed fix
Comment 5 Olivier Thomann CLA 2005-09-14 19:33:17 EDT
Created attachment 27146 [details]
Regression test
Comment 6 Olivier Thomann CLA 2005-09-14 19:35:07 EDT
Philippe, candidate for 3.1.1?
Comment 7 Maxime Daniel CLA 2005-09-20 12:13:40 EDT
Verified for 3.2 M2 on build Build id: I20050920-0010.