Source:
<code>public void load() { lock.lock(); try { File queueFile = getQueueFile(); if (queueFile.exists()) { BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(queueFile))); try { String line; while ((line = in.readLine()) != null) { AbstractProject j = Jenkins.getInstance().getItemByFullName(line, AbstractProject.class); if (j != null) j.scheduleBuild(); } } finally { in.close(); } queueFile.delete(); } else { queueFile = getXMLQueueFile(); if (queueFile.exists()) { Object unmarshaledObj = new XmlFile(XSTREAM, queueFile).read(); List items; if (unmarshaledObj instanceof State) { State state = (State) unmarshaledObj; items = state.items; WaitingItem.COUNTER.set(state.counter); } else { items = (List) unmarshaledObj; long maxId = 0; for (Object o : items) { if (o instanceof Item) { maxId = Math.max(maxId, ((Item)o).id); } } WaitingItem.COUNTER.set(maxId); } for (Object o : items) { if (o instanceof Task) { schedule((Task)o, 0); } else if (o instanceof Item) { Item item = (Item)o; if (item.task == null) { continue; } if (item instanceof WaitingItem) { item.enter(this); } else if (item instanceof BlockedItem) { item.enter(this); } else if (item instanceof BuildableItem) { item.enter(this); } else { throw new IllegalStateException("Unknown item type! " + item); } } } File bk = new File(queueFile.getPath() + ".bak"); bk.delete(); queueFile.renameTo(bk); queueFile.delete(); } } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load the queue file " + getXMLQueueFile(), e); } finally { <START> updateSnapshot(); <END> lock.unlock(); } }</code><technical_language>this end of main part of try block, in finally block? if throws a RuntimeException</technical_language>

Target:
public void load() { lock.lock(); try { try { File queueFile = getQueueFile(); if (queueFile.exists()) { BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(queueFile))); try { String line; while ((line = in.readLine()) != null) { AbstractProject j = Jenkins.getInstance().getItemByFullName(line, AbstractProject.class); if (j != null) j.scheduleBuild(); } } finally { in.close(); } queueFile.delete(); } else { queueFile = getXMLQueueFile(); if (queueFile.exists()) { Object unmarshaledObj = new XmlFile(XSTREAM, queueFile).read(); List items; if (unmarshaledObj instanceof State) { State state = (State) unmarshaledObj; items = state.items; WaitingItem.COUNTER.set(state.counter); } else { items = (List) unmarshaledObj; long maxId = 0; for (Object o : items) { if (o instanceof Item) { maxId = Math.max(maxId, ((Item)o).id); } } WaitingItem.COUNTER.set(maxId); } for (Object o : items) { if (o instanceof Task) { schedule((Task)o, 0); } else if (o instanceof Item) { Item item = (Item)o; if (item.task == null) { continue; } if (item instanceof WaitingItem) { item.enter(this); } else if (item instanceof BlockedItem) { item.enter(this); } else if (item instanceof BuildableItem) { item.enter(this); } else { throw new IllegalStateException("Unknown item type! " + item); } } } File bk = new File(queueFile.getPath() + ".bak"); bk.delete(); queueFile.renameTo(bk); queueFile.delete(); } } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load the queue file " + getXMLQueueFile(), e); } finally { updateSnapshot(); } } finally { lock.unlock(); } }