Added finally

deliverable_6
asdfasdf 6 years ago
parent 1b378485f2
commit 5e722ceba6

@ -61,10 +61,15 @@ public class Main {
public void delWatchStock(String target) { public void delWatchStock(String target) {
//XXX Concurrency not ready //XXX Concurrency not ready
// Should add runnable to executor // Should add runnable to executor
boolean success = true;
try { try {
mainList.delStock(target); mainList.delStock(target);
success = true;
} catch (StockNotExistsException e) { } catch (StockNotExistsException e) {
System.out.println("Stock: " + target + " doesn't exists"); System.out.println("Stock: " + target + " doesn't exists");
success = false;
} finally {
System.out.println(success ? "Deleted: " + target : "Failed to delete: " + target);
} }
} }

Loading…
Cancel
Save