Skip to content

Commit 4695d73

Browse files
committed
Prefix everything that is a pure getter with "get" as proposed by Gary Gregory
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1612341 13f79535-47bb-0310-9956-ffa450edef68
1 parent aa0762d commit 4695d73

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public String[] getHeader() {
497497
* @return {@code true} if missing column names are allowed when parsing the header line, {@code false} to throw an
498498
* {@link IllegalArgumentException}.
499499
*/
500-
public boolean isAllowMissingColumnNames() {
500+
public boolean getAllowMissingColumnNames() {
501501
return allowMissingColumnNames;
502502
}
503503

@@ -507,7 +507,7 @@ public boolean isAllowMissingColumnNames() {
507507
* @return {@code true} if empty lines between records are ignored, {@code false} if they are turned into empty
508508
* records.
509509
*/
510-
public boolean isIgnoringEmptyLines() {
510+
public boolean getIgnoreEmptyLines() {
511511
return ignoreEmptyLines;
512512
}
513513

@@ -517,7 +517,7 @@ public boolean isIgnoringEmptyLines() {
517517
* @return {@code true} if spaces around values are ignored, {@code false} if they are treated as part of the
518518
* value.
519519
*/
520-
public boolean isIgnoringSurroundingSpaces() {
520+
public boolean getIgnoreSurroundingSpaces() {
521521
return ignoreSurroundingSpaces;
522522
}
523523

@@ -570,7 +570,7 @@ public String getRecordSeparator() {
570570
*
571571
* @return whether to skip the header record.
572572
*/
573-
public boolean isSkippingHeaderRecord() {
573+
public boolean getSkipHeaderRecord() {
574574
return skipHeaderRecord;
575575
}
576576

@@ -690,10 +690,10 @@ public String toString() {
690690
sb.append(' ');
691691
sb.append("RecordSeparator=<").append(recordSeparator).append('>');
692692
}
693-
if (isIgnoringEmptyLines()) {
693+
if (getIgnoreEmptyLines()) {
694694
sb.append(" EmptyLines:ignored");
695695
}
696-
if (isIgnoringSurroundingSpaces()) {
696+
if (getIgnoreSurroundingSpaces()) {
697697
sb.append(" SurroundingSpaces:ignored");
698698
}
699699
sb.append(" SkipHeaderRecord:").append(skipHeaderRecord);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ private Map<String, Integer> initializeHeader() throws IOException {
352352
headerRecord = nextRecord.values();
353353
}
354354
} else {
355-
if (this.format.isSkippingHeaderRecord()) {
355+
if (this.format.getSkipHeaderRecord()) {
356356
this.nextRecord();
357357
}
358358
headerRecord = formatHeader;
@@ -364,7 +364,7 @@ private Map<String, Integer> initializeHeader() throws IOException {
364364
final String header = headerRecord[i];
365365
final boolean containsHeader = hdrMap.containsKey(header);
366366
final boolean emptyHeader = header == null || header.trim().isEmpty();
367-
if (containsHeader && (!emptyHeader || (emptyHeader && !this.format.isAllowMissingColumnNames()))) {
367+
if (containsHeader && (!emptyHeader || (emptyHeader && !this.format.getAllowMissingColumnNames()))) {
368368
throw new IllegalArgumentException("The header contains a duplicate name: \"" + header +
369369
"\" in " + Arrays.toString(headerRecord));
370370
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ final class Lexer implements Closeable {
6565
this.escape = mapNullToDisabled(format.getEscape());
6666
this.quoteChar = mapNullToDisabled(format.getQuoteChar());
6767
this.commentStart = mapNullToDisabled(format.getCommentStart());
68-
this.ignoreSurroundingSpaces = format.isIgnoringSurroundingSpaces();
69-
this.ignoreEmptyLines = format.isIgnoringEmptyLines();
68+
this.ignoreSurroundingSpaces = format.getIgnoreSurroundingSpaces();
69+
this.ignoreEmptyLines = format.getIgnoreEmptyLines();
7070
}
7171

7272
/**

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void testRFC4180() {
299299
assertEquals(null, RFC4180.getCommentStart());
300300
assertEquals(',', RFC4180.getDelimiter());
301301
assertEquals(null, RFC4180.getEscape());
302-
assertFalse(RFC4180.isIgnoringEmptyLines());
302+
assertFalse(RFC4180.getIgnoreEmptyLines());
303303
assertEquals(Character.valueOf('"'), RFC4180.getQuoteChar());
304304
assertEquals(null, RFC4180.getQuotePolicy());
305305
assertEquals("\r\n", RFC4180.getRecordSeparator());
@@ -324,8 +324,8 @@ public void testSerialization() throws Exception {
324324
assertEquals("comment start", CSVFormat.DEFAULT.getCommentStart(), format.getCommentStart());
325325
assertEquals("record separator", CSVFormat.DEFAULT.getRecordSeparator(), format.getRecordSeparator());
326326
assertEquals("escape", CSVFormat.DEFAULT.getEscape(), format.getEscape());
327-
assertEquals("trim", CSVFormat.DEFAULT.isIgnoringSurroundingSpaces(), format.isIgnoringSurroundingSpaces());
328-
assertEquals("empty lines", CSVFormat.DEFAULT.isIgnoringEmptyLines(), format.isIgnoringEmptyLines());
327+
assertEquals("trim", CSVFormat.DEFAULT.getIgnoreSurroundingSpaces(), format.getIgnoreSurroundingSpaces());
328+
assertEquals("empty lines", CSVFormat.DEFAULT.getIgnoreEmptyLines(), format.getIgnoreEmptyLines());
329329
}
330330

331331
@Test
@@ -376,14 +376,14 @@ public void testWithHeader() throws Exception {
376376

377377
@Test
378378
public void testWithIgnoreEmptyLines() throws Exception {
379-
assertFalse(CSVFormat.DEFAULT.withIgnoreEmptyLines(false).isIgnoringEmptyLines());
380-
assertTrue(CSVFormat.DEFAULT.withIgnoreEmptyLines(true).isIgnoringEmptyLines());
379+
assertFalse(CSVFormat.DEFAULT.withIgnoreEmptyLines(false).getIgnoreEmptyLines());
380+
assertTrue(CSVFormat.DEFAULT.withIgnoreEmptyLines(true).getIgnoreEmptyLines());
381381
}
382382

383383
@Test
384384
public void testWithIgnoreSurround() throws Exception {
385-
assertFalse(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(false).isIgnoringSurroundingSpaces());
386-
assertTrue(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(true).isIgnoringSurroundingSpaces());
385+
assertFalse(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(false).getIgnoreSurroundingSpaces());
386+
assertTrue(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(true).getIgnoreSurroundingSpaces());
387387
}
388388

389389
@Test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void testCommentsAndEmptyLines() throws IOException {
159159
"\n"+ // 6c
160160
"# Final comment\n"; // 7
161161
final CSVFormat format = CSVFormat.DEFAULT.withCommentMarker('#').withIgnoreEmptyLines(false);
162-
assertFalse("Should not ignore empty lines", format.isIgnoringEmptyLines());
162+
assertFalse("Should not ignore empty lines", format.getIgnoreEmptyLines());
163163

164164
final Lexer parser = getLexer(code, format);
165165

0 commit comments

Comments
 (0)