Community
Participate
Working Groups
Created attachment 190077 [details] proposed fix Version: 3.7.0 Build id: I20110224-1726 (has always been this way) In various places in org.eclipse.debug.ui we create IEvaluationContexts to compute the enablemment of, among other things, launch shortcuts. When we create these contexts we always pass in null as the parent context and set a single variable (usually the selection). We should be passing in the context from the platform's IEvaluationService as the parent to these new contexts so that all known platform variables can be supported for enablements as well. A good example is in the launch shortcut case. Currently if you try to use the org.eclipse.core.runtime.Platform variable to determine bundle state (using the org.eclipse.core.runtime.bundleState property) in your launch shortcut enablement, you will get an exception that the variable is unknown.
Make sense. I'm curious what use case has prompted this bug though?
(In reply to comment #1) > Make sense. I'm curious what use case has prompted this bug though? Trying to fix the following: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337043 I wanted to not show the launch and not have it considered for context launching unless the Rhino bundle was loaded.
Paul, can you confirm that this is the right thing to do?
This is an OK pattern. Also used in the CNF: org.eclipse.ui.internal.navigator.NavigatorPlugin.getEvalContext(Object) org.eclipse.ui.internal.navigator.NavigatorPlugin.getEmptyEvalContext() Comment: If you are allowing the more general core expressions, you should consider whether you should set context.setAllowPluginActivation(true). I'll also point out in the launch config you will be in the dialog scope, and some standard variables might not be available. PW
applied patch to HEAD
Is there a test case or steps that allow us to verify the fix?
(In reply to comment #6) > Is there a test case or steps that allow us to verify the fix? You can apply the patch from bug 337043 to verify the launch shortcut does not appear unless the bundle is loaded - testing that parent variables are being set. You can also run the LaunchConfigurationManagerTests tests in jdt.debug.tests to test that the old behavior is properly maintained.
Already reviewed.