Bug 572804

Summary: DefaultHelpUI.displayContext(IContext, int, int, boolean) overwrites IContext method parameter
Product: [Eclipse Project] Platform Reporter: Julian Schneider <Julian.Schneider>
Component: User AssistanceAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: jcompagner, Lars.Vogel, loskutov
Version: 4.15Keywords: regression
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=533828
Whiteboard:
Attachments:
Description Flags
Codesnipped of DefaultHelpUI none

Description Julian Schneider CLA 2021-04-13 08:27:12 EDT
Created attachment 286090 [details]
Codesnipped of DefaultHelpUI

The DefaultUI class simply overwrites the passed IContext in org.eclipse.help.ui.internal.DefaultHelpUI.displayContext(IContext, int, int, boolean) line 333.

This behaviour is a major change of the simple function of "simply displaying" the passed context. 

This change was introduced by Bug ID 533828 and it does not seem to be right. Even though the way to get the desired context using the IContextProvider.getContext(Object target) may be correct it is not the task of this method to retrieve it and overwrite the original passed IContext.
This change made it impossible to display custom build help contexts when there is a context provider present for the active part. 

Further, the help context is only overwritten when displayed within the workbench. When the user sets the IHelpBaseConstants.P_KEY_WINDOW_INFOPOP in the preference store the original passed context is displayed in an extra window (Line 325). This seems to be inconsitent to overwrite the context in one case an d display the original context in another.
Comment 1 Andrey Loskutov CLA 2021-04-13 08:47:46 EDT
Also note bug 533828 comment 15, bug 533828 comment 22.
Later one is probably exactly this issue, example code attached.

@Johan: could you please check this?