Re: [compress] 2.0: Reading and Writing Archives

2014-01-21 Thread Stefan Bodewig
On 2014-01-22, Damjan Jovanovic wrote: > On Wed, Jan 8, 2014 at 4:41 PM, Stefan Bodewig wrote: >> * Checked vs Unchecked exceptions >> I would love to make ArchiveInput be an Iterator over the entries but >> can't do so as the things we'd need to do in next() might throw an >> IOException

Re: [compress] 2.0: Reading and Writing Archives

2014-01-21 Thread Damjan Jovanovic
On Wed, Jan 8, 2014 at 4:41 PM, Stefan Bodewig wrote: > Hi, > > putting the exact representation of an archive entry aside I've put down > an idea of the API for reading and writing archives together with a POC > port of the AR classes for this API. All is inside > http://svn.apache.org/repos/asf

Re: [VFS] Fix up pom so it works with Commons release profile

2014-01-21 Thread sebb
On 21 January 2014 16:28, Gary Gregory wrote: > On Tue, Jan 21, 2014 at 11:10 AM, sebb wrote: > >> On 21 January 2014 03:21, Gary Gregory wrote: >> > On Thu, Jan 16, 2014 at 7:49 PM, Gary Gregory > >wrote: >> > >> >> Sebb, >> >> >> >> Please modify the POMs and whatever else as you see fit. >> >

Re: [VFS] Fix up pom so it works with Commons release profile

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 11:10 AM, sebb wrote: > On 21 January 2014 03:21, Gary Gregory wrote: > > On Thu, Jan 16, 2014 at 7:49 PM, Gary Gregory >wrote: > > > >> Sebb, > >> > >> Please modify the POMs and whatever else as you see fit. > >> > >> It sure would be nice to release 2.1. > >> > > > >

Re: [VFS] Fix up pom so it works with Commons release profile

2014-01-21 Thread sebb
On 21 January 2014 03:21, Gary Gregory wrote: > On Thu, Jan 16, 2014 at 7:49 PM, Gary Gregory wrote: > >> Sebb, >> >> Please modify the POMs and whatever else as you see fit. >> >> It sure would be nice to release 2.1. >> > > Sebb, > > When do you think you'll be able to put time in? The multi-mod

Re: [csv] CSVRecord and Map

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 8:58 AM, Emmanuel Bourg wrote: > Le 21/01/2014 14:44, Gary Gregory a écrit : > > > That's what the current impl does: a new HashMap with String keys and > > String values. Since Strings are immutable, they do not need to be a > > 'copy'. Unless I misunderstand you. > > Tha

Re: [csv] CSVRecord and Map

2014-01-21 Thread Emmanuel Bourg
Le 21/01/2014 14:44, Gary Gregory a écrit : > That's what the current impl does: a new HashMap with String keys and > String values. Since Strings are immutable, they do not need to be a > 'copy'. Unless I misunderstand you. That's an independent copy of the structure of the record. Changes to th

Re: [csv] CSVRecord and Map

2014-01-21 Thread Adrian Crum
It might help to step back from the story and look at it from the perspective of a Commons CSV user who is familiar with using Maps. How should a Map derived from a CSVRecord behave? What happens with the put() and putAll() methods? What happens when get() and put() are called with invalid key

Re: [csv] CSVRecord and Map

2014-01-21 Thread Gary Gregory
On Tue, Jan 21, 2014 at 8:22 AM, Emmanuel Bourg wrote: > Le 21/01/2014 14:04, Gary Gregory a écrit : > > > - CSVRecord implements Map > > - CSVRecord implements Map but read-only > > -1 > > > - CSVRecord implements toMap() -> Map (a plain HashMap) > > +0 (that's fine if the map is a copy of the r

Re: [csv] CSVRecord and Map

2014-01-21 Thread Julien Aymé
2014/1/21 Emmanuel Bourg : > Le 21/01/2014 14:04, Gary Gregory a écrit : > >> - CSVRecord implements Map >> - CSVRecord implements Map but read-only > > -1 > >> - CSVRecord implements toMap() -> Map (a plain HashMap) > > +0 (that's fine if the map is a copy of the record) > >> - CSVRecord implement

Re: [csv] CSVRecord and Map

2014-01-21 Thread Emmanuel Bourg
Le 21/01/2014 14:04, Gary Gregory a écrit : > - CSVRecord implements Map > - CSVRecord implements Map but read-only -1 > - CSVRecord implements toMap() -> Map (a plain HashMap) +0 (that's fine if the map is a copy of the record) > - CSVRecord implements toMap() -> Map (a read-only HashMap) +1

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

[csv] CSVRecord and Map

2014-01-21 Thread Gary Gregory
My story: There should be some kind of play between a CSVRecord and a Map. My current app requires only reading, not writing. Solutions: - CSVRecord implements Map - CSVRecord implements Map but read-only - CSVRecord implements toMap() -> Map (a plain HashMap) - CSVRecord implements toMap() -> Ma

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