diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Utils.java b/src/main/java/com/puppycrawl/tools/checkstyle/Utils.java index 159157fcf..4f93301bf 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/Utils.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/Utils.java @@ -79,7 +79,7 @@ public final class Utils { final Integer[] ids = TOKEN_NAME_TO_VALUE.values().toArray(new Integer[0]); TOKEN_IDS = new int[ids.length]; for (int i = 0; i < ids.length; i++) { - TOKEN_IDS[i] = ids[i].intValue(); + TOKEN_IDS[i] = ids[i]; } } @@ -307,7 +307,7 @@ public final class Utils { if (id == null) { throw new IllegalArgumentException("given name " + name); } - return id.intValue(); + return id; } /** diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java index 94269bbcf..8c764f8e9 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java @@ -148,7 +148,7 @@ public class TrailingCommentCheck extends AbstractFormatCheck { lines.addAll(cComments.keySet()); for (Integer lineNo : lines) { - final String line = getLines()[lineNo.intValue() - 1]; + final String line = getLines()[lineNo - 1]; String lineBefore = ""; TextBlock comment = null; if (cppComments.containsKey(lineNo)) { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java index 851360188..6f3eb51d7 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java @@ -312,7 +312,7 @@ public abstract class AbstractExpressionHandler { // checked by a child expression) if (col != null) { - checkSingleLine(i, col.intValue(), theLevel, false); + checkSingleLine(i, col, theLevel, false); } } } @@ -479,7 +479,7 @@ public abstract class AbstractExpressionHandler { final Integer colNum = lines.getStartColumn(lineNum); final int thisLineColumn = expandedTabsColumnNo(tree); - if (colNum == null || thisLineColumn < colNum.intValue()) { + if (colNum == null || thisLineColumn < colNum) { lines.addLineAndCol(lineNum, thisLineColumn); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java index e56cde7e2..402f2b447 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java @@ -52,7 +52,7 @@ public class LineSet { */ public int firstLineCol() { final Object firstLineKey = lines.firstKey(); - return lines.get(firstLineKey).intValue(); + return lines.get(firstLineKey); } /** @@ -61,7 +61,7 @@ public class LineSet { * @return the line number of the first line */ public int firstLine() { - return lines.firstKey().intValue(); + return lines.firstKey(); } /** @@ -70,7 +70,7 @@ public class LineSet { * @return the line number of the last line */ public int lastLine() { - return lines.lastKey().intValue(); + return lines.lastKey(); } /** diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java index 19a815b40..b3f82d92d 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java @@ -370,7 +370,7 @@ public final class JavadocUtils { if (id == null) { throw new IllegalArgumentException("Unknown javdoc token name. Given name " + name); } - return id.intValue(); + return id; } /**