From 453cfcbb593732bee980f4c83d06448152ac9887 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Mon, 18 Jan 2016 20:52:21 +0000 Subject: [PATCH] Use final. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1725344 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/csv/CSVFormat.java | 2 +- .../java/org/apache/commons/csv/CSVFormatTest.java | 12 ++++++------ .../java/org/apache/commons/csv/JiraCsv167Test.java | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index 409c0f4b..9a8a81c6 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -181,7 +181,7 @@ public final class CSVFormat implements Serializable { private final CSVFormat format; - private Predefined(CSVFormat format) { + private Predefined(final CSVFormat format) { this.format = format; } diff --git a/src/test/java/org/apache/commons/csv/CSVFormatTest.java b/src/test/java/org/apache/commons/csv/CSVFormatTest.java index e0a5fa3a..d24c4dbf 100644 --- a/src/test/java/org/apache/commons/csv/CSVFormatTest.java +++ b/src/test/java/org/apache/commons/csv/CSVFormatTest.java @@ -379,26 +379,26 @@ public class CSVFormatTest { @Test public void testJiraCsv154_withCommentMarker() throws IOException { final String comment = "This is a header comment"; - CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#').withHeaderComments(comment); - StringBuilder out = new StringBuilder(); + final CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#').withHeaderComments(comment); + final StringBuilder out = new StringBuilder(); final CSVPrinter printer = format.print(out); printer.print("A"); printer.print("B"); printer.close(); - String s = out.toString(); + final String s = out.toString(); Assert.assertTrue(s, s.contains(comment)); } @Test public void testJiraCsv154_withHeaderComments() throws IOException { final String comment = "This is a header comment"; - CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withHeaderComments(comment).withCommentMarker('#'); - StringBuilder out = new StringBuilder(); + final CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withHeaderComments(comment).withCommentMarker('#'); + final StringBuilder out = new StringBuilder(); final CSVPrinter printer = format.print(out); printer.print("A"); printer.print("B"); printer.close(); - String s = out.toString(); + final String s = out.toString(); Assert.assertTrue(s, s.contains(comment)); } diff --git a/src/test/java/org/apache/commons/csv/JiraCsv167Test.java b/src/test/java/org/apache/commons/csv/JiraCsv167Test.java index d8973d46..602228c8 100644 --- a/src/test/java/org/apache/commons/csv/JiraCsv167Test.java +++ b/src/test/java/org/apache/commons/csv/JiraCsv167Test.java @@ -29,7 +29,7 @@ public class JiraCsv167Test { @Test @Ignore("Fails") public void parse() throws IOException { - File csvData = new File("src/test/resources/csv-167/sample1.csv"); + final File csvData = new File("src/test/resources/csv-167/sample1.csv"); CSVFormat format = CSVFormat.DEFAULT; // format = format.withAllowMissingColumnNames(false); @@ -46,10 +46,10 @@ public class JiraCsv167Test { format = format.withRecordSeparator('\n'); format = format.withSkipHeaderRecord(false); // - CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), format); + final CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), format); int comments = 0; int records = 0; - for (CSVRecord csvRecord : parser) { + for (final CSVRecord csvRecord : parser) { if (csvRecord.isComment()) { comments++; } else {