Bug 82830

Summary: AST: String concatenation represented as single node
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: as, Konstantin.Scheglov, markus.kell.r
Version: 3.0   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2005-01-14 04:09:57 EST
20050114

Look at the following code in the AST view (version 1.0.3)

class A {
  String x= "a" + "b" + "c";
}

In the ASTView view menu select to use the AST obtained by 'reconcile()':
   "a" + "b" + "c" is represented as a single StringLiteral of value 'abc'!

When the AST is obtained the normal way (ASTParser),
  "a" + "b" + "c" is correctly modeled as InfixOperation
Comment 1 Martin Aeschlimann CLA 2005-01-14 04:11:01 EST
*** Bug 82464 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Thomann CLA 2005-01-14 11:01:19 EST
Reconcile should specify that the string literals should not be optimized.
Comment 3 Jerome Lanneluc CLA 2005-03-01 18:15:23 EST
*** Bug 86899 has been marked as a duplicate of this bug. ***
Comment 4 Jerome Lanneluc CLA 2005-03-07 09:33:58 EST
Changed SourceElementParser constructor to take the 'optimizeStringLiterals'
flag. Changed CompilationUnit#buildStructure(...) to pass in false if creating
an AST.
Added regresison test ASTConverterTest2#test0574()
Comment 5 David Audel CLA 2005-03-31 05:17:03 EST
Verified in I20050330-0500