commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: commons-csv git commit: Better ivar name.
Date Fri, 18 Aug 2017 15:37:52 GMT
We already have header*Map* ...

Gary

On Fri, Aug 18, 2017 at 9:23 AM, Benedikt Ritter <britter@apache.org> wrote:

> Hello,
>
> I don't think this is a better name. In my opinion it's bad style to add
> types to variable names. How about recordContents or simply content/s ?
>
> Regards,
> Benedikt
> <ggregory@apache.org> schrieb am Fr. 18. Aug. 2017 um 17:02:
>
>> Repository: commons-csv
>> Updated Branches:
>>   refs/heads/master 431f8236e -> 259812ec0
>>
>>
>> Better ivar name.
>>
>> Project: http://git-wip-us.apache.org/repos/asf/commons-csv/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/commons-csv/commit/
>> 259812ec
>> Tree: http://git-wip-us.apache.org/repos/asf/commons-csv/tree/259812ec
>> Diff: http://git-wip-us.apache.org/repos/asf/commons-csv/diff/259812ec
>>
>> Branch: refs/heads/master
>> Commit: 259812ec0af308b2ceec4687ffa52b873425bb5b
>> Parents: 431f823
>> Author: Gary Gregory <garydgregory@gmail.com>
>> Authored: Fri Aug 18 09:02:19 2017 -0600
>> Committer: Gary Gregory <garydgregory@gmail.com>
>> Committed: Fri Aug 18 09:02:19 2017 -0600
>>
>> ----------------------------------------------------------------------
>>  src/main/java/org/apache/commons/csv/CSVParser.java | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/commons-csv/blob/
>> 259812ec/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 17d1c20..8851211 100644
>> --- a/src/main/java/org/apache/commons/csv/CSVParser.java
>> +++ b/src/main/java/org/apache/commons/csv/CSVParser.java
>> @@ -286,7 +286,7 @@ public final class CSVParser implements
>> Iterable<CSVRecord>, Closeable {
>>      private final Lexer lexer;
>>
>>      /** A record buffer for getRecord(). Grows as necessary and is
>> reused. */
>> -    private final List<String> record = new ArrayList<>();
>> +    private final List<String> recordList = new ArrayList<>();
>>
>>      /**
>>       * The next record number to assign.
>> @@ -364,7 +364,7 @@ public final class CSVParser implements
>> Iterable<CSVRecord>, Closeable {
>>              return;
>>          }
>>          final String nullString = this.format.getNullString();
>> -        this.record.add(inputClean.equals(nullString) ? null :
>> inputClean);
>> +        this.recordList.add(inputClean.equals(nullString) ? null :
>> inputClean);
>>      }
>>
>>      /**
>> @@ -577,7 +577,7 @@ public final class CSVParser implements
>> Iterable<CSVRecord>, Closeable {
>>       */
>>      CSVRecord nextRecord() throws IOException {
>>          CSVRecord result = null;
>> -        this.record.clear();
>> +        this.recordList.clear();
>>          StringBuilder sb = null;
>>          final long startCharPosition = lexer.getCharacterPosition() +
>> this.characterOffset;
>>          do {
>> @@ -611,10 +611,10 @@ public final class CSVParser implements
>> Iterable<CSVRecord>, Closeable {
>>              }
>>          } while (this.reusableToken.type == TOKEN);
>>
>> -        if (!this.record.isEmpty()) {
>> +        if (!this.recordList.isEmpty()) {
>>              this.recordNumber++;
>>              final String comment = sb == null ? null : sb.toString();
>> -            result = new CSVRecord(this.record.toArray(new
>> String[this.record.size()]), this.headerMap, comment,
>> +            result = new CSVRecord(this.recordList.toArray(new
>> String[this.recordList.size()]), this.headerMap, comment,
>>                      this.recordNumber, startCharPosition);
>>          }
>>          return result;
>>
>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message