Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#800 closed defect (fixed)

SetBaseClass should consider different class type

Reported by: Christinebao Owned by: christinebao
Priority: major Milestone: 3.6.0
Component: FDO API Version: 3.6.0
Severity: 3 Keywords:
Cc: External ID: 1427180

Description

Currently in ClassDefinition.cpp function SetBaseClass is in this way:

void FdoClassDefinition::SetBaseClass(FdoClassDefinition* value)
{
    ...

    if (value)
    {
        // Base class must have same class type.
        if ( GetClassType() != value->GetClassType() ) 
             throw FdoSchemaException::Create(
                FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_141_BASETYPECONFLICT),
                (FdoString*) GetQualifiedName(),
                (FdoString*) value->GetQualifiedName()
             )
        );

    ...


It constraint that base class must be the same type of child class. It's true if the base class is already set to child class, but before setting base class, child type can be FdoClassType_Class and base class can be FdoClassType_FeatureClass. In this case the setBaseClass will never success.

The fix is not to check class type if child class is FdoClassType_Class. If child class is FdoClassType_Class, it could change to another type after setting base class, and get the same class type with base class.

Attachments (2)

Fix800.patch (607 bytes ) - added by Christinebao 12 years ago.
Fix800_2.patch (721 bytes ) - added by ChristineBao 12 years ago.

Download all attachments as: .zip

Change History (7)

by Christinebao, 12 years ago

Attachment: Fix800.patch added

comment:1 by Christinebao, 12 years ago

comment:2 by Christinebao, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r6321.

comment:3 by ChristineBao, 12 years ago

One more related defect is reported by Autodesk QA:
In another case, base class is FdoClassType_Class, and child class is FdoClassType_FeatureClass, it should still pass the assign.

by ChristineBao, 12 years ago

Attachment: Fix800_2.patch added

comment:4 by ChristineBao, 12 years ago

comment:5 by ChristineBao, 12 years ago

Fix800_2.patch is submitted in r6351.

Note: See TracTickets for help on using tickets.