diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java index 192360300..0d01cef36 100755 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java @@ -48,7 +48,7 @@ public class FastStack implements Iterable */ public boolean isEmpty() { - return mEntries.size() == 0; + return mEntries.isEmpty(); } /** @@ -67,7 +67,7 @@ public class FastStack implements Iterable */ public E peek() { - if (mEntries.size() == 0) { + if (mEntries.isEmpty()) { throw new IllegalStateException("FastStack is empty"); } return mEntries.get(mEntries.size() - 1); @@ -80,7 +80,7 @@ public class FastStack implements Iterable */ public E pop() { - if (mEntries.size() == 0) { + if (mEntries.isEmpty()) { throw new IllegalStateException("FastStack is empty"); } return mEntries.remove(mEntries.size() - 1); @@ -120,7 +120,7 @@ public class FastStack implements Iterable } /** - * Returns an interator that goes from the oldest element to the newest. + * Returns an iterator that goes from the oldest element to the newest. * @return an iterator */ public Iterator iterator()