Skip to content

Commit 51ba40b

Browse files
Anmol202005rdiachenko
authored andcommitted
Issue #43: updated CheckstyleViolation to change line and column to Primitive
1 parent 5660708 commit 51ba40b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/org/checkstyle/autofix/parser/CheckstyleReportParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ private static String parseFileTag(StartElement startElement) {
112112
}
113113

114114
private static CheckstyleViolation parseErrorTag(StartElement startElement, String filename) {
115-
Integer line = null;
116-
Integer column = null;
115+
int line = -1;
116+
int column = -1;
117117
String source = null;
118118
String message = null;
119119
String severity = null;
@@ -124,7 +124,7 @@ private static CheckstyleViolation parseErrorTag(StartElement startElement, Stri
124124
final String attrName = attribute.getName().getLocalPart();
125125
switch (attrName) {
126126
case LINE_ATTR:
127-
line = Integer.valueOf(attribute.getValue());
127+
line = Integer.parseInt(attribute.getValue());
128128
break;
129129
case COLUMN_ATTR:
130130
column = Integer.parseInt(attribute.getValue());

src/main/java/org/checkstyle/autofix/parser/CheckstyleViolation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
public final class CheckstyleViolation {
2121

22-
private final Integer line;
22+
private final int line;
2323

24-
private final Integer column;
24+
private final int column;
2525

2626
private final String severity;
2727

@@ -31,7 +31,7 @@ public final class CheckstyleViolation {
3131

3232
private final String fileName;
3333

34-
public CheckstyleViolation(Integer line, Integer column,
34+
public CheckstyleViolation(int line, int column,
3535
String severity, String source, String message, String fileName) {
3636
this.line = line;
3737
this.column = column;

0 commit comments

Comments
 (0)