Skip to content

Commit ab2e7eb

Browse files
committed
- Add final modifier to method parameters.
- Add final modifier to local variables. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1495203 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4aa1f4d commit ab2e7eb

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static class CSVFormatBuilder {
107107
final Quote quotePolicy, final Character commentStart,
108108
final Character escape, final boolean ignoreSurroundingSpaces,
109109
final boolean ignoreEmptyLines, final String recordSeparator,
110-
String nullToString, final String[] header) {
110+
final String nullToString, final String[] header) {
111111
if (isLineBreak(delimiter)) {
112112
throw new IllegalArgumentException("The delimiter cannot be a line break");
113113
}
@@ -599,7 +599,7 @@ public static CSVFormatBuilder newBuilder(final CSVFormat format) {
599599
final Quote quotePolicy, final Character commentStart,
600600
final Character escape, final boolean ignoreSurroundingSpaces,
601601
final boolean ignoreEmptyLines, final String recordSeparator,
602-
String nullToString, final String[] header) {
602+
final String nullToString, final String[] header) {
603603
if (isLineBreak(delimiter)) {
604604
throw new IllegalArgumentException("The delimiter cannot be a line break");
605605
}

src/main/java/org/apache/commons/csv/CSVRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public String get(final String name) {
8484
final Integer index = mapping.get(name);
8585
try {
8686
return index != null ? values[index.intValue()] : null;
87-
} catch (ArrayIndexOutOfBoundsException e) {
87+
} catch (final ArrayIndexOutOfBoundsException e) {
8888
throw new IllegalArgumentException(
8989
String.format(
9090
"Index for header '%s' is %d but CSVRecord only has %d values!",

src/test/java/org/apache/commons/csv/CSVRecordTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public void testIsSet() {
9595
@Test
9696
public void testIterator() {
9797
int i = 0;
98-
for (Iterator<String> itr = record.iterator(); itr.hasNext();) {
99-
String value = itr.next();
98+
for (final Iterator<String> itr = record.iterator(); itr.hasNext();) {
99+
final String value = itr.next();
100100
assertEquals(values[i], value);
101101
i++;
102102
}

src/test/java/org/apache/commons/csv/TokenMatchers.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ final class TokenMatchers {
2929
public static Matcher<Token> hasType(final Token.Type expectedType) {
3030
return new TypeSafeDiagnosingMatcher<Token>() {
3131

32-
public void describeTo(Description description) {
32+
public void describeTo(final Description description) {
3333
description.appendText("token has type ");
3434
description.appendValue(expectedType);
3535
}
3636

3737
@Override
38-
protected boolean matchesSafely(Token item,
39-
Description mismatchDescription) {
38+
protected boolean matchesSafely(final Token item,
39+
final Description mismatchDescription) {
4040
mismatchDescription.appendText("token type is ");
4141
mismatchDescription.appendValue(item.type);
4242
if (item.type == expectedType) {
@@ -50,14 +50,14 @@ protected boolean matchesSafely(Token item,
5050
public static Matcher<Token> hasContent(final String expectedContent) {
5151
return new TypeSafeDiagnosingMatcher<Token>() {
5252

53-
public void describeTo(Description description) {
53+
public void describeTo(final Description description) {
5454
description.appendText("token has content ");
5555
description.appendValue(expectedContent);
5656
}
5757

5858
@Override
59-
protected boolean matchesSafely(Token item,
60-
Description mismatchDescription) {
59+
protected boolean matchesSafely(final Token item,
60+
final Description mismatchDescription) {
6161
mismatchDescription.appendText("token content is ");
6262
mismatchDescription.appendValue(item.content.toString());
6363
if (expectedContent.equals(item.content.toString())) {
@@ -71,13 +71,13 @@ protected boolean matchesSafely(Token item,
7171
public static Matcher<Token> isReady() {
7272
return new TypeSafeDiagnosingMatcher<Token>() {
7373

74-
public void describeTo(Description description) {
74+
public void describeTo(final Description description) {
7575
description.appendText("token is ready ");
7676
}
7777

7878
@Override
79-
protected boolean matchesSafely(Token item,
80-
Description mismatchDescription) {
79+
protected boolean matchesSafely(final Token item,
80+
final Description mismatchDescription) {
8181
mismatchDescription.appendText("token is not ready ");
8282
return item.isReady;
8383
}

0 commit comments

Comments
 (0)