commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: [io] 1.4-RC1 available for review
Date Sun, 13 Jan 2008 20:35:53 GMT
On Jan 13, 2008 7:35 PM, Stephen Colebourne <scolebourne@btopenworld.com> wrote:
> In FileWriterWithEncoding, the comment "The encoding may also be
> specified, and defaults to the platform default." doesn't match the code
> now, as NPE is thrown whenever the encoding is null.

Yup thats a mistake, but all the constructor's specify "not null" for
the encoding parameter and that they
throw a NPE if the encoding is null. Also I've fixed this in the trunk:

http://svn.apache.org/viewvc?view=rev&revision=611634

> More broadly, this makes it impossible to use FileWriterWithEncoding
> with the default encoding (unless you know what that is).

A "WithEncoding" impl. without an encoding doesn't make sense to me -
people can just use FileWriter directly to use the default encoding. I
made this point in IO-153[1] and you seemed to agree saying:

 "The non-encoding parameters exist as I copied it from
LocakbleFileWriter. While it could be argued that having the
constructors allows a single class to be used for all purposes, I
think that removing the no-encoding constructors is probably
sensible."

http://issues.apache.org/jira/browse/IO-153

> We could make a null encoding use the default (but calling the
> constructor with 'null' would be ambiguous). Or we could provide
> somewhere (FileUtils?) a static getDefaultEncoding(). Or we could just
> say that this class would only be used if you know the encoding you want.

+1 to the third option (i.e. "say that this class would only be used
if you know the encoding you want.")

Niall

> Stephen
>
>
>
> Niall Pemberton wrote:
> > Commons IO 1.4 release candidate 1 (RC1) is available for review. The
> > artifacts are here:
> > http://people.apache.org/~niallp/io-1.4-RC1/
> >
> > SVN Tag:
> > http://svn.apache.org/viewvc/commons/proper/io/tags/commons-io-1.4-RC1/
> >
> > Site:
> > http://people.apache.org/~niallp/io-1.4-RC1/site/
> > (note m2 generates relative links, so some don't work - but the site
> > is for info and not included in the release artifacts)
> >
> > Release Notes:
> > http://people.apache.org/~niallp/io-1.4-RC1/site/upgradeto1_4.html
> > (These are a copy of RELEASE-NOTES.txt in html form)
> >
> > RAT Report:
> > http://people.apache.org/~niallp/io-1.4-RC1/site/rat-report.html
> >
> > CLIRR Report:
> > http://people.apache.org/~niallp/io-1.4-RC1/site/clirr-report.html
> >
> > RC1 has been built with m2 - but m1 and ant builds are available - details here:
> > http://people.apache.org/~niallp/io-1.4-RC1/site/building.html
> >
> > Thanks in advance for your feedback.
> >
> > Niall

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


Mime
View raw message