You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <GG...@rocketsoftware.com> on 2012/03/12 15:03:16 UTC

Re: [jira] [Created] (CSV-55) Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

I do not think we need to tickets for this kind of change. 

Gary

On Mar 12, 2012, at 9:59, "Benedikt Ritter (Created) (JIRA)" <ji...@apache.org> wrote:

> Replace while(true)-loop in CSVParser.getRecord() with do-while-loop
> --------------------------------------------------------------------
> 
>                 Key: CSV-55
>                 URL: https://issues.apache.org/jira/browse/CSV-55
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Parser
>    Affects Versions: 1.0
>            Reporter: Benedikt Ritter
>            Priority: Trivial
> 
> 
> The current implementation of {{getRecords()}} uses a while(true) loop, that gets canceled by an if statement:
> 
> {code:java}
> while (true) {
>    reusableToken.reset();
>    lexer.nextToken(reusableToken);
>    // omitted
>    if(reusableToken.type != TOKEN) {
>        break;
>    }
> }
> {code}
> 
> This should be replaced by a do-while-loop:
> {code:java}
> do {
>    reusableToken.reset();
>    lexer.nextToken(reusableToken);
>    // omitted
> } while (reusableToken.type == TOKEN);
> {code}
> 
> 
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [jira] [Created] (CSV-55) Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Mar 12, 2012 at 10:47 AM, Benedikt Ritter <beneritter@googlemail.com
> wrote:

> Am 12. März 2012 15:39 schrieb Gary Gregory <ga...@gmail.com>:
> > On Mon, Mar 12, 2012 at 10:17 AM, Benedikt Ritter <
> beneritter@googlemail.com
> >> wrote:
> >
> >> Hey Gary,
> >>
> >> thanks for the hint. Should I just send patches for minor changes like
> >> that to the ML (plain text, not as attachment of course ;)?
> >>
> >
> > Hm, I thought a comitter was submitting these... JIRA is the way to
> submit
> > code indeed.
> >
>
> Feel free to vouch for me ;)
>
> > But note that the best way is to attach a diff file base on the SVN
> trunk.
> >
>
> Yes, I was about to create a patch, but then I realized, that the code
> formatting is not correct. Can you tell me where I can get the right
> formatter configuration file for cvs (I'm using eclipse)? The source
> does not look like the default maven style...
>

Sadly, each component in [commons] has its own style and we do not save IDE
formater configurations in SVN.

The usual way to patch follows the principle of least difference, the fewer
formatting changes the better and none is best. This let's the
commiter/reviewer really see what a patch is about and not get distracted
by formatting changes.

Gary


>
> TIA,
> Benedikt
>
> > Gary
> >
> >
> >>
> >> Benedikt
> >>
> >> Am 12. März 2012 15:03 schrieb Gary Gregory <
> GGregory@rocketsoftware.com>:
> >> > I do not think we need to tickets for this kind of change.
> >> >
> >> > Gary
> >> >
> >> > On Mar 12, 2012, at 9:59, "Benedikt Ritter (Created) (JIRA)" <
> >> jira@apache.org> wrote:
> >> >
> >> >> Replace while(true)-loop in CSVParser.getRecord() with do-while-loop
> >> >> --------------------------------------------------------------------
> >> >>
> >> >>                 Key: CSV-55
> >> >>                 URL: https://issues.apache.org/jira/browse/CSV-55
> >> >>             Project: Commons CSV
> >> >>          Issue Type: Improvement
> >> >>          Components: Parser
> >> >>    Affects Versions: 1.0
> >> >>            Reporter: Benedikt Ritter
> >> >>            Priority: Trivial
> >> >>
> >> >>
> >> >> The current implementation of {{getRecords()}} uses a while(true)
> loop,
> >> that gets canceled by an if statement:
> >> >>
> >> >> {code:java}
> >> >> while (true) {
> >> >>    reusableToken.reset();
> >> >>    lexer.nextToken(reusableToken);
> >> >>    // omitted
> >> >>    if(reusableToken.type != TOKEN) {
> >> >>        break;
> >> >>    }
> >> >> }
> >> >> {code}
> >> >>
> >> >> This should be replaced by a do-while-loop:
> >> >> {code:java}
> >> >> do {
> >> >>    reusableToken.reset();
> >> >>    lexer.nextToken(reusableToken);
> >> >>    // omitted
> >> >> } while (reusableToken.type == TOKEN);
> >> >> {code}
> >> >>
> >> >>
> >> >> --
> >> >> This message is automatically generated by JIRA.
> >> >> If you think it was sent incorrectly, please contact your JIRA
> >> administrators:
> >>
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> >> >> For more information on JIRA, see:
> >> http://www.atlassian.com/software/jira
> >> >>
> >> >>
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> > For additional commands, e-mail: dev-help@commons.apache.org
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [jira] [Created] (CSV-55) Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

Posted by Benedikt Ritter <be...@googlemail.com>.
Am 12. März 2012 15:39 schrieb Gary Gregory <ga...@gmail.com>:
> On Mon, Mar 12, 2012 at 10:17 AM, Benedikt Ritter <beneritter@googlemail.com
>> wrote:
>
>> Hey Gary,
>>
>> thanks for the hint. Should I just send patches for minor changes like
>> that to the ML (plain text, not as attachment of course ;)?
>>
>
> Hm, I thought a comitter was submitting these... JIRA is the way to submit
> code indeed.
>

Feel free to vouch for me ;)

> But note that the best way is to attach a diff file base on the SVN trunk.
>

