Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2015-07-23 21:57:54 +0000
committerBrian Vosburgh2015-07-23 21:57:54 +0000
commit99101b9613846763f8a64ff164c7b260e9bb0d04 (patch)
treec5ff6dbb02df8813b8fc441d84dd0c7a9358c47c
parent2a37889dc4259402b83d01b67146a8b72ea10256 (diff)
downloadwebtools.dali-99101b9613846763f8a64ff164c7b260e9bb0d04.tar.gz
webtools.dali-99101b9613846763f8a64ff164c7b260e9bb0d04.tar.xz
webtools.dali-99101b9613846763f8a64ff164c7b260e9bb0d04.zip
clean up ListQueue exceptions
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListQueue.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListQueue.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListQueue.java
index 6a69812051..c119164dd1 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListQueue.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/collection/ListQueue.java
@@ -50,19 +50,17 @@ public class ListQueue<E>
}
public E dequeue() {
- try {
- return this.list.remove(0);
- } catch (IndexOutOfBoundsException ex) {
+ if (this.list.size() == 0) {
throw new NoSuchElementException();
}
+ return this.list.remove(0);
}
public E peek() {
- try {
- return this.list.get(0);
- } catch (IndexOutOfBoundsException ex) {
+ if (this.list.size() == 0) {
throw new NoSuchElementException();
}
+ return this.list.get(0);
}
public boolean isEmpty() {

Back to the top