diff --git a/config/checkstyle_sevntu_checks.xml b/config/checkstyle_sevntu_checks.xml
index 5d40780d8..f56a0a96d 100644
--- a/config/checkstyle_sevntu_checks.xml
+++ b/config/checkstyle_sevntu_checks.xml
@@ -28,7 +28,9 @@
-
+
+
+
@@ -89,7 +91,7 @@
-
+
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java
index 5224acc5b..61f7eb64a 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java
@@ -19,8 +19,9 @@
package com.puppycrawl.tools.checkstyle.checks.indentation;
+import java.util.ArrayDeque;
+import java.util.Deque;
import java.util.Locale;
-import java.util.Stack;
import org.apache.commons.lang3.ArrayUtils;
@@ -497,11 +498,11 @@ public class CommentsIndentationCheck extends Check {
*/
private static DetailAST getOneLinePreviousStatementOfSingleLineComment(DetailAST comment) {
DetailAST previousStatement = null;
- final Stack stack = new Stack<>();
+ final Deque stack = new ArrayDeque<>();
DetailAST root = comment.getParent();
- while (root != null || !stack.empty()) {
- if (!stack.empty()) {
+ while (root != null || !stack.isEmpty()) {
+ if (!stack.isEmpty()) {
root = stack.pop();
}
while (root != null) {