diff --git a/src/main/java/org/checkstyle/autofix/parser/CheckstyleReportParser.java b/src/main/java/org/checkstyle/autofix/parser/CheckstyleReportParser.java index a72e9fe..57dacdc 100644 --- a/src/main/java/org/checkstyle/autofix/parser/CheckstyleReportParser.java +++ b/src/main/java/org/checkstyle/autofix/parser/CheckstyleReportParser.java @@ -112,8 +112,8 @@ private static String parseFileTag(StartElement startElement) { } private static CheckstyleViolation parseErrorTag(StartElement startElement, String filename) { - Integer line = null; - Integer column = null; + int line = -1; + int column = -1; String source = null; String message = null; String severity = null; @@ -124,7 +124,7 @@ private static CheckstyleViolation parseErrorTag(StartElement startElement, Stri final String attrName = attribute.getName().getLocalPart(); switch (attrName) { case LINE_ATTR: - line = Integer.valueOf(attribute.getValue()); + line = Integer.parseInt(attribute.getValue()); break; case COLUMN_ATTR: column = Integer.parseInt(attribute.getValue()); diff --git a/src/main/java/org/checkstyle/autofix/parser/CheckstyleViolation.java b/src/main/java/org/checkstyle/autofix/parser/CheckstyleViolation.java index ac27b5f..4fd54bd 100644 --- a/src/main/java/org/checkstyle/autofix/parser/CheckstyleViolation.java +++ b/src/main/java/org/checkstyle/autofix/parser/CheckstyleViolation.java @@ -19,9 +19,9 @@ public final class CheckstyleViolation { - private final Integer line; + private final int line; - private final Integer column; + private final int column; private final String severity; @@ -31,7 +31,7 @@ public final class CheckstyleViolation { private final String fileName; - public CheckstyleViolation(Integer line, Integer column, + public CheckstyleViolation(int line, int column, String severity, String source, String message, String fileName) { this.line = line; this.column = column;