- 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
This commit is contained in:
Gary D. Gregory 2013-06-20 21:39:53 +00:00
parent 4aa1f4d36c
commit ab2e7eb504
4 changed files with 14 additions and 14 deletions

View File

@ -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");
}

View File

@ -84,7 +84,7 @@ public class CSVRecord implements Serializable, Iterable<String> {
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!",

View File

@ -95,8 +95,8 @@ public class CSVRecordTest {
@Test
public void testIterator() {
int i = 0;
for (Iterator<String> itr = record.iterator(); itr.hasNext();) {
String value = itr.next();
for (final Iterator<String> itr = record.iterator(); itr.hasNext();) {
final String value = itr.next();
assertEquals(values[i], value);
i++;
}

View File

@ -29,14 +29,14 @@ final class TokenMatchers {
public static Matcher<Token> hasType(final Token.Type expectedType) {
return new TypeSafeDiagnosingMatcher<Token>() {
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<Token> hasContent(final String expectedContent) {
return new TypeSafeDiagnosingMatcher<Token>() {
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<Token> isReady() {
return new TypeSafeDiagnosingMatcher<Token>() {
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;
}