Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 452134 - Add org.eclipse.jdt.ui plugin to General > Tracing preference page
Summary: Add org.eclipse.jdt.ui plugin to General > Tracing preference page
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (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:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 452129
  Show dependency tree
 
Reported: 2014-11-18 10:30 EST by Szymon Ptaszkiewicz CLA
Modified: 2014-12-10 07:11 EST (History)
1 user (show)

See Also:
daniel_megert: 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-18 10:30:51 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.ui plugin to this preference page to make it easier to debug problems in runtime without restarting Eclipse.
Comment 1 Szymon Ptaszkiewicz CLA 2014-11-19 08:13:56 EST
Gerrit review: https://git.eclipse.org/r/#/c/36688/
Comment 2 Szymon Ptaszkiewicz CLA 2014-11-19 08:27:52 EST
I think it would be good to adjust the behavior of debug flags so that disabling the general flag (plugin_id/debug) disables all flags (like it is done in other bundles) but this can be done in a separate bug.
Comment 3 Dani Megert CLA 2014-12-02 10:11:54 EST
(In reply to Szymon Ptaszkiewicz from comment #2)
> I think it would be good to adjust the behavior of debug flags so that
> disabling the general flag (plugin_id/debug) disables all flags (like it is
> done in other bundles) but this can be done in a separate bug.

No, it must be 'true' for the ease of the user, otherwise he has to click yet one other checkbox. Plus, when he copy/pastes from the plug-in's .options into the installation's .options file the normal use case is to start debugging, hence 'true' is the correct default.

Also note that this option only controls the general debugging mode of a plug-in as per Plugin.isDebugging(). It does not control/override all other options, and we never combined additional options with this general one.
Comment 4 Szymon Ptaszkiewicz CLA 2014-12-02 10:44:48 EST
(In reply to Dani Megert from comment #3)
> (In reply to Szymon Ptaszkiewicz from comment #2)
> > I think it would be good to adjust the behavior of debug flags so that
> > disabling the general flag (plugin_id/debug) disables all flags (like it is
> > done in other bundles) but this can be done in a separate bug.
> 
> No, it must be 'true' for the ease of the user, otherwise he has to click
> yet one other checkbox.

That it not how I perceive it. More important than enabling a single option is ability to disable debugging of the whole plugin using only the general debug flag and then enable it back also with "one click". This way you can pre-enable more fine-grained debug options and disable just the main one and then when you observe a problem, with just "one click" you can enable the whole set of previously prepared debug options at the time you need to start printing debug messages.

> Plus, when he copy/pastes from the plug-in's
> .options into the installation's .options file the normal use case is to
> start debugging, hence 'true' is the correct default.

This is not about default values in .options files but whether disabling just one flag should disable all of them. Default values in .options are not related here.

> Also note that this option only controls the general debugging mode of a
> plug-in as per Plugin.isDebugging(). It does not control/override all other
> options, and we never combined additional options with this general one.

That's not true. In case of many bundles the initialization of debug options used to look like this:

static {
	if (Activator.getInstance().isDebugging()) {
		DEBUG = true;
		DEBUG_SYSTEM_PROVIDERS = "true".equalsIgnoreCase(Activator.getInstance().getDebugOption(Activator.ID + "/systemproviders")); //$NON-NLS-1$ //$NON-NLS-2$
}

which means you had to enable the general debug flag in .options in order to enable more fine-grained debug options. Hence, they used to depend on the general one. I think that is a very useful pattern that has been used in many bundles across different projects in SDK.
Comment 5 Szymon Ptaszkiewicz CLA 2014-12-02 10:49:00 EST
(In reply to Dani Megert from comment #3)

But that's not the scope of this enhancement :) The proposed patch does not change the way options are enabled or disabled so if you don't want them to depend on the general debug option, then it's fine for me.
Comment 6 Dani Megert CLA 2014-12-02 10:54:01 EST
(In reply to Szymon Ptaszkiewicz from comment #4)
> (In reply to Dani Megert from comment #3)

As said, the intention was not to use "debug" as the main switch. If it were, then
- this would be directly wired into the framework i.e. getDebugOption would
  always check the main switch. This is not the case
- the UI would show this dependency.

I don't say that some implemented such a dependency on top of it. But as many plug-ins didn't. I'm not arguing to change one or the other, but I'm arguing not to force/change the existing strategy for existing bundles.
Comment 7 Dani Megert CLA 2014-12-02 10:54:39 EST
(In reply to Szymon Ptaszkiewicz from comment #5)
> (In reply to Dani Megert from comment #3)
> 
> But that's not the scope of this enhancement :) The proposed patch does not
> change the way options are enabled or disabled 

The change does change the .options file ;-). I'm currently reviewing the change, so stay tuned!
Comment 8 Szymon Ptaszkiewicz CLA 2014-12-02 11:07:16 EST
(In reply to Dani Megert from comment #6)
> (In reply to Szymon Ptaszkiewicz from comment #4)
> > (In reply to Dani Megert from comment #3)
> 
> As said, the intention was not to use "debug" as the main switch. If it
> were, then
> - this would be directly wired into the framework i.e. getDebugOption would
>   always check the main switch. This is not the case
> - the UI would show this dependency.
> 
> I don't say that some implemented such a dependency on top of it. But as
> many plug-ins didn't. I'm not arguing to change one or the other, but I'm
> arguing not to force/change the existing strategy for existing bundles.

I fully agree we must not force it. But it never hurts to open a bug and ask project committers for their opinion :) If they agree, I think it's fine to change it.
Comment 9 Dani Megert CLA 2014-12-02 11:08:09 EST
(In reply to Szymon Ptaszkiewicz from comment #1)
> Gerrit review: https://git.eclipse.org/r/#/c/36688/

See my comments in Gerrit. Mainly cosmetic nature.
Comment 11 Szymon Ptaszkiewicz CLA 2014-12-10 07:11:39 EST
Verified in I20141209-2000.