Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 451540 - Add org.eclipse.jdt.core plugin to General > Tracing preference page
Summary: Add org.eclipse.jdt.core plugin to General > Tracing preference page
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.5 M4   Edit
Assignee: Szymon Ptaszkiewicz CLA
QA Contact: Jay Arthanareeswaran CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 451901
  Show dependency tree
 
Reported: 2014-11-14 08:27 EST by Szymon Ptaszkiewicz CLA
Modified: 2014-12-10 04:30 EST (History)
3 users (show)

See Also:
jarthana: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Ptaszkiewicz CLA 2014-11-14 08:27:33 EST
If a plugin provides .options file, it is possible to enable tracing for this plugin via General > Tracing preference page. This bug covers adding the org.eclipse.jdt.core plugin to this preference page to make it easier to debug problems in runtime without restarting Eclipse.
Comment 1 Szymon Ptaszkiewicz CLA 2014-11-14 08:29:14 EST
I am already working on a patch for this and will push it to Gerrit when ready.
Comment 2 Szymon Ptaszkiewicz CLA 2014-11-14 12:36:25 EST
Gerrit review: https://git.eclipse.org/r/#/c/36504/
Comment 3 Jay Arthanareeswaran CLA 2014-12-01 01:45:18 EST
(In reply to Szymon Ptaszkiewicz from comment #2)
> Gerrit review: https://git.eclipse.org/r/#/c/36504/

Patch looks good, I posted a new patch set with minor tweaks - extracted JavaCore.PLUGIN_ID + "/debug" into a constant.

Szymon, let me know if this fine by you.

Also, I am wondering if DEBUG_REGISTRATION.unregister() needs be guarded by a null-check. Or are we safe here?
Comment 4 Szymon Ptaszkiewicz CLA 2014-12-01 05:38:19 EST
(In reply to Jayaprakash Arthanareeswaran from comment #3)
> (In reply to Szymon Ptaszkiewicz from comment #2)
> > Gerrit review: https://git.eclipse.org/r/#/c/36504/
> 
> Patch looks good, I posted a new patch set with minor tweaks - extracted
> JavaCore.PLUGIN_ID + "/debug" into a constant.
> 
> Szymon, let me know if this fine by you.

Looks good. Initially, I called it "DEBUG" instead of "debug" because in case we wanted to expose the value of the general JavaCore.PLUGIN_ID + "/debug" flag, we wouldn't need to rename the variable and we could just extract it to a field in JavaModelManager. But I guess that was kind of unnecessary forward-thinking in this case. Your change looks good to me.

> Also, I am wondering if DEBUG_REGISTRATION.unregister() needs be guarded by
> a null-check. Or are we safe here?

It depends on whether we can get into state where o.e.jdt.core is half-started by finishing only part of the start(BundleContext context) method. From code analysis it looks that DEBUG_REGISTRATION will never be null because it's the very first thing in start(BundleContext context) so null-check is not strictly necessary. But we can add it to be on the safe side just in case if you want to.
Comment 5 Jay Arthanareeswaran CLA 2014-12-01 08:23:05 EST
(In reply to Szymon Ptaszkiewicz from comment #4)
> (In reply to Jayaprakash Arthanareeswaran from comment #3)
> It depends on whether we can get into state where o.e.jdt.core is
> half-started by finishing only part of the start(BundleContext context)
> method. From code analysis it looks that DEBUG_REGISTRATION will never be
> null because it's the very first thing in start(BundleContext context) so
> null-check is not strictly necessary. But we can add it to be on the safe
> side just in case if you want to.

That sounds reasonable to me. I have released it as is here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=ec3141ffcff3411a0e4abbb098ed096a885f0d97
Comment 6 Jay Arthanareeswaran CLA 2014-12-05 02:36:01 EST
See bug 451902, comment #4 through bug 451902, comment #6.
Comment 7 shankha banerjee CLA 2014-12-10 04:30:56 EST
Verified for 4.5 M4 using with build I20141209-2000.