{
boolean match = super.matches(definition);
if (!match)
return false;
IFunctionDefinition functionDefinition = (IFunctionDefinition)definition;
FunctionClassification classification = functionDefinition.getFunctionClassification();
if (classification != getFunctionClassification())
return false;
// Along with local and file member, name offsets needs to be compared for class/interface members also.
// This is required to differentiate members having same name belonging to different class/interface
// within the same AS file - See FBG-3494 for an example.
if (classification == FunctionClassification.LOCAL || classification == FunctionClassification.FILE_MEMBER
|| classification == FunctionClassification.CLASS_MEMBER || classification == FunctionClassification.INTERFACE_MEMBER)
{
if (functionDefinition.getNameStart() != getNameStart() ||
functionDefinition.getNameEnd() != functionDefinition.getNameEnd())
{
return false;
}
}
if (functionDefinition instanceof ISetterDefinition && !(this instanceof ISetterDefinition))
return false;
if (functionDefinition instanceof IGetterDefinition && !(this instanceof IGetterDefinition))
return false;
if (functionDefinition.isConstructor() && !isConstructor())
return false;
//TODO match params?
if (functionDefinition.getParameters().length != getParameters().length)
return false;
return true;
}