Yes, I was about to create a patch, but then I realized, that the code
formatting is not correct. Can you tell me where I can get the right
formatter configuration file for cvs (I'm using eclipse)? The source
does not look like the default maven style...

TIA,
Benedikt

> Gary
>
>
>>
>> Benedikt
>>
>> Am 12. März 2012 15:03 schrieb Gary Gregory <GG...@rocketsoftware.com>:
>> > I do not think we need to tickets for this kind of change.
>> >
>> > Gary
>> >
>> > On Mar 12, 2012, at 9:59, "Benedikt Ritter (Created) (JIRA)" <
>> jira@apache.org> wrote:
>> >
>> >> Replace while(true)-loop in CSVParser.getRecord() with do-while-loop
>> >> --------------------------------------------------------------------
>> >>
>> >>                 Key: CSV-55
>> >>                 URL: https://issues.apache.org/jira/browse/CSV-55
>> >>             Project: Commons CSV
>> >>          Issue Type: Improvement
>> >>          Components: Parser
>> >>    Affects Versions: 1.0
>> >>            Reporter: Benedikt Ritter
>> >>            Priority: Trivial
>> >>
>> >>
>> >> The current implementation of {{getRecords()}} uses a while(true) loop,
>> that gets canceled by an if statement:
>> >>
>> >> {code:java}
>> >> while (true) {
>> >>    reusableToken.reset();
>> >>    lexer.nextToken(reusableToken);
>> >>    // omitted
>> >>    if(reusableToken.type != TOKEN) {
>> >>        break;
>> >>    }
>> >> }
>> >> {code}
>> >>
>> >> This should be replaced by a do-while-loop:
>> >> {code:java}
>> >> do {
>> >>    reusableToken.reset();
>> >>    lexer.nextToken(reusableToken);
>> >>    // omitted
>> >> } while (reusableToken.type == TOKEN);
>> >> {code}
>> >>
>> >>
>> >> --
>> >> This message is automatically generated by JIRA.
>> >> If you think it was sent incorrectly, please contact your JIRA
>> administrators:
>> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
>> >> For more information on JIRA, see:
>> http://www.atlassian.com/software/jira
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [jira] [Created] (CSV-55) Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Mar 12, 2012 at 10:17 AM, Benedikt Ritter <beneritter@googlemail.com
> wrote:

> Hey Gary,
>
> thanks for the hint. Should I just send patches for minor changes like
> that to the ML (plain text, not as attachment of course ;)?
>

Hm, I thought a comitter was submitting these... JIRA is the way to submit
code indeed.

But note that the best way is to attach a diff file base on the SVN trunk.

Gary


>
> Benedikt
>
> Am 12. März 2012 15:03 schrieb Gary Gregory <GG...@rocketsoftware.com>:
> > I do not think we need to tickets for this kind of change.
> >
> > Gary
> >
> > On Mar 12, 2012, at 9:59, "Benedikt Ritter (Created) (JIRA)" <
> jira@apache.org> wrote:
> >
> >> Replace while(true)-loop in CSVParser.getRecord() with do-while-loop
> >> --------------------------------------------------------------------
> >>
> >>                 Key: CSV-55
> >>                 URL: https://issues.apache.org/jira/browse/CSV-55
> >>             Project: Commons CSV
> >>          Issue Type: Improvement
> >>          Components: Parser
> >>    Affects Versions: 1.0
> >>            Reporter: Benedikt Ritter
> >>            Priority: Trivial
> >>
> >>
> >> The current implementation of {{getRecords()}} uses a while(true) loop,
> that gets canceled by an if statement:
> >>
> >> {code:java}
> >> while (true) {
> >>    reusableToken.reset();
> >>    lexer.nextToken(reusableToken);
> >>    // omitted
> >>    if(reusableToken.type != TOKEN) {
> >>        break;
> >>    }
> >> }
> >> {code}
> >>
> >> This should be replaced by a do-while-loop:
> >> {code:java}
> >> do {
> >>    reusableToken.reset();
> >>    lexer.nextToken(reusableToken);
> >>    // omitted
> >> } while (reusableToken.type == TOKEN);
> >> {code}
> >>
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> >> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [jira] [Created] (CSV-55) Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

Posted by Benedikt Ritter <be...@googlemail.com>.
Hey Gary,

thanks for the hint. Should I just send patches for minor changes like
that to the ML (plain text, not as attachment of course ;)?

Benedikt

Am 12. März 2012 15:03 schrieb Gary Gregory <GG...@rocketsoftware.com>:
> I do not think we need to tickets for this kind of change.
>
> Gary
>
> On Mar 12, 2012, at 9:59, "Benedikt Ritter (Created) (JIRA)" <ji...@apache.org> wrote:
>
>> Replace while(true)-loop in CSVParser.getRecord() with do-while-loop
>> --------------------------------------------------------------------
>>
>>                 Key: CSV-55
>>                 URL: https://issues.apache.org/jira/browse/CSV-55
>>             Project: Commons CSV
>>          Issue Type: Improvement
>>          Components: Parser
>>    Affects Versions: 1.0
>>            Reporter: Benedikt Ritter
>>            Priority: Trivial
>>
>>
>> The current implementation of {{getRecords()}} uses a while(true) loop, that gets canceled by an if statement:
>>
>> {code:java}
>> while (true) {
>>    reusableToken.reset();
>>    lexer.nextToken(reusableToken);
>>    // omitted
>>    if(reusableToken.type != TOKEN) {
>>        break;
>>    }
>> }
>> {code}
>>
>> This should be replaced by a do-while-loop:
>> {code:java}
>> do {
>>    reusableToken.reset();
>>    lexer.nextToken(reusableToken);
>>    // omitted
>> } while (reusableToken.type == TOKEN);
>> {code}
>>
>>
>> --
>> This message is automatically generated by JIRA.
>> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org