<?xml version="1.0" encoding="UTF-8"?>
<kdm:Segment xmi:version="2.1"

xmlns:xmi="http://www.omg.org/XMI"

xmlns:action="http://kdm.omg.org/action"

xmlns:code="http://kdm.omg.org/code"

xmlns:kdm="http://kdm.omg.org/kdm"

name="Exceptions Example">
 
<model xmi:id="id.0" xmi:type="code:CodeModel">
    <codeElement xmi:id="id.1" xmi:type="code:ClassUnit" name="A">
     
<codeElement xmi:id="id.2" xmi:type="code:MethodUnit" name="foo">
        <entryFlow xmi:id="id.3" to="id.4" from="id.2"/>
        <codeElement xmi:id="id.4" xmi:type="action:TryUnit" name="t1">
          <codeElement xmi:id="id.5" xmi:type="action:ActionElement" name="a1" kind="Call">
            <actionRelation xmi:id="id.6" xmi:type="action:Calls" to="id.23" from="id.5"/>
          </codeElement>
          <actionRelation xmi:id="id.7" xmi:type="action:Flow" to="id.5" from="id.4"/>
          <actionRelation xmi:id="id.8" xmi:type="action:ExceptionFlow" to="id.10" from="id.4"/>
          <actionRelation xmi:id="id.9" xmi:type="action:ExitFlow" to="id.17" from="id.4"/>
        </codeElement>
        <codeElement xmi:id="id.10" xmi:type="action:CatchUnit" name="c1">
          <codeElement xmi:id="id.11" xmi:type="code:ParameterUnit" name="e" type="id.67"/>
          <codeElement xmi:id="id.12" xmi:type="action:ActionElement" name="a2" kind="Call">
            <codeElement xmi:id="id.13" xmi:type="code:Value" name="&quot;Something went wrong&quot;" type="id.69"/>
            <actionRelation xmi:id="id.14" xmi:type="action:Reads" to="id.13" from="id.12"/>
            <actionRelation xmi:id="id.15" xmi:type="action:Calls" to="id.66" from="id.12"/>
          </codeElement>
          <actionRelation xmi:id="id.16" xmi:type="action:Flow" to="id.12" from="id.10"/>
        </codeElement>
        <codeElement xmi:id="id.17" xmi:type="action:FinallyUnit" name="f1">
          <codeElement xmi:id="id.18" xmi:type="action:ActionElement" name="a3" kind="Call">
            <codeElement xmi:id="id.19" xmi:type="code:Value" name="&quot;Good bye&quot;" type="id.69"/>
            <actionRelation xmi:id="id.20" xmi:type="action:Reads" to="id.19" from="id.18"/>
            <actionRelation xmi:id="id.21" xmi:type="action:Calls" to="id.66" from="id.18"/>
          </codeElement>
          <actionRelation xmi:id="id.22" xmi:type="action:Flow" to="id.18" from="id.17"/>
        </codeElement>
      </codeElement>
      <codeElement xmi:id="id.23" xmi:type="code:MethodUnit" name="bar">
        <entryFlow xmi:id="id.24" to="id.25" from="id.23"/>
        <codeElement xmi:id="id.25" xmi:type="action:TryUnit" name="t2">
          <codeElement xmi:id="id.26" xmi:type="action:ActionElement" name="a4" kind="ArrayReplace">
            <source xmi:id="id.27" language="Java" snippet="arr[20]=20"/>
            <codeElement xmi:id="id.28" xmi:type="code:Value" name="20" type="id.70"/>
            <actionRelation xmi:id="id.29" xmi:type="action:Addresses" to="id.59" from="id.26"/>
            <actionRelation xmi:id="id.30" xmi:type="action:Reads" to="id.28" from="id.26"/>
            <actionRelation xmi:id="id.31" xmi:type="action:Reads" to="id.28" from="id.26"/>
            <actionRelation xmi:id="id.32" xmi:type="action:Writes" to="id.61" from="id.26"/>
            <actionRelation xmi:id="id.33" xmi:type="action:Flow" to="id.34" from="id.26"/>
          </codeElement>
          <codeElement xmi:id="id.34" xmi:type="action:ActionElement" name="a5" kind="Call">
            <actionRelation xmi:id="id.35" xmi:type="action:Reads" to="id.59" from="id.34"/>
            <actionRelation xmi:id="id.36" xmi:type="action:Calls" to="id.66" from="id.42"/>
          </codeElement>
          <actionRelation xmi:id="id.37" xmi:type="action:Flow" to="id.26" from="id.25"/>
          <actionRelation xmi:id="id.38" xmi:type="action:ExceptionFlow" to="id.40" from="id.25"/>
          <actionRelation xmi:id="id.39" xmi:type="action:ExitFlow"/>
        </codeElement>
        <codeElement xmi:id="id.40" xmi:type="action:CatchUnit" name="c2">
          <codeElement xmi:id="id.41" xmi:type="code:ParameterUnit" name="e" type="id.68"/>
          <codeElement xmi:id="id.42" xmi:type="action:ActionElement" name="a6" kind="Call">
            <codeElement xmi:id="id.43" xmi:type="code:Value" name="&quot;Oops&quot;" type="id.69"/>
            <actionRelation xmi:id="id.44" xmi:type="action:Reads" to="id.43" from="id.47"/>
            <actionRelation xmi:id="id.45" xmi:type="action:Calls" to="id.66" from="id.42"/>
            <actionRelation xmi:id="id.46" xmi:type="action:Flow" to="id.47" from="id.42"/>
          </codeElement>
          <codeElement xmi:id="id.47" xmi:type="action:ActionElement" name="a7" kind="Throw">
            <codeElement xmi:id="id.48" xmi:type="code:Value" name="&quot;Went too far&quot;" type="id.69"/>
            <actionRelation xmi:id="id.49" xmi:type="action:Reads" to="id.48" from="id.47"/>
            <actionRelation xmi:id="id.50" xmi:type="action:Throws"/>
          </codeElement>
          <actionRelation xmi:id="id.51" xmi:type="action:Flow" to="id.42" from="id.40"/>
        </codeElement>
        <codeElement xmi:id="id.52" xmi:type="action:FinallyUnit" name="f2">
          <codeElement xmi:id="id.53" xmi:type="action:ActionElement" name="a8" kind="Call">
            <actionRelation xmi:id="id.54" xmi:type="action:Reads" to="id.59" from="id.53"/>
            <actionRelation xmi:id="id.55" xmi:type="action:Calls" to="id.66" from="id.42"/>
          </codeElement>
          <actionRelation xmi:id="id.56" xmi:type="action:Flow" to="id.53" from="id.52"/>
       
