commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1610490 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/ test/java/org/apache/commons/csv/
Date Mon, 14 Jul 2014 19:25:04 GMT
Author: britter
Date: Mon Jul 14 19:25:03 2014
New Revision: 1610490

URL: http://svn.apache.org/r1610490
Log:
Use is prefix for getters that return booleans

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/LexerTest.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=1610490&r1=1610489&r2=1610490&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 Jul 14
19:25:03 2014
@@ -497,7 +497,7 @@ public final class CSVFormat implements 
      * @return <tt>true</tt> if headers are ignored when parsing the header line,
<tt>false</tt> to throw an
      *         {@link IllegalArgumentException}.
      */
-    public boolean getIgnoreEmptyHeaders() {
+    public boolean isIgnoringEmptyHeaders() {
         return ignoreEmptyHeaders;
     }
 
@@ -507,7 +507,7 @@ public final class CSVFormat implements 
      * @return <tt>true</tt> if empty lines between records are ignored, <tt>false</tt>
if they are turned into empty
      *         records.
      */
-    public boolean getIgnoreEmptyLines() {
+    public boolean isIgnoringEmptyLines() {
         return ignoreEmptyLines;
     }
 
@@ -517,7 +517,7 @@ public final class CSVFormat implements 
      * @return <tt>true</tt> if spaces around values are ignored, <tt>false</tt>
if they are treated as part of the
      *         value.
      */
-    public boolean getIgnoreSurroundingSpaces() {
+    public boolean isIgnoringSurroundingSpaces() {
         return ignoreSurroundingSpaces;
     }
 
@@ -570,7 +570,7 @@ public final class CSVFormat implements 
      *
      * @return whether to skip the header record.
      */
-    public boolean getSkipHeaderRecord() {
+    public boolean isSkippingHeaderRecord() {
         return skipHeaderRecord;
     }
 
@@ -619,7 +619,7 @@ public final class CSVFormat implements 
      *
      * @return {@code true} if a nullString is defined
      */
-    public boolean isNullHandling() {
+    public boolean isHandlingNull() {
         return nullString != null;
     }
 
@@ -682,7 +682,7 @@ public final class CSVFormat implements 
             sb.append(' ');
             sb.append("CommentStart=<").append(commentStart).append('>');
         }
-        if (isNullHandling()) {
+        if (isHandlingNull()) {
             sb.append(' ');
             sb.append("NullString=<").append(nullString).append('>');
         }
@@ -690,10 +690,10 @@ public final class CSVFormat implements 
             sb.append(' ');
             sb.append("RecordSeparator=<").append(recordSeparator).append('>');
         }
-        if (getIgnoreEmptyLines()) {
+        if (isIgnoringEmptyLines()) {
             sb.append(" EmptyLines:ignored");
         }
-        if (getIgnoreSurroundingSpaces()) {
+        if (isIgnoringSurroundingSpaces()) {
             sb.append(" SurroundingSpaces:ignored");
         }
         sb.append(" SkipHeaderRecord:").append(skipHeaderRecord);

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java?rev=1610490&r1=1610489&r2=1610490&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java Mon Jul 14
19:25:03 2014
@@ -370,7 +370,7 @@ public final class CSVParser implements 
                     headerRecord = nextRecord.values();
                 }
             } else {
-                if (this.format.getSkipHeaderRecord()) {
+                if (this.format.isSkippingHeaderRecord()) {
                     this.nextRecord();
                 }
                 headerRecord = formatHeader;
@@ -382,7 +382,7 @@ public final class CSVParser implements 
                     final String header = headerRecord[i];
                     final boolean containsHeader = hdrMap.containsKey(header);
                     final boolean emptyHeader = header == null || header.trim().isEmpty();
-                    if (containsHeader && (!emptyHeader || (emptyHeader &&
!this.format.getIgnoreEmptyHeaders()))) {
+                    if (containsHeader && (!emptyHeader || (emptyHeader &&
!this.format.isIgnoringEmptyHeaders()))) {
                         throw new IllegalArgumentException("The header contains a duplicate
name: \"" + header +
                                 "\" in " + Arrays.toString(headerRecord));
                     }

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java?rev=1610490&r1=1610489&r2=1610490&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java Mon Jul 14 19:25:03
2014
@@ -65,8 +65,8 @@ final class Lexer implements Closeable {
         this.escape = mapNullToDisabled(format.getEscape());
         this.quoteChar = mapNullToDisabled(format.getQuoteChar());
         this.commentStart = mapNullToDisabled(format.getCommentStart());
-        this.ignoreSurroundingSpaces = format.getIgnoreSurroundingSpaces();
-        this.ignoreEmptyLines = format.getIgnoreEmptyLines();
+        this.ignoreSurroundingSpaces = format.isIgnoringSurroundingSpaces();
+        this.ignoreEmptyLines = format.isIgnoringEmptyLines();
     }
 
     /**

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=1610490&r1=1610489&r2=1610490&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 Jul
14 19:25:03 2014
@@ -299,7 +299,7 @@ public class CSVFormatTest {
         assertEquals(null, RFC4180.getCommentStart());
         assertEquals(',', RFC4180.getDelimiter());
         assertEquals(null, RFC4180.getEscape());
-        assertFalse(RFC4180.getIgnoreEmptyLines());
+        assertFalse(RFC4180.isIgnoringEmptyLines());
         assertEquals(Character.valueOf('"'), RFC4180.getQuoteChar());
         assertEquals(null, RFC4180.getQuotePolicy());
         assertEquals("\r\n", RFC4180.getRecordSeparator());
@@ -324,8 +324,8 @@ public class CSVFormatTest {
         assertEquals("comment start", CSVFormat.DEFAULT.getCommentStart(), format.getCommentStart());
         assertEquals("record separator", CSVFormat.DEFAULT.getRecordSeparator(), format.getRecordSeparator());
         assertEquals("escape", CSVFormat.DEFAULT.getEscape(), format.getEscape());
-        assertEquals("trim", CSVFormat.DEFAULT.getIgnoreSurroundingSpaces(), format.getIgnoreSurroundingSpaces());
-        assertEquals("empty lines", CSVFormat.DEFAULT.getIgnoreEmptyLines(), format.getIgnoreEmptyLines());
+        assertEquals("trim", CSVFormat.DEFAULT.isIgnoringSurroundingSpaces(), format.isIgnoringSurroundingSpaces());
+        assertEquals("empty lines", CSVFormat.DEFAULT.isIgnoringEmptyLines(), format.isIgnoringEmptyLines());
     }
 
     @Test
@@ -376,14 +376,14 @@ public class CSVFormatTest {
 
     @Test
     public void testWithIgnoreEmptyLines() throws Exception {
-        assertFalse(CSVFormat.DEFAULT.withIgnoreEmptyLines(false).getIgnoreEmptyLines());
-        assertTrue(CSVFormat.DEFAULT.withIgnoreEmptyLines(true).getIgnoreEmptyLines());
+        assertFalse(CSVFormat.DEFAULT.withIgnoreEmptyLines(false).isIgnoringEmptyLines());
+        assertTrue(CSVFormat.DEFAULT.withIgnoreEmptyLines(true).isIgnoringEmptyLines());
     }
 
     @Test
     public void testWithIgnoreSurround() throws Exception {
-        assertFalse(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(false).getIgnoreSurroundingSpaces());
-        assertTrue(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(true).getIgnoreSurroundingSpaces());
+        assertFalse(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(false).isIgnoringSurroundingSpaces());
+        assertTrue(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(true).isIgnoringSurroundingSpaces());
     }
 
     @Test

Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/LexerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/LexerTest.java?rev=1610490&r1=1610489&r2=1610490&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/LexerTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/LexerTest.java Mon Jul 14
19:25:03 2014
@@ -159,7 +159,7 @@ public class LexerTest {
                 "\n"+                      // 6c
                 "# Final comment\n";       // 7
         final CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#').withIgnoreEmptyLines(false);
-        assertFalse("Should not ignore empty lines", format.getIgnoreEmptyLines());
+        assertFalse("Should not ignore empty lines", format.isIgnoringEmptyLines());
 
         final Lexer parser = getLexer(code, format);
 



Mime
View raw message