Bug 148661

Summary: [formatter] leverage CombinedBinaryExpression in BinaryExpressionFragmentBuilder#visit(BinaryExpression, BlockScope)
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M2   
Hardware: PC   
OS: All   
Whiteboard:

Description Maxime Daniel CLA 2006-06-26 11:01:06 EDT
v_702

This is a fup of bug 102728.
BinaryExpressionFragmentBuilder#visit(BinaryExpression, BlockScope) implements its own traversal of binary expressions. As such, it bypasses the safer traversal put in place with CombinedBinaryExpression, hence tends to hit the stack bottom before the 64K limit on method bodies is reached (typically, it takes about six times shorter strings concatenations to break the formatter than it takes to hit the 64K limit).
Two possible tracks would be to:
- rely upon the regular traversal, hence leveraging CombinedBinaryExpression
  without being aware of it;
- recode the custom traversal so as to explicitly leverage   
  CombinedBinaryExpression and lower the traversal requirements on the stack.
Comment 1 Olivier Thomann CLA 2006-08-14 13:20:13 EDT
This is fixed in bug 102728.
Close as FIXED.
See bug 102728 comment 9.
Comment 2 Olivier Thomann CLA 2006-08-15 13:56:01 EDT
Released for 3.3 M2.
Comment 3 Maxime Daniel CLA 2006-09-19 01:36:36 EDT
Verified for 3.3 M2 using build I20060918-0010.
We no more have the stack overflow.
Using the source for FormatterRegressionTests#test625, I noticed that the formatting (default options) took almost five minutes, which was a bit misleading at first (thought I needed to open a new bug). Since the test case code is invalid anyway (far too large a method), I consider it's still OK.