Beispiel #1
0
        private void callMethod(Node upNode, ParameterValues paramVals, ReferenceBTValue ret, bool isVirtCall)
        {
            bool flag;
            if (isVirtCall)
            {
                ReferenceBTValue thisObj = paramVals[0].Val as ReferenceBTValue;
                flag = thisObj.BTType == BTType.Dynamic;

                for (int i = 0; (! flag) && i < thisObj.Types.Length; i++)
                    if (paramVals.Method.DeclaringType.IsAssignableFrom(thisObj.Types[i]) && thisObj.Types[i] != PrimitiveBTValue.PrimitiveType())
                    {

                        ParameterValues exactParamVals = paramVals.Clone();
                        exactParamVals.ChooseVirtualMethod(thisObj.Types[i]);
                        flag = ! this.holder.SourceHolder.ContainsMethodBody(exactParamVals.Method);
                    }
            }
            else
                flag = ! this.holder.SourceHolder.ContainsMethodBody(paramVals.Method);

            if (flag)
                Annotation.SetNodeBTType(upNode, this.checkAnnotatedMethodForInvoke(new AnnotatedMethod(paramVals, ret)));
            else
            {
                if (isVirtCall)
                {
                    foreach (Type type in (paramVals[0].Val as ReferenceBTValue).Types)
                        if (paramVals.Method.DeclaringType.IsAssignableFrom(type) && type != PrimitiveBTValue.PrimitiveType())
                        {
                            ParameterValues exactParamVals = paramVals.Clone();
                            exactParamVals.ChooseVirtualMethod(type);
                            AnnotatedMethod method = new AnnotatedMethod(exactParamVals, ret);
                            Annotation.SetAnnotatedMethod(upNode, type, this.checkAnnotatedMethodForCall(method));
                        }
                }
                else
                    Annotation.SetAnnotatedMethod(upNode, this.checkAnnotatedMethodForCall(new AnnotatedMethod(paramVals, ret)));
                Annotation.SetNodeBTType(upNode, BTType.eXclusive);
            }
        }