Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343023

Summary: Clear the initial stack trace console message on the first edit
Product: [Eclipse Project] JDT Reporter: Ewgeni Grigorov <grigorov.dev>
Component: DebugAssignee: Paul Pazderski <paul-eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: curtis.windatt.public, daniel_megert, harendra, Michael_Rennie, paul-eclipse, sarika.sinha, takajo, takepon
Version: 3.7   
Target Milestone: 4.12 M3   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/141483
https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=4a46acd98b93107350796f50c41cc03a5cc7035d
https://git.eclipse.org/r/142419
https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=161442a88b05dc90a5ab49147d21c077198f8fa0
Whiteboard:
Attachments:
Description Flags
possible fix curtis.windatt.public: iplog+, curtis.windatt.public: review-

Description Ewgeni Grigorov CLA 2011-04-15 18:06:13 EDT
Build Identifier: CVS, 16.04.2011

Initially, the idea comes from:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=77730#c3
I think that it's very useful, because that behavior will save a user operation.

Reproducible: Always

Steps to Reproduce:
To reproduce, just paste a stack trace in the initialized stack trace console. The initial console message will remain.
Comment 1 Ewgeni Grigorov CLA 2011-04-15 18:08:17 EDT
Created attachment 193410 [details]
possible fix

The attached fix is based on DocumentListener, which is added on the first initialization and removed after the first usage.
Comment 2 Curtis Windatt CLA 2012-11-20 12:34:26 EST
Fixed as part of the debug patch day.  Thanks for the contribution!

http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=07c5f52b120128c0562ef7dc7ed2aed8388a2e68
Comment 3 Michael Rennie CLA 2012-12-11 15:24:18 EST
Verified in:

Version: 4.3.0
Build id: I20121210-2000
Comment 4 Dani Megert CLA 2012-12-17 05:56:57 EST
There a corner case which is now broken, see bug 396734.
Comment 5 Curtis Windatt CLA 2013-01-09 16:03:09 EST
None of the fixes proposed here or in bug 396734 have been satisfactory.  At this point I can't put more time into debugging the console document adapter for this trivial feature.  Hopefully someone from the community can make an attempt at a better fix.

Reverted fix:
http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=1ddf9e9d7369dfd82cf95476a6744906c6bc48d2
Comment 6 Akihiko Takajo CLA 2013-04-19 06:01:11 EDT
does not work with 4.3M6
Comment 7 Dani Megert CLA 2013-04-19 06:08:15 EDT
(In reply to comment #6)
> does not work with 4.3M6

Please read comment 5.
Comment 8 Eclipse Genie CLA 2019-05-01 17:49:16 EDT
New Gerrit change created: https://git.eclipse.org/r/141483
Comment 9 Paul Pazderski CLA 2019-05-01 17:49:51 EDT
(In reply to Eclipse Genie from comment #8)
> New Gerrit change created: https://git.eclipse.org/r/141483

This change implements the initial clear including a bunch of test cases.

If stack trace console is loaded with initial default content the first user edit will be modified as if user selected the initial content before typing, pasting, whatever.
A programmatically content change before first user edit is recognized and  the content will not cleaned on following user edits.
If content was explicit set and this content is equal to the default content it will not be removed on first user edit. I.e. cleaning depends on how content was set not on actual content.
Comment 11 Sarika Sinha CLA 2019-05-17 04:10:29 EDT
Thanks Paul! Please add a N&N entry for this.
Comment 12 Sarika Sinha CLA 2019-05-20 02:53:51 EDT
(In reply to Sarika Sinha from comment #11)
> Thanks Paul! Please add a N&N entry for this.

@Paul!
N&N needs to go by Wendnesday may 22nd.
Comment 13 Eclipse Genie CLA 2019-05-20 04:29:54 EDT
New Gerrit change created: https://git.eclipse.org/r/142419
Comment 15 Sarika Sinha CLA 2019-05-21 04:44:29 EDT
Verified using Build id: I20190520-1805.