Bug 148661 - [formatter] leverage CombinedBinaryExpression in BinaryExpressionFragmentBuilder#visit(BinaryExpression, BlockScope)
Summary: [formatter] leverage CombinedBinaryExpression in BinaryExpressionFragmentBuil...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-26 11:01 EDT by Maxime Daniel CLA
Modified: 2006-09-19 01:36 EDT (History)
0 users

See Also:


Attachments

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