Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25EE1E0E8 for ; Mon, 7 Jan 2013 18:01:08 +0000 (UTC) Received: (qmail 10083 invoked by uid 500); 7 Jan 2013 18:01:07 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 10022 invoked by uid 500); 7 Jan 2013 18:01:07 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 10012 invoked by uid 99); 7 Jan 2013 18:01:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 18:01:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 18:01:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id ADBEA2388A91; Mon, 7 Jan 2013 18:00:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1429926 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVFormat.java test/java/org/apache/commons/csv/CSVFormatBuilderTest.java test/java/org/apache/commons/csv/CSVFormatTest.java Date: Mon, 07 Jan 2013 18:00:46 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130107180046.ADBEA2388A91@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ggregory Date: Mon Jan 7 18:00:46 2013 New Revision: 1429926 URL: http://svn.apache.org/viewvc?rev=1429926&view=rev Log: Where possible: - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatBuilderTest.java commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?rev=1429926&r1=1429925&r2=1429926&view=diff ============================================================================== --- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java (original) +++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Mon Jan 7 18:00:46 2013 @@ -398,7 +398,7 @@ public class CSVFormat implements Serial } @Override - public boolean equals(Object obj) + public boolean equals(final Object obj) { if (this == obj) { @@ -413,7 +413,7 @@ public class CSVFormat implements Serial return false; } - CSVFormat other = (CSVFormat) obj; + final CSVFormat other = (CSVFormat) obj; if (delimiter != other.delimiter) { return false; @@ -543,7 +543,7 @@ public class CSVFormat implements Serial */ @SuppressWarnings("synthetic-access") // TODO fields could be made package-protected // package protected to give access without needing a synthetic accessor - CSVFormatBuilder(CSVFormat format) { + CSVFormatBuilder(final CSVFormat format) { this(format.delimiter, format.quoteChar, format.quotePolicy, format.commentStart, format.escape, format.ignoreSurroundingSpaces, format.ignoreEmptyLines, Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatBuilderTest.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatBuilderTest.java?rev=1429926&r1=1429925&r2=1429926&view=diff ============================================================================== --- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatBuilderTest.java (original) +++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatBuilderTest.java Mon Jan 7 18:00:46 2013 @@ -158,23 +158,23 @@ public class CSVFormatBuilderTest { @Test public void testCopiedFormatIsEqualToOriginal() { - CSVFormat copyOfRCF4180 = CSVFormat.newBuilder(RFC4180).build(); + final CSVFormat copyOfRCF4180 = CSVFormat.newBuilder(RFC4180).build(); assertEquals(RFC4180, copyOfRCF4180); } @Test public void testCopiedFormatWithChanges() { - CSVFormat newFormat = CSVFormat.newBuilder(RFC4180).withDelimiter('!').build(); + final CSVFormat newFormat = CSVFormat.newBuilder(RFC4180).withDelimiter('!').build(); assertTrue(newFormat.getDelimiter() != RFC4180.getDelimiter()); } @Test public void testHeaderReferenceCannotEscape() { - String[] header = new String[]{"one", "tow", "three"}; + final String[] header = new String[]{"one", "tow", "three"}; builder.withHeader(header); - CSVFormat firstFormat = builder.build(); - CSVFormat secondFormat = builder.build(); + final CSVFormat firstFormat = builder.build(); + final CSVFormat secondFormat = builder.build(); assertNotSame(header, firstFormat.getHeader()); assertNotSame(firstFormat, secondFormat.getHeader()); } Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java?rev=1429926&r1=1429925&r2=1429926&view=diff ============================================================================== --- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java (original) +++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java Mon Jan 7 18:00:46 2013 @@ -69,8 +69,8 @@ public class CSVFormatTest { @Test public void testEquals() { - CSVFormat right = CSVFormat.DEFAULT; - CSVFormat left = CSVFormat.newBuilder().build(); + final CSVFormat right = CSVFormat.DEFAULT; + final CSVFormat left = CSVFormat.newBuilder().build(); assertFalse(right.equals(null)); assertFalse(right.equals("A String Instance")); @@ -85,27 +85,27 @@ public class CSVFormatTest { @Test public void testEqualsDelimiter() { - CSVFormat right = CSVFormat.newBuilder('!').build(); - CSVFormat left = CSVFormat.newBuilder('?').build(); + final CSVFormat right = CSVFormat.newBuilder('!').build(); + final CSVFormat left = CSVFormat.newBuilder('?').build(); assertNotEquals(right, left); } @Test public void testEqualsQuoteChar() { - CSVFormat right = CSVFormat.newBuilder('\'').withQuoteChar('"').build(); - CSVFormat left = CSVFormat.newBuilder(right).withQuoteChar('!').build(); + final CSVFormat right = CSVFormat.newBuilder('\'').withQuoteChar('"').build(); + final CSVFormat left = CSVFormat.newBuilder(right).withQuoteChar('!').build(); assertNotEquals(right, left); } @Test public void testEqualsQuotePolicy() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withQuotePolicy(Quote.MINIMAL) .build(); @@ -114,12 +114,12 @@ public class CSVFormatTest { @Test public void testEqualsCommentStart() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withCommentStart('!') .build(); @@ -128,13 +128,13 @@ public class CSVFormatTest { @Test public void testEqualsEscape() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') .withEscape('+') .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withEscape('!') .build(); @@ -143,14 +143,14 @@ public class CSVFormatTest { @Test public void testEqualsIgnoreSurroundingSpaces() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') .withEscape('+') .withIgnoreSurroundingSpaces(true) .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withIgnoreSurroundingSpaces(false) .build(); @@ -159,7 +159,7 @@ public class CSVFormatTest { @Test public void testEqualsIgnoreEmptyLines() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') @@ -167,7 +167,7 @@ public class CSVFormatTest { .withIgnoreSurroundingSpaces(true) .withIgnoreEmptyLines(true) .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withIgnoreEmptyLines(false) .build(); @@ -176,7 +176,7 @@ public class CSVFormatTest { @Test public void testEqualsRecordSeparator() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') @@ -185,7 +185,7 @@ public class CSVFormatTest { .withIgnoreEmptyLines(true) .withRecordSeparator('*') .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withRecordSeparator('!') .build(); @@ -194,7 +194,7 @@ public class CSVFormatTest { @Test public void testEqualsHeader() { - CSVFormat right = CSVFormat.newBuilder('\'') + final CSVFormat right = CSVFormat.newBuilder('\'') .withQuoteChar('"') .withQuotePolicy(Quote.ALL) .withCommentStart('#') @@ -204,14 +204,14 @@ public class CSVFormatTest { .withRecordSeparator('*') .withHeader("One", "Two", "Three") .build(); - CSVFormat left = CSVFormat.newBuilder(right) + final CSVFormat left = CSVFormat.newBuilder(right) .withHeader("Three", "Two", "One") .build(); assertNotEquals(right, left); } - private static void assertNotEquals(Object right, Object left) { + private static void assertNotEquals(final Object right, final Object left) { assertFalse(right.equals(left)); assertFalse(left.equals(right)); }