You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/05/19 15:08:30 UTC
commons-csv git commit: Remove trailing white spaces on all lines.
Repository: commons-csv
Updated Branches:
refs/heads/master f5a1968bb -> 05e2f7763
Remove trailing white spaces on all lines.
Project: http://git-wip-us.apache.org/repos/asf/commons-csv/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-csv/commit/05e2f776
Tree: http://git-wip-us.apache.org/repos/asf/commons-csv/tree/05e2f776
Diff: http://git-wip-us.apache.org/repos/asf/commons-csv/diff/05e2f776
Branch: refs/heads/master
Commit: 05e2f7763a7abc8cf29074fdeed4f8bae1951165
Parents: f5a1968
Author: Gary Gregory <ga...@gmail.com>
Authored: Sat May 19 09:08:25 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sat May 19 09:08:25 2018 -0600
----------------------------------------------------------------------
.../java/org/apache/commons/csv/CSVParser.java | 18 +++++++++---------
.../org/apache/commons/csv/CSVParserTest.java | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-csv/blob/05e2f776/src/main/java/org/apache/commons/csv/CSVParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java
index ac45c72..6e121e8 100644
--- a/src/main/java/org/apache/commons/csv/CSVParser.java
+++ b/src/main/java/org/apache/commons/csv/CSVParser.java
@@ -287,7 +287,7 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
private final Lexer lexer;
private final CSVRecordIterator csvRecordIterator;
-
+
/** A record buffer for getRecord(). Grows as necessary and is reused. */
private final List<String> recordList = new ArrayList<>();
@@ -524,10 +524,10 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
public Iterator<CSVRecord> iterator() {
return csvRecordIterator;
}
-
+
class CSVRecordIterator implements Iterator<CSVRecord> {
private CSVRecord current;
-
+
private CSVRecord getNextRecord() {
try {
return CSVParser.this.nextRecord();
@@ -536,7 +536,7 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
e.getClass().getSimpleName() + " reading next record: " + e.toString(), e);
}
}
-
+
@Override
public boolean hasNext() {
if (CSVParser.this.isClosed()) {
@@ -545,10 +545,10 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
if (this.current == null) {
this.current = this.getNextRecord();
}
-
+
return this.current != null;
}
-
+
@Override
public CSVRecord next() {
if (CSVParser.this.isClosed()) {
@@ -556,7 +556,7 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
}
CSVRecord next = this.current;
this.current = null;
-
+
if (next == null) {
// hasNext() wasn't called before
next = this.getNextRecord();
@@ -564,10 +564,10 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
throw new NoSuchElementException("No more CSV records available");
}
}
-
+
return next;
}
-
+
@Override
public void remove() {
throw new UnsupportedOperationException();
http://git-wip-us.apache.org/repos/asf/commons-csv/blob/05e2f776/src/test/java/org/apache/commons/csv/CSVParserTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java
index 8336154..1e355f1 100644
--- a/src/test/java/org/apache/commons/csv/CSVParserTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java
@@ -1103,7 +1103,7 @@ public class CSVParserTest {
assertEquals(String.valueOf(recordNumber), record.get(0));
}
}
-
+
private void validateLineNumbers(final String lineSeparator) throws IOException {
try (final CSVParser parser = CSVParser.parse("a" + lineSeparator + "b" + lineSeparator + "c",
CSVFormat.DEFAULT.withRecordSeparator(lineSeparator))) {