Hi Gary,

2013/8/1 <ggreg...@apache.org>

> Author: ggregory
> Date: Thu Aug  1 02:03:33 2013
> New Revision: 1509068
>
> URL: http://svn.apache.org/r1509068
> Log:
> - Add some real world CSV files.
> - Add a record API to get column values using an Enum.
> - Throw a better exception when a resource is not found in a class loader
> for the parser.
> - Replace some tabs with spaces.
>

<snip>


>
> @@ -371,9 +400,9 @@ public class CSVParser implements Iterab
>              }
>
>              public boolean hasNext() {
> -               if (CSVParser.this.isClosed()) {
> -                       return false;
> -               }
> +                if (CSVParser.this.isClosed()) {
> +                    return false;
> +                }
>                  if (this.current == null) {
>                      this.current = this.getNextRecord();
>                  }
> @@ -382,9 +411,9 @@ public class CSVParser implements Iterab
>              }
>
>              public CSVRecord next() {
> -               if (CSVParser.this.isClosed()) {
> -                       return null;
> -               }
> +                if (CSVParser.this.isClosed()) {
> +                    return null;
> +                }
>                  CSVRecord next = this.current;
>                  this.current = null;
>
>
JavaDoc of the Iterator interface says that next() throws a
NoSuchElementExecption if there are no more elements [1]. I'm not sure if
this applies if the parser is closed. WDYT?

Benedikt

[1] http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html#next()


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Reply via email to