Bug 109535 - [DOM] Wrong infix expression when '-' is used within string literals
Summary: [DOM] Wrong infix expression when '-' is used within string literals
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-14 15:18 EDT by Olivier Thomann CLA
Modified: 2005-09-20 12:14 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (1.65 KB, patch)
2005-09-14 19:32 EDT, Olivier Thomann CLA
no flags Details | Diff
Regression test (1.43 KB, patch)
2005-09-14 19:33 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 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.