Antwort: Re: [IO] encapsulating open/close

2010-08-06 Thread Sebastian . Petzelberger
>Not sure if this is exactly what you're looking for, but have you >seen the AutoCloseInputStream [1] class? No, I haven't, because IO does not use this itself. My suggestion is providing an interface and a convenience method, which an expression of this interface als argument. In this method ope

Re: [io]

2010-08-06 Thread Niall Pemberton
On Fri, Aug 6, 2010 at 7:24 AM, Henri Yandell wrote: > Though I thought I'd read that it is currently both 1.5+ and has been > able to maintain backwards compatibility (i.e. no need to change the > package name). Something for clirr to determine once the release is > ready. Yes - CLIRR is current

Re: [IO] encapsulating open/close

2010-08-06 Thread Niall Pemberton
On Wed, Aug 4, 2010 at 11:27 AM, wrote: > > Wanted is a convenience method that hides the opening and closing of a file > connection. This would avoid redundancy and failures by accidently not > closing the file connection. I have implemented this before, but now I want > to use apache commons io

Re: Re: [IO] encapsulating open/close

2010-08-06 Thread Jukka Zitting
Hi, On Fri, Aug 6, 2010 at 10:54 AM, wrote: > My suggestion is providing an interface and a convenience method, which an > expression of this interface als argument. In this method opening and > closing will be done. I think, this would be the natural way in java. When > closures came, the clien

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Phil Steitz
Gilles Sadowski wrote: The added value that I see is that an IAE designating which argument that cannot be null is in fact null gives more specific information to the caller (or production support person examining logs) than just a propagated NPE. >>> Well, my initial post repor

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Gilles Sadowski
> What I propose (as an alternative the "simple" policy) above is to create > a "NullArgumentException" that inherits from "MathIllegalArgumentException". > This exception will be thrown whenever a null check fails (i.e. "null is an > illegal argument"). To be consistent, we should never throw NPE

[Math] Redundant messages (Was: Usage of "NullPointerException")

2010-08-06 Thread Gilles Sadowski
> On another front, the separation between "general" and "specific" error > message patterns can save some more enums [...] More on this. Excerpt from "LocalizedFormats.java": NEGATIVE_LENGTH("length cannot be negative ({0})"), // ... NOT_POSITIVE_LENGTH("length must be positive ({0})

Antwort: Re: [IO] encapsulating open/close

2010-08-06 Thread Sebastian . Petzelberger
Thnaks Niall and Jukka for your awnsers. -Niall Pemberton schrieb: - >Do you mean this: >http://developers.sun.com/mobility/apis/articles/fileconnection/ My term "file connection" was maybe misleading. >public void showFile(String fileName) Where is the connection closed? With my sugges

Re: [compress] Snapshot for 1.1 using Nexus

2010-08-06 Thread Torsten Curdt
> I just configured everything for Nexus and successfully created a snapshot: > https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-compress/1.1-SNAPSHOT/ Cool > The how to i followed: > http://wiki.apache.org/commons/UsingNexus > is very good, no objections.

[Commons Wiki] Update of "UsingNexus" by ChristianGrobm eier

2010-08-06 Thread Apache Wiki
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification. The "UsingNexus" page has been changed by ChristianGrobmeier. The comment on this change is: added instructions for the svn tag and voting. http://wiki.apache.org/commons/UsingNexus?act

[all] Using Nexus - website

