- Remove trailing spaces.
- Add missing final keywords. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509069 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
316a51f520
commit
fcc0d15c7b
|
@ -53,7 +53,7 @@ import java.util.Set;
|
|||
public class CSVFormat implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the given character is a line break character.
|
||||
*
|
||||
|
@ -66,7 +66,7 @@ public class CSVFormat implements Serializable {
|
|||
static boolean isLineBreak(final Character c) {
|
||||
return c != null && isLineBreak(c.charValue());
|
||||
}
|
||||
|
||||
|
||||
private final char delimiter;
|
||||
private final Character quoteChar;
|
||||
private final Quote quotePolicy;
|
||||
|
@ -324,8 +324,8 @@ public class CSVFormat implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of the header array.
|
||||
*
|
||||
* Returns a copy of the header array.
|
||||
*
|
||||
* @return a copy of the header array
|
||||
*/
|
||||
public String[] getHeader() {
|
||||
|
@ -362,7 +362,7 @@ public class CSVFormat implements Serializable {
|
|||
* <li>
|
||||
* <strong>Writing:</strong> Writes {@code null} as the given {@code nullString} when writing records.</li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* @return the String to convert to and from {@code null}. No substitution occurs if {@code null}
|
||||
*/
|
||||
public String getNullString() {
|
||||
|
@ -454,11 +454,11 @@ public class CSVFormat implements Serializable {
|
|||
|
||||
/**
|
||||
* Parses the specified content.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* See also the various static parse methods on {@link CSVParser}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param in
|
||||
* the input stream
|
||||
* @return a parser over a stream of {@link #CSVRecord}s.
|
||||
|
@ -528,9 +528,9 @@ public class CSVFormat implements Serializable {
|
|||
if (escape == null && quotePolicy == Quote.NONE) {
|
||||
throw new IllegalStateException("No quotes mode set but no escape character is set");
|
||||
}
|
||||
|
||||
|
||||
if (header != null) {
|
||||
Set<String> set = new HashSet<String>(header.length);
|
||||
final Set<String> set = new HashSet<String>(header.length);
|
||||
set.addAll(Arrays.asList(header));
|
||||
if (set.size() != header.length) {
|
||||
throw new IllegalStateException("The header contains duplicate names: " + Arrays.toString(header));
|
||||
|
@ -621,18 +621,18 @@ public class CSVFormat implements Serializable {
|
|||
|
||||
/**
|
||||
* Sets the header of the format. The header can either be parsed automatically from the input file with:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* CSVFormat format = aformat.withHeader();</pre>
|
||||
*
|
||||
*
|
||||
* or specified manually with:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* CSVFormat format = aformat.withHeader("name", "email", "phone");</pre>
|
||||
*
|
||||
*
|
||||
* @param header
|
||||
* the header, <tt>null</tt> if disabled, empty if parsed automatically, user specified otherwise.
|
||||
*
|
||||
*
|
||||
* @return A new CSVFormat that is equal to this but with the specified header
|
||||
* @see #withSkipHeaderRecord(boolean)
|
||||
*/
|
||||
|
|
|
@ -86,11 +86,11 @@ final class CSVLexer extends Lexer {
|
|||
}
|
||||
|
||||
if (isStartOfLine(lastChar) && isCommentStart(c)) {
|
||||
String line = in.readLine();
|
||||
final String line = in.readLine();
|
||||
if (line == null) {
|
||||
token.type = EOF;
|
||||
// don't set token.isReady here because no content
|
||||
return token;
|
||||
return token;
|
||||
}
|
||||
final String comment = line.trim();
|
||||
token.content.append(comment);
|
||||
|
|
|
@ -37,15 +37,15 @@ import java.util.NoSuchElementException;
|
|||
|
||||
/**
|
||||
* Parses CSV files according to the specified configuration.
|
||||
*
|
||||
*
|
||||
* Because CSV appears in many different dialects, the parser supports many configuration settings by allowing the
|
||||
* specification of a {@link CSVFormat}.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* To parse a CSV input with tabs as separators, '"' (double-quote) as an optional value encapsulator, and comments
|
||||
* starting with '#', you write:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* Reader in = new StringReader("a\tb\nc\td");
|
||||
* Iterable<CSVRecord> parser = CSVFormat.DEFAULT
|
||||
|
@ -56,11 +56,11 @@ import java.util.NoSuchElementException;
|
|||
* ...
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* To parse CSV input in a given format like Excel, you write:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* Reader in = new StringReader("a;b\nc;d");
|
||||
* Iterable<CSVRecord> parser = CSVFormat.EXCEL.parse(in);
|
||||
|
@ -71,7 +71,7 @@ import java.util.NoSuchElementException;
|
|||
* <p>
|
||||
* You may also get a List of records:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* Reader in = new StringReader("a;b\nc;d");
|
||||
* CSVParser parser = new CSVParser(in, CSVFormat.EXCEL);
|
||||
|
@ -83,18 +83,18 @@ import java.util.NoSuchElementException;
|
|||
* <p>
|
||||
* Internal parser state is completely covered by the format and the reader-state.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* see <a href="package-summary.html">package documentation</a> for more details
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
||||
|
||||
/**
|
||||
* Creates a parser for the given {@link File}.
|
||||
*
|
||||
*
|
||||
* @param file
|
||||
* a CSV file
|
||||
* @param format
|
||||
|
@ -109,11 +109,11 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Creates a parser for the given resource.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you do not read all records from the given source, you should call {@link #close()} on the parser.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param resource
|
||||
* a resource path
|
||||
* @param charset
|
||||
|
@ -128,7 +128,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
*/
|
||||
public static CSVParser parseResource(String resource, Charset charset, ClassLoader classLoader,
|
||||
final CSVFormat format) throws IOException {
|
||||
URL url = classLoader.getResource(resource);
|
||||
final URL url = classLoader.getResource(resource);
|
||||
if (url == null) {
|
||||
throw new IllegalArgumentException("Resource cannot be found: " + resource);
|
||||
}
|
||||
|
@ -137,11 +137,11 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Creates a parser for the given resource.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you do not read all records from the given source, you should call {@link #close()} on the parser.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param resource
|
||||
* a resource path
|
||||
* @param charset
|
||||
|
@ -153,7 +153,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* If an I/O error occurs
|
||||
*/
|
||||
public static CSVParser parseResource(String resource, Charset charset, final CSVFormat format) throws IOException {
|
||||
URL url = ClassLoader.getSystemResource(resource);
|
||||
final URL url = ClassLoader.getSystemResource(resource);
|
||||
if (url == null) {
|
||||
throw new IllegalArgumentException("System resource cannot be found: " + resource);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Creates a parser for the given {@link String} using the default format {@link CSVFormat#DEFAULT}.
|
||||
*
|
||||
*
|
||||
* @param string
|
||||
* a CSV string
|
||||
* @return a new parser
|
||||
|
@ -175,7 +175,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Creates a parser for the given {@link String}.
|
||||
*
|
||||
*
|
||||
* @param string
|
||||
* a CSV string
|
||||
* @param format
|
||||
|
@ -190,12 +190,12 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Creates a parser for the given URL.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you do not read all records from the given {@code url}, you should call {@link #close()} on the parser, unless
|
||||
* you close the {@code url}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param url
|
||||
* a URL
|
||||
* @param charset
|
||||
|
@ -230,12 +230,12 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* CSV parser using the default format {@link CSVFormat#DEFAULT}.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you do not read all records from the given {@code reader}, you should call {@link #close()} on the parser,
|
||||
* unless you close the {@code reader}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param input
|
||||
* a Reader containing "csv-formatted" input
|
||||
* @throws IllegalArgumentException
|
||||
|
@ -249,12 +249,12 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Customized CSV parser using the given {@link CSVFormat}
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you do not read all records from the given {@code reader}, you should call {@link #close()} on the parser,
|
||||
* unless you close the {@code reader}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param reader
|
||||
* a Reader containing CSV-formatted input
|
||||
* @param format
|
||||
|
@ -283,7 +283,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Closes resources.
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* If an I/O error occurs
|
||||
*/
|
||||
|
@ -297,7 +297,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* Returns the current line number in the input stream.
|
||||
* <p/>
|
||||
* ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the record number.
|
||||
*
|
||||
*
|
||||
* @return current line number
|
||||
*/
|
||||
public long getCurrentLineNumber() {
|
||||
|
@ -308,7 +308,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* Returns a copy of the header map that iterates in column order.
|
||||
* <p>
|
||||
* The map keys are column names. The map values are 0-based indices.
|
||||
*
|
||||
*
|
||||
* @return a copy of the header map that iterates in column order.
|
||||
*/
|
||||
public Map<String, Integer> getHeaderMap() {
|
||||
|
@ -319,7 +319,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* Returns the current record number in the input stream.
|
||||
* <p/>
|
||||
* ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the line number.
|
||||
*
|
||||
*
|
||||
* @return current line number
|
||||
*/
|
||||
public long getRecordNumber() {
|
||||
|
@ -331,7 +331,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* entries.
|
||||
* <p/>
|
||||
* The returned content starts at the current parse-position in the stream.
|
||||
*
|
||||
*
|
||||
* @return list of {@link CSVRecord} entries, may be empty
|
||||
* @throws IOException
|
||||
* on parse error or input read-failure
|
||||
|
@ -350,7 +350,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
*/
|
||||
private Map<String, Integer> initializeHeader() throws IOException {
|
||||
Map<String, Integer> hdrMap = null;
|
||||
String[] formatHeader = this.format.getHeader();
|
||||
final String[] formatHeader = this.format.getHeader();
|
||||
if (formatHeader != null) {
|
||||
hdrMap = new LinkedHashMap<String, Integer>();
|
||||
|
||||
|
@ -436,7 +436,7 @@ public class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
|
||||
/**
|
||||
* Parses the next record from the current point in the stream.
|
||||
*
|
||||
*
|
||||
* @return the record as an array of values, or <tt>null</tt> if the end of the stream has been reached
|
||||
* @throws IOException
|
||||
* on parse error or input read-failure
|
||||
|
|
|
@ -49,7 +49,7 @@ final class Constants {
|
|||
|
||||
/** According to RFC 4180, line breaks are delimited by CRLF */
|
||||
static final String CRLF = "\r\n";
|
||||
|
||||
|
||||
/**
|
||||
* Unicode line separator.
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ final class ExtendedBufferedReader extends BufferedReader {
|
|||
|
||||
/** The count of EOLs (CR/LF/CRLF) seen so far */
|
||||
private long eolCounter = 0;
|
||||
|
||||
|
||||
private boolean closed;
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ final class ExtendedBufferedReader extends BufferedReader {
|
|||
|
||||
/**
|
||||
* Closes the stream.
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* If an I/O error occurs
|
||||
*/
|
||||
|
|
|
@ -151,7 +151,7 @@ abstract class Lexer implements Closeable {
|
|||
boolean isClosed() {
|
||||
return in.isClosed();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return true if the given char is a whitespace character
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ abstract class Lexer implements Closeable {
|
|||
|
||||
/**
|
||||
* Closes resources.
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* If an I/O error occurs
|
||||
*/
|
||||
|
|
|
@ -65,7 +65,7 @@ final class Token {
|
|||
|
||||
/**
|
||||
* Eases IDE debugging.
|
||||
*
|
||||
*
|
||||
* @return a string helpful for debugging.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -111,7 +111,7 @@ public class CSVFileParserTest {
|
|||
|
||||
// Now parse the file and compare against the expected results
|
||||
// We use a buffered reader internally so no need to create one here.
|
||||
CSVParser parser = CSVParser.parseFile(new File(BASE, split[0]), format);
|
||||
final CSVParser parser = CSVParser.parseFile(new File(BASE, split[0]), format);
|
||||
for(final CSVRecord record : parser) {
|
||||
String parsed = record.toString();
|
||||
if (checkComments) {
|
||||
|
@ -153,7 +153,7 @@ public class CSVFileParserTest {
|
|||
assertEquals(testName + " Expected format ", line, format.toString());
|
||||
|
||||
// Now parse the file and compare against the expected results
|
||||
CSVParser parser = CSVParser.parseResource("CSVFileParser/" + split[0], Charset.forName("UTF-8"),
|
||||
final CSVParser parser = CSVParser.parseResource("CSVFileParser/" + split[0], Charset.forName("UTF-8"),
|
||||
this.getClass().getClassLoader(), format);
|
||||
for (final CSVRecord record : parser) {
|
||||
String parsed = record.toString();
|
||||
|
|
|
@ -214,10 +214,10 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testGetHeader() throws Exception {
|
||||
String[] header = new String[]{"one", "two", "three"};
|
||||
CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
|
||||
final String[] header = new String[]{"one", "two", "three"};
|
||||
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
|
||||
// getHeader() makes a copy of the header array.
|
||||
String[] headerCopy = formatWithHeader.getHeader();
|
||||
final String[] headerCopy = formatWithHeader.getHeader();
|
||||
headerCopy[0] = "A";
|
||||
headerCopy[1] = "B";
|
||||
headerCopy[2] = "C";
|
||||
|
@ -282,7 +282,7 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithCommentStart() throws Exception {
|
||||
CSVFormat formatWithCommentStart = CSVFormat.DEFAULT.withCommentStart('#');
|
||||
final CSVFormat formatWithCommentStart = CSVFormat.DEFAULT.withCommentStart('#');
|
||||
assertEquals( Character.valueOf('#'), formatWithCommentStart.getCommentStart());
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithDelimiter() throws Exception {
|
||||
CSVFormat formatWithDelimiter = CSVFormat.DEFAULT.withDelimiter('!');
|
||||
final CSVFormat formatWithDelimiter = CSVFormat.DEFAULT.withDelimiter('!');
|
||||
assertEquals('!', formatWithDelimiter.getDelimiter());
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithEscape() throws Exception {
|
||||
CSVFormat formatWithEscape = CSVFormat.DEFAULT.withEscape('&');
|
||||
final CSVFormat formatWithEscape = CSVFormat.DEFAULT.withEscape('&');
|
||||
assertEquals(Character.valueOf('&'), formatWithEscape.getEscape());
|
||||
}
|
||||
|
||||
|
@ -315,9 +315,9 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithHeader() throws Exception {
|
||||
String[] header = new String[]{"one", "two", "three"};
|
||||
final String[] header = new String[]{"one", "two", "three"};
|
||||
// withHeader() makes a copy of the header array.
|
||||
CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
|
||||
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
|
||||
assertArrayEquals(header, formatWithHeader.getHeader());
|
||||
assertNotSame(header, formatWithHeader.getHeader());
|
||||
header[0] = "A";
|
||||
|
@ -340,13 +340,13 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithNullString() throws Exception {
|
||||
CSVFormat formatWithNullString = CSVFormat.DEFAULT.withNullString("null");
|
||||
final CSVFormat formatWithNullString = CSVFormat.DEFAULT.withNullString("null");
|
||||
assertEquals("null", formatWithNullString.getNullString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithQuoteChar() throws Exception {
|
||||
CSVFormat formatWithQuoteChar = CSVFormat.DEFAULT.withQuoteChar('"');
|
||||
final CSVFormat formatWithQuoteChar = CSVFormat.DEFAULT.withQuoteChar('"');
|
||||
assertEquals(Character.valueOf('"'), formatWithQuoteChar.getQuoteChar());
|
||||
}
|
||||
|
||||
|
@ -357,13 +357,13 @@ public class CSVFormatTest {
|
|||
|
||||
@Test
|
||||
public void testWithQuotePolicy() throws Exception {
|
||||
CSVFormat formatWithQuotePolicy = CSVFormat.DEFAULT.withQuotePolicy(Quote.ALL);
|
||||
final CSVFormat formatWithQuotePolicy = CSVFormat.DEFAULT.withQuotePolicy(Quote.ALL);
|
||||
assertEquals(Quote.ALL, formatWithQuotePolicy.getQuotePolicy());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithRecordSeparator() throws Exception {
|
||||
CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withRecordSeparator('!');
|
||||
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withRecordSeparator('!');
|
||||
assertEquals("!", formatWithRecordSeparator.getRecordSeparator());
|
||||
}
|
||||
|
||||
|
|
|
@ -26,11 +26,11 @@ import static org.apache.commons.csv.Token.Type.COMMENT;
|
|||
import static org.apache.commons.csv.Token.Type.EOF;
|
||||
import static org.apache.commons.csv.Token.Type.EORECORD;
|
||||
import static org.apache.commons.csv.Token.Type.TOKEN;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.apache.commons.csv.TokenMatchers.hasContent;
|
||||
import static org.apache.commons.csv.TokenMatchers.matches;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
|
|
@ -472,7 +472,7 @@ public class CSVParserTest {
|
|||
iterator.remove();
|
||||
fail("expected UnsupportedOperationException");
|
||||
} catch (final UnsupportedOperationException expected) {
|
||||
// expected
|
||||
// expected
|
||||
}
|
||||
assertArrayEquals(new String[]{"a", "b", "c"}, iterator.next().values());
|
||||
assertArrayEquals(new String[]{"1", "2", "3"}, iterator.next().values());
|
||||
|
|
|
@ -327,7 +327,7 @@ public class CSVPrinterTest {
|
|||
final CSVPrinter printer = new CSVPrinter(sw, format);
|
||||
printer.printRecord("a", null, "b");
|
||||
printer.close();
|
||||
String csvString = sw.toString();
|
||||
final String csvString = sw.toString();
|
||||
assertEquals("a,NULL,b" + recordSeparator, csvString);
|
||||
final Iterable<CSVRecord> iterable = format.parse(new StringReader(csvString));
|
||||
final Iterator<CSVRecord> iterator = iterable.iterator();
|
||||
|
@ -486,7 +486,7 @@ public class CSVPrinterTest {
|
|||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testInvalidFormat() throws Exception {
|
||||
CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR);
|
||||
final CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR);
|
||||
new CSVPrinter(null, invalidFormat);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import static org.junit.Assert.assertNull;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -101,8 +100,7 @@ public class CSVRecordTest {
|
|||
@Test
|
||||
public void testIterator() {
|
||||
int i = 0;
|
||||
for (final Iterator<String> itr = record.iterator(); itr.hasNext();) {
|
||||
final String value = itr.next();
|
||||
for (String value : record) {
|
||||
assertEquals(values[i], value);
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
*/
|
||||
package org.apache.commons.csv;
|
||||
|
||||
import static org.hamcrest.core.AllOf.allOf;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeDiagnosingMatcher;
|
||||
import static org.hamcrest.core.AllOf.allOf;
|
||||
|
||||
/**
|
||||
* Collection of matchers for asserting the type and content of tokens.
|
||||
|
|
Loading…
Reference in New Issue