Project: Eclipse_Platform_UI
Bug 139324 [Contributions] plugin XML giving parameters to IExecutableExtension causes spurious runtime warning
Reported: 2006-04-28 18:39:10 | Status: verified fixed

Starting with Eclipse 3.2M5: Say there is a plugin.xml file, containing the following inside an actionSet (all proprietary information generalized of course): <action label="%Title" menubarPath="CustomMenu/SubMenu/Group" id="com.parasoft.MenuID15"> <class class="com.parasoft.GenericParameterizedAction"> <parameter name="parameter1" value="parameter1Value"/> </class> </action> This works, supplying the parameter as data to the IExecutableExtension.setInitializationData() method, where the instance of the generalized action can do whatever it wants with it. This is documented in several places: the JavaDoc for LaunchURL, the JavaDoc for IExecutableExtension, and Bugzilla Bugs 36968 and 79184. However, in Eclipse 3.2M5 and higher, the following warning error messages are printed to the console when Eclipse is launched with such a plugin (containing a parameter in the plugin.xml) is installed. !ENTRY org.eclipse.ui 2 0 2006-04-28 14:05:33.796 !MESSAGE Warnings while parsing the action sets from the 'org.eclipse.ui.actionSets' extension point !SUBENTRY 1 org.eclipse.ui 2 0 2006-04-28 14:05:33.796 !MESSAGE There was no class provided, and the action is not retargettable: plug-in='com.parasoft.testplugin', id='com.parasoft.MenuID15' After the error message is displayed, the parameterized actions do, in fact, work properly, with the implementing class being instantiated and receiving its parameter data passed through the IExecutableExtension.setInitializationData() function after instantiation. So it appears that the error message is simply superfluous. Whatever code is generating the message should be modified to take into account the possibility of the "class" attribute for a (non-retargettable) action being found in a sub-element rather than an attribute--as the IExecutableExtension interface documents and requires (assuming the colon-delimited method of specifying a single unnamed string parameter is not used). --David

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/GenericCommandActionDelegate.java