2010-08-06 Thread Christian Grobmeier
Hello, I updated the UsingNexus page with some more detailed instructions (basically merged from our other release procedures. I saw that there is nothing mentioned on the components website. In the old fashioned way we included the website to the vote thread. How should we do this now? Is it: -

Re: [compress] Snapshot for 1.1 using Nexus

2010-08-06 Thread Christian Grobmeier
>> The how to i followed: >> http://wiki.apache.org/commons/UsingNexus >> is very good, no objections. > > Hate the stored passwords though :) > > >  Which is why I no longer use the release plugin for my personal projects. >  http://github.com/tcurdt/scripts > mvnrelease is actually intersting

Re: [all] Using Nexus - website

2010-08-06 Thread Jörg Schaible
Christian Grobmeier wrote: > Hello, > > I updated the UsingNexus page with some more detailed instructions > (basically merged from our other release procedures. I saw that there > is nothing mentioned on the components website. In the old fashioned > way we included the website to the vote threa

[lang] : Question on Usage of Generics

2010-08-06 Thread Shekhar Gulati
Hello, I have started playing with latest beta release of Commons-Lang 3.0 and I have question on usage of generics in Commons-lang For example, there is a method called toMap in ArrayUtils which could have been easily generified but isn't In Commons-Lang 3.0 public static Map toMap(Object[] a

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
What if we change it to: public static Map toMap(Object[] array) Then, you can use type inference so you don't have to do any casting! On Fri, Aug 6, 2010 at 4:54 PM, Shekhar Gulati wrote: > Hello, > > I have started playing with latest beta release of Commons-Lang 3.0  and I > have question o

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
For instance, this would work: Map map = toMap(new Object[][] { {"red", Color.red}, {"black", Color.black} }); On Fri, Aug 6, 2010 at 6:41 PM, James Carman wrote: > What if we change it to: > > public static Map toMap(Object[] array) > > Then, you can us

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
I went ahead and committed it. If we decide we don't like it, we can back it out, but I wanted to take care of it while I had the code open. On Fri, Aug 6, 2010 at 6:44 PM, James Carman wrote: > For instance, this would work: > > Map map = toMap(new Object[][] { >                {"red", Color.re

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread Sujit Pal
fwiw, this approach would be nicer... I frequently use ArrayUtils.toMap to set maps with different key and value types statically from data. -sujit On Fri, 2010-08-06 at 18:44 -0400, James Carman wrote: > For instance, this would work: > > Map map = toMap(new Object[][] { > {"re

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
It's in there. Enjoy! On Fri, Aug 6, 2010 at 6:55 PM, Sujit Pal wrote: > fwiw, this approach would be nicer... I frequently use ArrayUtils.toMap > to set maps with different key and value types statically from data. > > -sujit > > On Fri, 2010-08-06 at 18:44 -0400, James Carman wrote: >> For ins

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Bill Barker
-- From: "Phil Steitz" Sent: Friday, August 06, 2010 3:34 AM To: "Commons Developers List" Subject: Re: [Math] Usage of "NullPointerException" Gilles Sadowski wrote: The added value that I see is that an IAE designating which argument that can

LogFactory.getLog()

2010-08-06 Thread Doug Bateman
Dear Commons Developers, Here's a suggestion for the commons-logging package... Presently, in Apache Commons, the most common way to get a logger is to do something like: public class MyClass { private static Log log = LogFactory.getLog(MyClass.class); } Notice how MyClass.class (or alterna

Re: LogFactory.getLog()

2010-08-06 Thread Doug Bateman
Correction, the sample is Java 1.1+ compatible. I used a PrintWriter (although I could remove that).

Re: LogFactory.getLog()

2010-08-06 Thread cmaj135
nod cmaj135 2010-08-07 发件人: Doug Bateman 发送时间: 2010-08-07 10:11:35 收件人: Commons Developers List 抄送: 主题: LogFactory.getLog() Dear Commons Developers, Here's a suggestion for the commons-logging package... Presently, in Apache Commons, the most common way to get a logger is to do somethin

Re: LogFactory.getLog()

2010-08-06 Thread James Carman
Attachments don't come through. File a JIRA On Fri, Aug 6, 2010 at 10:11 PM, Doug Bateman wrote: > Dear Commons Developers, > > Here's a suggestion for the commons-logging package... > > Presently, in Apache Commons, the most common way to get a logger is to do > something like: > > public class