Bug 19898 - StackOverflowError in BinaryExpression
Summary: StackOverflowError in BinaryExpression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-06-11 09:58 EDT by David Audel CLA
Modified: 2004-05-18 13:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2002-06-11 09:58:27 EDT
1) open org.eclipse.jdt.tests.core.TypeHierarchyTests.
2) add an error in this class.
3) click on the Quick Fix light.

StackTrace:
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType
(BinaryExpression.java:1638)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType
(BinaryExpression.java:1638)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType

        ...

(BinaryExpression.java:1638)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType
(BinaryExpression.java:1638)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType
(BinaryExpression.java:1638
Comment 1 Philipe Mulet CLA 2002-06-11 10:54:21 EDT
Defer... DOM APIs should be protected.
Comment 2 Philipe Mulet CLA 2004-05-10 10:18:12 EDT
There is some potential for this to occur in outliner. The DOM AST isn't able 
to treat multi string concatenations in one node.

e.g. String s = "aaa" + "aab" + "aac" + .... + "zzz";

It should perform similar optimization as compiler does.
Comment 3 Philipe Mulet CLA 2004-05-10 10:18:55 EDT
Actually, previous comment should have said that it has potential to occur in 
AST created during reconcile operation.
Comment 4 Jim des Rivieres CLA 2004-05-10 10:28:43 EDT
InfixExpression.extendedOperands allows multi-string concatenations etc. to be 
represented as broad, flat ASTs.
Comment 5 Philipe Mulet CLA 2004-05-10 10:32:45 EDT
Olivier - pls verify that DOM AST had now support for handling these n-ary 
operations (should be InfixExpression.extendedOperands).

Also check that DOM AST constructed during #reconcile operation is indeed 
building such a flavor of an AST.
Comment 6 Philipe Mulet CLA 2004-05-10 10:34:26 EDT
Suspecting this to cause the fact we cannot open the ASTView on OldSearchTests.
Ask Frederic Fusier for exact steps to reproduce.
Comment 7 Frederic Fusier CLA 2004-05-10 10:56:36 EDT
You can get it also with ConformTest.
To reproduce it:
1) open the ASTView (Window->Show View->Other...->Java->ASTView), 
2) open the file (ConformTest.java or OldSearchTests.java),
3) click on ASTView bar button 'Show AST of active editor'
=> you get the StackOverflow exception...
Comment 8 Olivier Thomann CLA 2004-05-11 14:48:22 EDT
This is fixed and released in HEAD.
AST view is still failing for OldSearchTests, because of the recursion done in
the AST visitor, but it is fixed for ConformTests.
Comment 9 David Audel CLA 2004-05-18 13:17:12 EDT
Verified for 3.0M9