Bug 137975 - [Polish item] Add a preference to disable globally the javadoc attachments
Summary: [Polish item] Add a preference to disable globally the javadoc attachments
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 138202
  Show dependency tree
 
Reported: 2006-04-21 11:58 EDT by Olivier Thomann CLA
Modified: 2006-04-25 14:38 EDT (History)
6 users (show)

See Also:


Attachments
Proposed fix (4.61 KB, patch)
2006-04-21 13:35 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (4.32 KB, patch)
2006-04-24 11:23 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2006-04-21 11:58:39 EDT
Fup of bug 135604, we should add an option to disable the javadoc attachment per project.
This would allow the user (behind a firewall for example) to disable the javadoc retrieval without editing manually each classpath container entry or classpath entry.
Editing each entry to remove the javadoc attachment makes it painful to add it back if the firewall is disabled. The information has been lost.
Comment 1 Dani Megert CLA 2006-04-21 12:09:20 EDT
Does per project help? Isn't the shared JRE still bound to just one (the first project) when asking for its parent? Also, if I'm disconnected, do I really need/want to go into each project?
Comment 2 Martin Aeschlimann CLA 2006-04-21 12:11:22 EDT
I think it rather should disable the attempt to resolve an external java location.
Local locations ('file://...') can still be used, everything else skipped.
Comment 3 Olivier Thomann CLA 2006-04-21 12:12:30 EDT
Ok, good point.
Then change the title.
Comment 4 Olivier Thomann CLA 2006-04-21 13:35:32 EDT
Created attachment 39192 [details]
Proposed fix

Frederic,

Could you please review it to see if I didn't miss anything in adding a new option?
Thanks.
Comment 5 Frederic Fusier CLA 2006-04-22 06:48:02 EDT
Sounds OK for me
Comment 6 Philipe Mulet CLA 2006-04-24 11:10:22 EDT
Re: comment 2. I don't think "file:" is a valid criteria for determining local/external. It could denote a mounted file on the filesystem, which can be unavailable when disconnected.
I would rather favour a global solution (all or nothing).
Comment 7 Philipe Mulet CLA 2006-04-24 11:12:29 EDT
Mike ? Would you cast a vote for this feature addition ? (a pref addition for controlling retrieval of javadoc for fault-tolerance).
Basically, without a pref, user has no choice by edit all his .classpath files to remove javadoc locations (and add them back once re-connected).
Comment 8 Olivier Thomann CLA 2006-04-24 11:23:56 EDT
Created attachment 39287 [details]
Proposed fix

New patch disables the javadoc attachments in all cases. Not just for http protocol.
Comment 9 Olivier Thomann CLA 2006-04-24 11:24:22 EDT
Frederic,

Could you please review it?
Thanks.
Comment 10 Mike Wilson CLA 2006-04-24 11:24:44 EDT
Adding a preference for this is fine. +1.

I took a look at the patch and it does not appear to include the GUI for changing the value. I'm assuming you will want to do that. Given how unlikely it is that most people will want to change this setting, you will need to make sure that adding support for it does not make the commonly used JDT preference pages even more complex.
Comment 11 Olivier Thomann CLA 2006-04-24 11:26:42 EDT
Added bug 138202 for the UI conterpart.
Comment 12 Philipe Mulet CLA 2006-04-24 13:12:13 EDT
+1 for 3.2RC2
Comment 13 Olivier Thomann CLA 2006-04-24 13:51:57 EDT
Fixed and released in HEAD.
Comment 14 John Arthorne CLA 2006-04-24 14:43:20 EDT
(added API constant JavaCore#ENABLE_JAVADOC_ATTACHMENTS)
Comment 15 Martin Aeschlimann CLA 2006-04-24 15:08:44 EDT
Sorry if I'm really late now, but the Zurich lab was offline the whole afternoon due to a holidays and our IT department being on holiday as well so the internet was down and not fixed.

I have to request changes to the constant name and spec:

- 'ENABLE_JAVADOC_ATTACHMENTS' -> 'ENABLE_JAVADOC_ATTACHMENTS_ACCESSES'

As you say, Javadoc attributes are still there, just not used.

- 'When disabled, javadoc attachments are not used to retrieve the javadoc of java elements.' -> 'When disabled, javadoc attachments are not used to retrieve the javadoc of java elements in IJavaElement.getAttachedJavadoc and for parameter names for elements with missing source'

In JDT we use the javadoc location for features like the 'Open External Javadoc', the Javadoc wizard, and for help links.
Javadoc wizard and help links are not under our control. We can't promise the user that disabling this option will disable all useages of the Javadoc location.
Comment 16 Olivier Thomann CLA 2006-04-24 15:25:51 EDT
I don't believe we need:

	 *    and for parameter names for elements with missing source

Since the getParameterNames() already says:
 * For binary types, associated source or attached Javadoc are used to retrieve the names.
 * If none can be retrieved, then these names are invented as "arg"+i, where i starts at 0.
 * Returns an empty array if this method has no parameters.

I'll change the field name, but I propose:
	 *    When disabled, javadoc attachments are not used to retrieve
	 *    the javadoc of java elements in {@link IJavaElement#getAttachedJavadoc(IProgressMonitor) IJavaElement.getAttachedJavadoc}.

for the doc part.
Comment 17 Olivier Thomann CLA 2006-04-25 12:52:32 EDT
Daniel,

Right now the current behavior is far from being ideal for the user when behind a firewall. I don't get an unresponsive UI anymore, but there is absolutely no feedback to the user that indicates why the doc cannot be displayed.

If this is OK, I will remove the new preference and keep the actual behavior.
Comment 18 Dani Megert CLA 2006-04-25 13:09:21 EDT
>I don't get an unresponsive UI anymore,
Good. I think the unresponsive UI was the trigger for the bugs and this preference. Platform Text fixed that bug as you just confirm here.

>but there is absolutely no feedback to the user that indicates why the doc 
>cannot be displayed.
The preference would affect this scenrio only after enabled. Until then - even with the preference in place - the user will not get the feedback and will not know about this preference. And I doubt that anyone is going to toggle that preference when going on/offline.

Regarding "having no clue" - this is a valid point. According to the spec you throw a JME in case of timeout. If we'd have a way to recognize the timeout we could show this in the hover. But that's post 3.2.
Comment 19 Olivier Thomann CLA 2006-04-25 13:13:27 EDT
Then I reopen to revert my changes and close as INVALID.
It would have been nice to be aware of changes from JDT/Text in this area.
Comment 20 Philipe Mulet CLA 2006-04-25 13:17:52 EDT
+1 for removal
Comment 21 Dani Megert CLA 2006-04-25 13:28:42 EDT
>It would have been nice to be aware of changes from JDT/Text in this area.
My very first comment to the initial bug 129168 was mentioning the bug in JDT Text land and marking it as blocking the JCore bug i.e. unless you manually tweaked bugzilla mail preference you did get a notification that the JDT Text bug got fixed.
Comment 22 Olivier Thomann CLA 2006-04-25 14:38:42 EDT
Removed.
Fixed and released in HEAD.