Commit b7dfbd95 authored by Martti Käärik's avatar Martti Käärik
Browse files

Check if resolveDataType() is not null before accessing.

parent d8fe4719
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@
  <eClassifiers xsi:type="ecore:EClass" name="DataElementUse" eSuperTypes="#//DataUse">
    <eOperations name="resolveBaseDataType" eType="#//DataType">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;                if (not self.dataElement.oclIsUndefined()) then&#xA;                    if (self.dataElement.oclIsKindOf(DataType)) then&#xA;                        self.dataElement.oclAsType(DataType)&#xA;                    else&#xA;                        if (self.dataElement.oclIsKindOf(DataInstance)) then&#xA;                            self.dataElement.oclAsType(DataInstance).dataType&#xA;                        else &#xA;                            if (self.dataElement.oclIsTypeOf(FormalParameter)) then&#xA;                                self.dataElement.oclAsType(FormalParameter).dataType&#xA;                            else &#xA;                                if (self.dataElement.oclIsTypeOf(Function)) then&#xA;                                    self.dataElement.oclAsType(Function).returnType&#xA;                                else&#xA;                                    null&#xA;                                endif&#xA;                            endif &#xA;                        endif&#xA;                    endif&#xA;                else &#xA;                    if (self.container().oclIsTypeOf(MemberAssignment)) then&#xA;                        self.container().oclAsType(MemberAssignment).member.dataType&#xA;                    else &#xA;                        if (self.container().oclIsTypeOf(ParameterBinding)) then&#xA;                        &#x9;self.container().oclAsType(ParameterBinding).resolveParameterType()&#xA;                        else&#xA;                            if (self.container().oclIsTypeOf(CollectionDataInstance)) then&#xA;                                self.container().oclAsType(CollectionDataInstance).dataType.oclAsType(CollectionDataType).itemType&#xA;                            else&#xA;                                if (self.container().oclIsTypeOf(DataElementUse)) then&#xA;                                    self.container().oclAsType(DataElementUse).resolveDataType().oclAsType(CollectionDataType).itemType&#xA;                                else&#xA;                                    if (self.container().oclIsTypeOf(DataInstanceUse)) then&#xA;                                        self.container().oclAsType(DataInstanceUse).resolveDataType().oclAsType(CollectionDataType).itemType&#xA;                                    else&#xA;                                        null&#xA;                                    endif&#xA;                                endif&#xA;                            endif&#xA;                        endif&#xA;                    endif&#xA;                endif&#xA;                "/>
        <details key="body" value="&#xA;                if (not self.dataElement.oclIsUndefined()) then&#xA;                    if (self.dataElement.oclIsKindOf(DataType)) then&#xA;                        self.dataElement.oclAsType(DataType)&#xA;                    else&#xA;                        if (self.dataElement.oclIsKindOf(DataInstance)) then&#xA;                            self.dataElement.oclAsType(DataInstance).dataType&#xA;                        else &#xA;                            if (self.dataElement.oclIsTypeOf(FormalParameter)) then&#xA;                                self.dataElement.oclAsType(FormalParameter).dataType&#xA;                            else &#xA;                                if (self.dataElement.oclIsTypeOf(Function)) then&#xA;                                    self.dataElement.oclAsType(Function).returnType&#xA;                                else&#xA;                                    null&#xA;                                endif&#xA;                            endif &#xA;                        endif&#xA;                    endif&#xA;                else &#xA;                    if (self.container().oclIsTypeOf(MemberAssignment)) then&#xA;                        self.container().oclAsType(MemberAssignment).member.dataType&#xA;                    else &#xA;                        if (self.container().oclIsTypeOf(ParameterBinding)) then&#xA;                        &#x9;self.container().oclAsType(ParameterBinding).resolveParameterType()&#xA;                        else&#xA;                            if (self.container().oclIsTypeOf(CollectionDataInstance)) then&#xA;                                self.container().oclAsType(CollectionDataInstance).dataType.oclAsType(CollectionDataType).itemType&#xA;                            else&#xA;                                if (self.container().oclIsTypeOf(DataElementUse)) then&#xA;                                &#x9;if (self.container().oclAsType(DataElementUse).resolveDataType()->isEmpty()) then&#xA;                                &#x9;&#x9;null&#xA;                                &#x9;else&#xA;                                    &#x9;self.container().oclAsType(DataElementUse).resolveDataType().oclAsType(CollectionDataType).itemType&#xA;                                &#x9;endif&#xA;                                else&#xA;                                    if (self.container().oclIsTypeOf(DataInstanceUse)) then&#xA;&#x9;                                &#x9;if (self.container().oclAsType(DataInstanceUse).resolveDataType()->isEmpty()) then&#xA;&#x9;                                &#x9;&#x9;null&#xA;&#x9;                                &#x9;else&#xA;                                        &#x9;self.container().oclAsType(DataInstanceUse).resolveDataType().oclAsType(CollectionDataType).itemType&#xA;&#x9;                                &#x9;endif&#xA;                                    else&#xA;                                        null&#xA;                                    endif&#xA;                                endif&#xA;                            endif&#xA;                        endif&#xA;                    endif&#xA;                endif&#xA;                "/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>