Hi,
I have a button with some code behind it that edits the attributes of selected features when run. I am having an intermittent issue where sometimes the code runs and works properly, and other times it runs and only seems to partially complete. I don't get any error messages in either case, and in each case my code gets all the way to the end and displays a MessageBox with the results. But, when it doesn't work I can see that the attributes on the selected features have not been updated and the process is also not available to 'roll-back' via the undo button (ie. not on the undo-stack).
I have posted the code below, but was just wondering if anyone else has seen this issue. When I notice that the code hasn't worked, I just hit the button again (without changing anything related to my selection in the map) and then it all works fine. I just don't know why it won't work that first time.
Also, this is intermittent. Sometimes it works the first time, sometimes it doesn't. I cannot find any pattern.
<SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">async</SPAN> <SPAN class="keyword token">override</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">OnClick</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">int</SPAN> updatedFeatures <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">await</SPAN> QueuedTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Run</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//Start the edit operation, and place on the UNDO stack</SPAN>
<SPAN class="keyword token">var</SPAN> editOperation <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGIS<SPAN class="punctuation token">.</SPAN>Desktop<SPAN class="punctuation token">.</SPAN>Editing<SPAN class="punctuation token">.</SPAN>EditOperation</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
editOperation<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Update Fittings Diameters on Selected Features"</SPAN><SPAN class="punctuation token">;</SPAN>
editOperation<SPAN class="punctuation token">.</SPAN>EditOperationType <SPAN class="operator token">=</SPAN> ArcGIS<SPAN class="punctuation token">.</SPAN>Desktop<SPAN class="punctuation token">.</SPAN>Editing<SPAN class="punctuation token">.</SPAN>EditOperationType<SPAN class="punctuation token">.</SPAN>Long<SPAN class="punctuation token">;</SPAN>
Map map <SPAN class="operator token">=</SPAN> MapView<SPAN class="punctuation token">.</SPAN>Active<SPAN class="punctuation token">.</SPAN>Map<SPAN class="punctuation token">;</SPAN>
FeatureLayer waterMainLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WaterMain"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer waterServiceLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WaterService"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer hydrantLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WAT_Hydrant"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer controlValveLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WAT_ControlValve"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer waterFittingsLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WAT_Fitting"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer reliefValveLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WAT_ReliefValve"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureLayer pressureZoneLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">Where</SPAN><SPAN class="punctuation token">(</SPAN>l <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> l<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"GISWRKS1.WORKS.WAT_PressureZone"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token preprocessor">#region Check for Relief Valves</SPAN>
<SPAN class="comment token">//Check for the Relief valves layer to be in the map</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>reliefValveLayer <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//Check to see if there is a selection</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>reliefValveLayer<SPAN class="punctuation token">.</SPAN>SelectionCount <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//Get the OIDs of any selected Relief Valves</SPAN>
<SPAN class="keyword token">var</SPAN> reliefValvesSelection <SPAN class="operator token">=</SPAN> reliefValveLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetSelection</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IReadOnlyList<SPAN class="operator token"><</SPAN><SPAN class="keyword token">long</SPAN><SPAN class="operator token">></SPAN> selectedOIDs <SPAN class="operator token">=</SPAN> reliefValvesSelection<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetObjectIDs</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Create an Inspector to edit the selected features</SPAN>
<SPAN class="keyword token">var</SPAN> insp <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGIS<SPAN class="punctuation token">.</SPAN>Desktop<SPAN class="punctuation token">.</SPAN>Editing<SPAN class="punctuation token">.</SPAN>Attributes<SPAN class="punctuation token">.</SPAN>Inspector</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Loop through each selected OID</SPAN>
<SPAN class="keyword token">foreach</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> oid <SPAN class="keyword token">in</SPAN> selectedOIDs<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//Load the current Relief Valve into the inspector</SPAN>
insp<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Load</SPAN><SPAN class="punctuation token">(</SPAN>reliefValveLayer<SPAN class="punctuation token">,</SPAN> oid<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Get the coordinate of the current Relief Valve</SPAN>
MapPoint reliefValvePoint <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>MapPoint<SPAN class="punctuation token">)</SPAN>insp<SPAN class="punctuation token">.</SPAN>Shape<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Could be intersecting a WaterService or a WaterMain.</SPAN>
<SPAN class="comment token">//Do for WaterServices first:</SPAN>
SpatialQueryFilter wsFilter <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SpatialQueryFilter</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
wsFilter<SPAN class="punctuation token">.</SPAN>FilterGeometry <SPAN class="operator token">=</SPAN> reliefValvePoint<SPAN class="punctuation token">;</SPAN>
wsFilter<SPAN class="punctuation token">.</SPAN>SpatialRelationship <SPAN class="operator token">=</SPAN> SpatialRelationship<SPAN class="punctuation token">.</SPAN>Intersects<SPAN class="punctuation token">;</SPAN>
wsFilter<SPAN class="punctuation token">.</SPAN>SubFields <SPAN class="operator token">=</SPAN> <SPAN class="string token">"*"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Loop through each intersecting WaterService using a RowCursor.</SPAN>
RowCursor wsCursor <SPAN class="operator token">=</SPAN> waterServiceLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Search</SPAN><SPAN class="punctuation token">(</SPAN>wsFilter<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
Feature wsFeature<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Go to the first item in the cursor, and use it as a Feature</SPAN>
wsCursor<SPAN class="punctuation token">.</SPAN><SPAN class="token function">MoveNext</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
wsFeature <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>Feature<SPAN class="punctuation token">)</SPAN>wsCursor<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>wsFeature <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Diameter"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Diameter"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"WATERMAINID"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"FACILITYID"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Update these attributes on the Relief Valve from the WaterService, if required</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Properties<SPAN class="punctuation token">.</SPAN>Settings<SPAN class="punctuation token">.</SPAN>Default<SPAN class="punctuation token">.</SPAN>fitContractNumberSetting <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"CONTRACTNO"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"CONTRACTNO"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Properties<SPAN class="punctuation token">.</SPAN>Settings<SPAN class="punctuation token">.</SPAN>Default<SPAN class="punctuation token">.</SPAN>fitInstallDateSetting <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"INSTALLDATE"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"INSTALLDATE"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Properties<SPAN class="punctuation token">.</SPAN>Settings<SPAN class="punctuation token">.</SPAN>Default<SPAN class="punctuation token">.</SPAN>fitDataSourceSetting <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"DATASOURCE"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"DATASOURCE"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Properties<SPAN class="punctuation token">.</SPAN>Settings<SPAN class="punctuation token">.</SPAN>Default<SPAN class="punctuation token">.</SPAN>fitLifecycleSetting <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN>
insp<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"LifecycleStatus"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> wsFeature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"LifecycleStatus"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">//end of if wsFeature loop</SPAN>
<SPAN class="comment token">//Add code for WM here ****</SPAN>
editOperation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Modify</SPAN><SPAN class="punctuation token">(</SPAN>insp<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
updatedFeatures<SPAN class="operator token">++</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">//end of foreach Relief Valve loop</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">//end of if selected Relief Valve > 0 loop</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">//end of if Relief Valve layer != null loop</SPAN>
<SPAN class="token preprocessor">#endregion</SPAN>
editOperation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Execute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ArcGIS<SPAN class="punctuation token">.</SPAN>Desktop<SPAN class="punctuation token">.</SPAN>Framework<SPAN class="punctuation token">.</SPAN>Dialogs<SPAN class="punctuation token">.</SPAN>MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN>updatedFeatures<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">" features updated."</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Fittings Tool - Complete"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">catch</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">finally</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>