Bug 318355 - Holder parameter in the isEnumValueAppropriate is incorrect for given Option parameter
Summary: Holder parameter in the isEnumValueAppropriate is incorrect for given Option ...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-29 12:51 EDT by Jim Adams CLA
Modified: 2020-09-04 15:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Adams CLA 2010-06-29 12:51:36 EDT
Build Identifier: I20100429-1549

When creating a custom value handler (IManagedOptionValueHandler) for a enumerated option, the value of the IHoldsOption holder is not correct for the IOption parameter that is passed to the isEnumValueAppropriate method.  

In the situation where this arises, the holder and option are created in a base tool that is inherited in the definition of another tool.  The IHoldsOption object that is passed to the isEnumValueAppropriate method is that of the base class and not the inherited class the IOption object is from.  

This happens when the control for the option is created and the value of the options is initially updated.  It does not happen when the value of the enumerated option is changed.

Reproducible: Always

Steps to Reproduce:
1.  Create a base tool, in this case it is a compiler tool for a custom compiler
2.  Create an enumerated option with enumerated values
3.  Create a value handler class that implements IManagedOptionValueHandler 
4.  Assign the valueHandler attribute of the enumerated option the value of the custom class.
5.  Create a new tool that inherits from the base class, i.e. the superClass attribute of the new class is the id of the base class.  (In this situation, the new tool is in a separate plugin definition.)
6.  Create a toolchain using the new tool.
7.  set a breakpoint in the isEnumValueAppropriate method and debug the plugin to see that the base class tool is passed to the method instead of the new tool.
Comment 1 Jim Adams CLA 2010-06-29 12:52:17 EDT
The build id for the CDT components is 201005031211.