You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2013/05/03 08:37:58 UTC

svn commit: r1478655 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Author: britter
Date: Fri May  3 06:37:58 2013
New Revision: 1478655

URL: http://svn.apache.org/r1478655
Log:
Use isDelimiter method instead of != check. 

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

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=1478655&r1=1478654&r2=1478655&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 Fri May  3 06:37:58 2013
@@ -146,7 +146,7 @@ abstract class Lexer {
      * @return true if the given char is a whitespace character
      */
     boolean isWhitespace(final int c) {
-        return c != format.getDelimiter() && Character.isWhitespace((char) c);
+        return !isDelimiter(c) && Character.isWhitespace((char) c);
     }
 
     /**



Re: svn commit: r1478655 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Posted by Benedikt Ritter <br...@apache.org>.
2013/5/3 sebb <se...@gmail.com>

> On 3 May 2013 07:40, Benedikt Ritter <br...@apache.org> wrote:
>
> > The format field in Lexer is now only used by CSVLexer1 in the test
> > directory. It may therefore be removed.
> > I wonder if the isXXX methods really belong to CSVFormat.
> >
> > WDYT?
> >
> >
> The CSVLexerN entries in the test directory are copies of the originals,
> for comparative performance tests, and should be left alone as far as
> possible.
>

Maybe if would have been better if we had also copied a snapshot of the
Lexer class... Now we compare parts of old impl mixed with the new parts in
Lexer from src/main/java.


>
> Benedikt
>
> >
> >
> > 2013/5/3 <br...@apache.org>
> >
> > > Author: britter
> > > Date: Fri May  3 06:37:58 2013
> > > New Revision: 1478655
> > >
> > > URL: http://svn.apache.org/r1478655
> > > Log:
> > > Use isDelimiter method instead of != check.
> > >
> > > Modified:
> > >
> > >
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
> > >
> > > 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=1478655&r1=1478654&r2=1478655&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
> > > Fri May  3 06:37:58 2013
> > > @@ -146,7 +146,7 @@ abstract class Lexer {
> > >       * @return true if the given char is a whitespace character
> > >       */
> > >      boolean isWhitespace(final int c) {
> > > -        return c != format.getDelimiter() &&
> > > Character.isWhitespace((char) c);
> > > +        return !isDelimiter(c) && Character.isWhitespace((char) c);
> > >      }
> > >
> > >      /**
> > >
> > >
> > >
> >
> >
> > --
> > http://people.apache.org/~britter/
> > http://www.systemoutprintln.de/
> > http://twitter.com/BenediktRitter
> > http://github.com/britter
> >
>



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

Re: svn commit: r1478655 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Posted by sebb <se...@gmail.com>.
On 3 May 2013 07:40, Benedikt Ritter <br...@apache.org> wrote:

> The format field in Lexer is now only used by CSVLexer1 in the test
> directory. It may therefore be removed.
> I wonder if the isXXX methods really belong to CSVFormat.
>
> WDYT?
>
>
The CSVLexerN entries in the test directory are copies of the originals,
for comparative performance tests, and should be left alone as far as
possible.

Benedikt

>
>
> 2013/5/3 <br...@apache.org>
>
> > Author: britter
> > Date: Fri May  3 06:37:58 2013
> > New Revision: 1478655
> >
> > URL: http://svn.apache.org/r1478655
> > Log:
> > Use isDelimiter method instead of != check.
> >
> > Modified:
> >
> > commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
> >
> > 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=1478655&r1=1478654&r2=1478655&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
> > Fri May  3 06:37:58 2013
> > @@ -146,7 +146,7 @@ abstract class Lexer {
> >       * @return true if the given char is a whitespace character
> >       */
> >      boolean isWhitespace(final int c) {
> > -        return c != format.getDelimiter() &&
> > Character.isWhitespace((char) c);
> > +        return !isDelimiter(c) && Character.isWhitespace((char) c);
> >      }
> >
> >      /**
> >
> >
> >
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>

Re: svn commit: r1478655 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Posted by Benedikt Ritter <br...@apache.org>.
The format field in Lexer is now only used by CSVLexer1 in the test
directory. It may therefore be removed.
I wonder if the isXXX methods really belong to CSVFormat.

WDYT?

Benedikt


2013/5/3 <br...@apache.org>

> Author: britter
> Date: Fri May  3 06:37:58 2013
> New Revision: 1478655
>
> URL: http://svn.apache.org/r1478655
> Log:
> Use isDelimiter method instead of != check.
>
> Modified:
>
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
>
> 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=1478655&r1=1478654&r2=1478655&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
> Fri May  3 06:37:58 2013
> @@ -146,7 +146,7 @@ abstract class Lexer {
>       * @return true if the given char is a whitespace character
>       */
>      boolean isWhitespace(final int c) {
> -        return c != format.getDelimiter() &&
> Character.isWhitespace((char) c);
> +        return !isDelimiter(c) && Character.isWhitespace((char) c);
>      }
>
>      /**
>
>
>


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