diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index f79436c6..04e8cff9 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -107,7 +107,7 @@ public class CSVFormat implements Serializable { final Quote quotePolicy, final Character commentStart, final Character escape, final boolean ignoreSurroundingSpaces, final boolean ignoreEmptyLines, final String recordSeparator, - String nullToString, final String[] header) { + final String nullToString, final String[] header) { if (isLineBreak(delimiter)) { throw new IllegalArgumentException("The delimiter cannot be a line break"); } @@ -599,7 +599,7 @@ public class CSVFormat implements Serializable { final Quote quotePolicy, final Character commentStart, final Character escape, final boolean ignoreSurroundingSpaces, final boolean ignoreEmptyLines, final String recordSeparator, - String nullToString, final String[] header) { + final String nullToString, final String[] header) { if (isLineBreak(delimiter)) { throw new IllegalArgumentException("The delimiter cannot be a line break"); } diff --git a/src/main/java/org/apache/commons/csv/CSVRecord.java b/src/main/java/org/apache/commons/csv/CSVRecord.java index fd633c2c..99c805f8 100644 --- a/src/main/java/org/apache/commons/csv/CSVRecord.java +++ b/src/main/java/org/apache/commons/csv/CSVRecord.java @@ -84,7 +84,7 @@ public class CSVRecord implements Serializable, Iterable { final Integer index = mapping.get(name); try { return index != null ? values[index.intValue()] : null; - } catch (ArrayIndexOutOfBoundsException e) { + } catch (final ArrayIndexOutOfBoundsException e) { throw new IllegalArgumentException( String.format( "Index for header '%s' is %d but CSVRecord only has %d values!", diff --git a/src/test/java/org/apache/commons/csv/CSVRecordTest.java b/src/test/java/org/apache/commons/csv/CSVRecordTest.java index bcb33db5..0cd1e6ce 100644 --- a/src/test/java/org/apache/commons/csv/CSVRecordTest.java +++ b/src/test/java/org/apache/commons/csv/CSVRecordTest.java @@ -95,8 +95,8 @@ public class CSVRecordTest { @Test public void testIterator() { int i = 0; - for (Iterator itr = record.iterator(); itr.hasNext();) { - String value = itr.next(); + for (final Iterator itr = record.iterator(); itr.hasNext();) { + final String value = itr.next(); assertEquals(values[i], value); i++; } diff --git a/src/test/java/org/apache/commons/csv/TokenMatchers.java b/src/test/java/org/apache/commons/csv/TokenMatchers.java index d801943d..e6a8e479 100644 --- a/src/test/java/org/apache/commons/csv/TokenMatchers.java +++ b/src/test/java/org/apache/commons/csv/TokenMatchers.java @@ -29,14 +29,14 @@ final class TokenMatchers { public static Matcher hasType(final Token.Type expectedType) { return new TypeSafeDiagnosingMatcher() { - public void describeTo(Description description) { + public void describeTo(final Description description) { description.appendText("token has type "); description.appendValue(expectedType); } @Override - protected boolean matchesSafely(Token item, - Description mismatchDescription) { + protected boolean matchesSafely(final Token item, + final Description mismatchDescription) { mismatchDescription.appendText("token type is "); mismatchDescription.appendValue(item.type); if (item.type == expectedType) { @@ -50,14 +50,14 @@ final class TokenMatchers { public static Matcher hasContent(final String expectedContent) { return new TypeSafeDiagnosingMatcher() { - public void describeTo(Description description) { + public void describeTo(final Description description) { description.appendText("token has content "); description.appendValue(expectedContent); } @Override - protected boolean matchesSafely(Token item, - Description mismatchDescription) { + protected boolean matchesSafely(final Token item, + final Description mismatchDescription) { mismatchDescription.appendText("token content is "); mismatchDescription.appendValue(item.content.toString()); if (expectedContent.equals(item.content.toString())) { @@ -71,13 +71,13 @@ final class TokenMatchers { public static Matcher isReady() { return new TypeSafeDiagnosingMatcher() { - public void describeTo(Description description) { + public void describeTo(final Description description) { description.appendText("token is ready "); } @Override - protected boolean matchesSafely(Token item, - Description mismatchDescription) { + protected boolean matchesSafely(final Token item, + final Description mismatchDescription) { mismatchDescription.appendText("token is not ready "); return item.isReady; }