Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 101834 - [implementation] StackOverflow in Text Editor / ANT Editor
Summary: [implementation] StackOverflow in Text Editor / ANT Editor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-27 04:38 EDT by Ralf Taugerbeck CLA
Modified: 2005-06-27 12:38 EDT (History)
1 user (show)

See Also:


Attachments
Patch against ProjectionDocument.java (1.09 KB, patch)
2005-06-27 08:25 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Taugerbeck CLA 2005-06-27 04:38:54 EDT
I get a StackOverflowError when trying to enter a new line in the ANT Editor.
Strange to say this problem only occurs if I use a custom name for my build file
(other than build.xml, e.g. deploy.xml).
The problem is related to 3.1 up to RC4.


java.lang.StackOverflowError
	at
org.eclipse.jface.text.TextUtilities.getDefaultLineDelimiter(TextUtilities.java:480)
	at
org.eclipse.jface.text.projection.ProjectionDocument.getDefaultLineDelimiter(ProjectionDocument.java:207)

...
	at
org.eclipse.jface.text.projection.ProjectionDocument.getDefaultLineDelimiter(ProjectionDocument.java:207)
	at
org.eclipse.jface.text.TextUtilities.getDefaultLineDelimiter(TextUtilities.java:480)
	at
org.eclipse.jface.text.projection.ProjectionDocument.getDefaultLineDelimiter(ProjectionDocument.java:207)
	at
org.eclipse.jface.text.TextUtilities.getDefaultLineDelimiter(TextUtilities.java:480)
	at
org.eclipse.jface.text.DefaultDocumentAdapter.getLineDelimiter(DefaultDocumentAdapter.java:263)
	at org.eclipse.swt.custom.StyledText.getLineDelimiter(StyledText.java:3766)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2571)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5098)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5124)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4857)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
Comment 1 Dani Megert CLA 2005-06-27 05:31:03 EDT
I cannot reproduce this using fresh 3.1 RC4 installed to an empty directory and
without any additional plug-ins.

Please provide more detailed steps.
Comment 2 Tom Hofmann CLA 2005-06-27 05:41:44 EDT
Not reproducable either on Linux/GTK.
Comment 3 Ralf Taugerbeck CLA 2005-06-27 06:02:56 EDT
(In reply to comment #1)
> I cannot reproduce this using fresh 3.1 RC4 installed to an empty directory and
> without any additional plug-ins.
> 
> Please provide more detailed steps.

I successively disabled all additional plugins I use. The problem seems to be
related to the WTP plugins. Without these I can not reproduce the stack overflow
either.
Sorry  for the inconvenience.
Comment 4 Dani Megert CLA 2005-06-27 06:41:01 EDT
Could check which editor gets opened when the WTP plug-ins are enabled? Also,
did you use the lates WTP version?
Comment 5 Ralf Taugerbeck CLA 2005-06-27 07:10:19 EDT
I open the Ant Editor (Open with...). XML Source Page Editor works fine.
Build is WTP I20050617.
Comment 6 Dani Megert CLA 2005-06-27 07:36:42 EDT
I see what's happening here: you're running into the problem that's originally
discussed in bug 71081 and is now in bug 101846. WTP probably register their own
document creation and setup for *.xml or the XML content type. This results in a
document being used for the text and Ant editor that they do not expect.

For 3.1.1 we will protect against the stack overflow but this will still not
guarantee that you will be able to open those to editors. We will have solve the
document creation problem to ensure this.
Comment 7 Dani Megert CLA 2005-06-27 08:25:34 EDT
Created attachment 24026 [details]
Patch against ProjectionDocument.java
Comment 8 Ralf Taugerbeck CLA 2005-06-27 08:48:40 EDT
That fixes my problem. thanks :-)
As far as I am concerned the issue can be closed.
Comment 9 Dani Megert CLA 2005-06-27 09:27:36 EDT
Filed WTP bug 101860 asking to implement IDocumentExtension4.
Comment 10 Dani Megert CLA 2005-06-27 12:16:23 EDT
Since there's a rebuild and the fix is low riks we will put this into 3.1.
Comment 11 Dani Megert CLA 2005-06-27 12:38:36 EDT
Bug verified by Tom and Markus.
Released to HEAD and into I20050627-1400.