From 2e32ba7ab68e22bfc398362d4e3b85bb5ebfacac Mon Sep 17 00:00:00 2001 From: Michal Kordas Date: Fri, 7 Aug 2015 01:16:27 +0200 Subject: [PATCH] Fix suspicious method call. #1555 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes SuspiciousMethodCalls inspection violation. Description: >This inspection reports method calls to parameterized collections, where actual argument type does not correspond to the collection's elements type. For example if you have the following code: ```     List list = getListOfElements();     list.remove(""); ``` the call to `remove()` will be highlighted. --- .../puppycrawl/tools/checkstyle/checks/indentation/LineSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 402f2b447..e1e48d016 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 @@ -51,7 +51,7 @@ public class LineSet { * @return the starting column for the first line. */ public int firstLineCol() { - final Object firstLineKey = lines.firstKey(); + final Integer firstLineKey = lines.firstKey(); return lines.get(firstLineKey); }