</codeElement>
        <codeElement xmi:id="id.57" xmi:type="code:Signature">
         
<parameterUnit xmi:id="id.58" type="id.63" kind="throws"/>
        </codeElement>
      </codeElement>
      <codeElement xmi:id="id.59" xmi:type="code:MemberUnit" name="arr" type="id.60" size="10">
        <codeElement xmi:id="id.60" xmi:type="code:ArrayType">
          <itemUnit xmi:id="id.61" type="id.70"/>
          <indexUnit xmi:id="id.62" type="id.70"/>
        </codeElement>
      </codeElement>
    </codeElement>
    <codeElement xmi:id="id.63" xmi:type="code:ClassUnit" name="MoreDescriptiveException" isAbstract="true">
      <codeRelation xmi:id="id.64" xmi:type="code:Extends" to="id.67" from="id.63"/>
    </codeElement>
  </model>
  <model xmi:id="id.65" xmi:type="code:CodeModel" name="Java common definitions">
    <codeElement xmi:id="id.66" xmi:type="code:CallableUnit" name="println"/>
    <codeElement xmi:id="id.67" xmi:type="code:ClassUnit" name="Exception"/>
    <codeElement xmi:id="id.68" xmi:type="code:ClassUnit" name="ArrayIndexOutOfBoundsException" isAbstract="false"/>
    <codeElement xmi:id="id.69" xmi:type="code:StringType"/>
    <codeElement xmi:id="id.70" xmi:type="code:IntegerType"/>
 
</model>
</kdm:Segment>