Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2015-07-23 21:57:19 +0000
committerBrian Vosburgh2015-07-23 21:57:19 +0000
commit2a37889dc4259402b83d01b67146a8b72ea10256 (patch)
tree6da979fb70a321d6315e14df3f9134a3409e4c12
parente8eaf02ae3ce9c927ec907ad9d39a26942f5d9e8 (diff)
downloadwebtools.dali-2a37889dc4259402b83d01b67146a8b72ea10256.tar.gz
webtools.dali-2a37889dc4259402b83d01b67146a8b72ea10256.tar.xz
webtools.dali-2a37889dc4259402b83d01b67146a8b72ea10256.zip
clean up ListStack exceptions
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListStack.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListStack.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListStack.java
index eff4418a43..b9a08fd845 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListStack.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListStack.java
@@ -50,19 +50,19 @@ public class ListStack<E>
}
public E pop() {
- try {
- return this.list.remove(this.list.size() - 1);
- } catch (IndexOutOfBoundsException ex) {
+ int size = this.list.size();
+ if (size == 0) {
throw new EmptyStackException();
}
+ return this.list.remove(size - 1);
}
public E peek() {
- try {
- return this.list.get(this.list.size() - 1);
- } catch (IndexOutOfBoundsException ex) {
+ int size = this.list.size();
+ if (size == 0) {
throw new EmptyStackException();
}
+ return this.list.get(size - 1);
}
public boolean isEmpty() {

Back to the top