コード例 #1
0
ファイル: ExceptionFlow.cs プロジェクト: guipadua/NTratch
        public ExceptionFlow(ExceptionFlow exceptionFlow)
        {
            if (exceptionFlow.getThrownType() != null)
            {
                setThrownType(exceptionFlow.getThrownType());
            }
            setThrownTypeName(exceptionFlow.getThrownTypeName());
            setOriginalMethodBindingKey(exceptionFlow.getOriginalMethodBindingKey());
            setLevelFound(exceptionFlow.getLevelFound());

            setIsDocSemantic(exceptionFlow.getIsDocSemantic());
            setIsDocSyntax(exceptionFlow.getIsDocSyntax());
            setIsThrow(exceptionFlow.getIsThrow());
        }
コード例 #2
0
        public HashSet <ExceptionFlow> getExceptionFlowSetByType()
        {
            HashSet <ExceptionFlow>            combinedExceptionsSet  = new HashSet <ExceptionFlow>();
            Dictionary <string, ExceptionFlow> combinedExceptionsTemp = new Dictionary <string, ExceptionFlow>();

            foreach (ExceptionFlow exception in ExceptionFlowSet)
            {
                if (!combinedExceptionsTemp.ContainsKey(exception.getThrownTypeName()))
                {
                    combinedExceptionsTemp.Add(exception.getThrownTypeName(), exception);
                }
                else
                {
                    ExceptionFlow combinedException = combinedExceptionsTemp[exception.getThrownTypeName()];

                    //take original method info from the one that is identified as throw
                    if (exception.getIsThrow())
                    {
                        combinedException.setOriginalMethodBindingKey(exception.getOriginalMethodBindingKey());
                    }

                    //bool flags - do an OR to be true if any is true
                    combinedException.setIsDocSemantic(combinedException.getIsDocSemantic() || exception.getIsDocSemantic());
                    combinedException.setIsDocSyntax(combinedException.getIsDocSyntax() || exception.getIsDocSyntax());
                    combinedException.setIsThrow(combinedException.getIsThrow() || exception.getIsThrow());

                    //take deepest level found
                    if (exception.getLevelFound() > combinedException.getLevelFound())
                    {
                        combinedException.setLevelFound(exception.getLevelFound());
                    }

                    //take type that is not null
                    if (combinedException.getThrownType() == null && exception.getThrownType() != null)
                    {
                        combinedException.setThrownType(exception.getThrownType());
                    }
                }
            }

            combinedExceptionsSet.UnionWith(combinedExceptionsTemp.Values);

            return(combinedExceptionsSet);
        }
コード例 #3
0
 public ClosedExceptionFlow(ExceptionFlow exception) :
     base(exception)
 {
 }