diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/CheckUtils.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/CheckUtils.java index 845f7976e..454234a5d 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/CheckUtils.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/CheckUtils.java @@ -224,18 +224,6 @@ public final class CheckUtils { return result; } - /** - * Returns the value represented by the specified string of the specified - * type. Returns 0 for types other than float, double, int, and long. - * @param text the string to be parsed. - * @param type the token type of the text. Should be a constant of - * {@link TokenTypes}. - * @return the float value represented by the string argument. - */ - public static double parseFloat(String text, int type) { - return (float) parseDouble(text, type); - } - /** * Finds sub-node for given node minimal (line, column) pair. * @param node the root of tree for search. diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java index 6442fbfa7..78315b596 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java @@ -173,7 +173,7 @@ public class ExplicitInitializationCheck extends Check { case TokenTypes.NUM_INT: case TokenTypes.NUM_LONG: final String text = expr.getText(); - return CheckUtils.parseFloat(text, type) == 0.0; + return CheckUtils.parseDouble(text, type) == 0.0; default: return false; }