diff --git a/import-control.xml b/import-control.xml
index 3810375a0..6fa9f25ad 100755
--- a/import-control.xml
+++ b/import-control.xml
@@ -38,7 +38,6 @@
-
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
index fd523a833..659dd4a1d 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
@@ -396,7 +396,7 @@ public class Checker extends AutomaticBean
// already contains one
sb.append(File.separatorChar);
}
- sb.append(s.get(i));
+ sb.append(s.peek(i));
}
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java
index b7880f219..74179276a 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/FastStack.java
@@ -87,12 +87,13 @@ public class FastStack implements Iterable
}
/**
- * Return the element at the specified index.
+ * Return the element at the specified index. It does not remove the
+ * element from the stack.
* @param aIndex the index to return
* @return the element at the index
* @throws IllegalArgumentException if index out of range
*/
- public E get(int aIndex)
+ public E peek(int aIndex)
{
if ((aIndex < 0) || (aIndex >= mEntries.size())) {
throw new IllegalArgumentException("index out of range.");
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java
index caa46cc4a..c6bb4013e 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java
@@ -185,7 +185,7 @@ public class FinalLocalVariableCheck extends Check
private void removeVariable(DetailAST aAST)
{
for (int i = mScopeStack.size() - 1; i >= 0; i--) {
- final Map state = mScopeStack.get(i);
+ final Map state = mScopeStack.peek(i);
final Object obj = state.remove(aAST.getText());
if (obj != null) {
break;
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java
index bf73d1d0e..88e4212a2 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java
@@ -20,9 +20,9 @@ package com.puppycrawl.tools.checkstyle.checks.indentation;
import com.puppycrawl.tools.checkstyle.api.Check;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
+import com.puppycrawl.tools.checkstyle.api.FastStack;
import com.puppycrawl.tools.checkstyle.api.ScopeUtils;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
-import org.apache.commons.collections.ArrayStack;
// TODO: allow preset indentation styles (IE... GNU style, Sun style, etc...)?
@@ -122,7 +122,8 @@ public class IndentationCheck extends Check
private int mBraceAdjustment;
/** handlers currently in use */
- private final ArrayStack mHandlers = new ArrayStack();
+ private final FastStack mHandlers =
+ FastStack.newInstance();
/** factory from which handlers are distributed */
private final HandlerFactory mHandlerFactory = new HandlerFactory();
@@ -241,7 +242,7 @@ public class IndentationCheck extends Check
}
final ExpressionHandler handler = mHandlerFactory.getHandler(this, aAST,
- (ExpressionHandler) mHandlers.peek());
+ mHandlers.peek());
mHandlers.push(handler);
try {
handler.checkIndentation();
diff --git a/src/tests/com/puppycrawl/tools/checkstyle/api/FastStackTest.java b/src/tests/com/puppycrawl/tools/checkstyle/api/FastStackTest.java
index bd791790c..a3e44039b 100644
--- a/src/tests/com/puppycrawl/tools/checkstyle/api/FastStackTest.java
+++ b/src/tests/com/puppycrawl/tools/checkstyle/api/FastStackTest.java
@@ -35,7 +35,7 @@ public class FastStackTest
}
assertEquals(num, fs.size());
assertFalse(fs.isEmpty());
- assertEquals(1, fs.get(1).intValue());
+ assertEquals(1, fs.peek(1).intValue());
assertEquals(num - 1, fs.peek().intValue());
assertEquals(num, fs.size());
for (int i = 0; i < num; i++)