Bug 82830 - AST: String concatenation represented as single node
Summary: AST: String concatenation represented as single node
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 82464 86899 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-14 04:09 EST by Martin Aeschlimann CLA
Modified: 2005-03-31 05:17 EST (History)
3 users (show)

See Also:


Attachments

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