Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Adrian Crum
http://mail-archives.apache.org/mod_mbox/commons-dev/201401.mbox/%3C52D5C3A7.4060004%40sandglass-software.com%3E http://mail-archives.apache.org/mod_mbox/commons-dev/201401.mbox/%3C52D7C612.8040601%40sandglass-software.com%3E Adrian Crum Sandglass Software www.sandglass-software.com On 1/21/201

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 6:20 AM, Adrian Crum < adrian.c...@sandglass-software.com> wrote: > This looks really ugly. How do I update the CSVRecord using Map.put()? > > Is there a reason you didn't use the design I proposed? > What design is that? Obviously not in this thread but a reference would

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 6:54 AM, Adrian Crum < adrian.c...@sandglass-software.com> wrote: > Btw, line #179 - potential NPE. > > If CSVRecord is intended to be read-only, then the toMap() method should > return an unmodifiable Map. My use case is read-only but it does not seem needed to restrict

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 7:49 AM, Gary Gregory wrote: > On Tue, Jan 21, 2014 at 6:44 AM, Adrian Crum < > adrian.c...@sandglass-software.com> wrote: > >> I must be confused. If the goal was to give CSVRecord a Map interface, >> then that would include the interface's put method. >> > > I recall gett

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 6:36 AM, Emmanuel Bourg wrote: > Le 21/01/2014 12:20, Adrian Crum a écrit : > > This looks really ugly. How do I update the CSVRecord using Map.put()? > You do not! That's not the point. See the email I just sent. If we make record record implement Map, then you get it a

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 6:44 AM, Adrian Crum < adrian.c...@sandglass-software.com> wrote: > I must be confused. If the goal was to give CSVRecord a Map interface, > then that would include the interface's put method. > I recall getting some pushback on making record implement Map. The ugly part i

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Adrian Crum
Btw, line #179 - potential NPE. If CSVRecord is intended to be read-only, then the toMap() method should return an unmodifiable Map. Adrian Crum Sandglass Software www.sandglass-software.com On 1/21/2014 6:44 AM, Adrian Crum wrote: I must be confused. If the goal was to give CSVRecord a Map

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Adrian Crum
I must be confused. If the goal was to give CSVRecord a Map interface, then that would include the interface's put method. If we don't support the Map interface, then what is the point of this change? Adrian Crum Sandglass Software www.sandglass-software.com On 1/21/2014 6:36 AM, Emmanuel Bo

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Emmanuel Bourg
Le 21/01/2014 12:20, Adrian Crum a écrit : > This looks really ugly. How do I update the CSVRecord using Map.put()? Shouldn't the record be read only? As the result of a parsing it's not intended to be modified. Emmanuel Bourg

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-21 Thread Adrian Crum
This looks really ugly. How do I update the CSVRecord using Map.put()? Is there a reason you didn't use the design I proposed? Adrian Crum Sandglass Software www.sandglass-software.com On 1/20/2014 9:12 PM, ggreg...@apache.org wrote: Author: ggregory Date: Tue Jan 21 02:12:02 2014 New Revision

Re: svn commit: r1559905 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVRecord.java test/java/org/apache/commons/csv/CSVRecordTest.java

2014-01-20 Thread Emmanuel Bourg
Le 21/01/2014 03:12, ggreg...@apache.org a écrit : > /** > + * Puts all values of this record into the given Map. > + * > + * @param map The Map to populate. > + * @return the given map. > + */ > +public Map putIn(Map map) { > +for (Entry entry : mapping.entry