Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 222512 - [EditorMgmt] stack overflow opening Snippet editor
Summary: [EditorMgmt] stack overflow opening Snippet editor
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 223743 225317 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-12 22:45 EDT by Darin Wright CLA
Modified: 2008-04-30 22:00 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2008-03-12 22:45:56 EDT
I tried to open the snippet editor in eclipse.buildId=I20080305-1100 and got a stack overflow:

java.lang.StackOverflowError
at org.eclipse.ui.internal.util.Util.equals(Util.java:366)
at org.eclipse.ui.part.WorkbenchPart.internalSetPartName(WorkbenchPart.java:457)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:385)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
Comment 1 Michael Rennie CLA 2008-03-13 09:31:19 EDT
seems like a problem with the Util.equals method for platform UI.

sending to platform UI for comment.
Comment 2 Tod Creasey CLA 2008-03-17 10:41:36 EDT
Darin can you give us a longer trace - the overflow isn't clear here
Comment 3 Michael Rennie CLA 2008-03-17 12:28:24 EDT
The 'complete' stack trace repeats the section Darin pasted in (many many times).

For example:
java.lang.StackOverflowError
at org.eclipse.ui.internal.util.Util.equals(Util.java:366)
at org.eclipse.ui.part.WorkbenchPart.internalSetPartName(WorkbenchPart.java:457)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:385)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:387)
at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor.setTitle(JavaSnippetEditor.java:1189)
at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)

Steps I used to reproduce:

1. go to New -> Other...
2. select Scrapbook Page from Java -> Java Run/Debug
3. enter name + select location
4. hit finish
Comment 4 Boris Bokowski CLA 2008-03-24 02:40:55 EDT
Both EditorPart and WorkbenchPart did not change recently. Could this be due to changes on your side?
Comment 5 Darin Wright CLA 2008-03-24 09:59:17 EDT
We didn't change anything on the Snippet Editor side. I can fix the problem by not overriding "setTitle(...)" which was deprecated at some point, and overriding "setPartName(...)" instead.
Comment 6 Darin Wright CLA 2008-03-24 09:59:42 EDT
I have released the fix to HEAD so the editor can now be opened.
Comment 7 Darin Wright CLA 2008-03-24 21:53:14 EDT
*** Bug 223743 has been marked as a duplicate of this bug. ***
Comment 8 Darin Wright CLA 2008-04-02 11:01:56 EDT
*** Bug 225317 has been marked as a duplicate of this bug. ***
Comment 9 Mike Wilson CLA 2008-04-30 14:39:36 EDT
If setTitle is deprecated, and _it_doesn't_actuall_work_, shouldn't we remove it?

Comment 10 Boris Bokowski CLA 2008-04-30 21:07:47 EDT
(In reply to comment #9)
> If setTitle is deprecated, and _it_doesn't_actuall_work_, shouldn't we remove
> it?

It turns out that setTitle does work.

This bug was caused by Michael Rennie's change to JavaSnippetEditor with the commit comment "trying api tooling" (see revision 1.125) on Feb 27, 2008.

Your current code looks good, but you could also go back to setTitle() as of 1.124, which called super.getTitle - it's your choice. When overriding a setter, the recommended practice is to call the super implementation, not some other setter.
Comment 11 Darin Wright CLA 2008-04-30 22:00:09 EDT
Marking as works for me. We have since adjusted the code to work.