This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: FYI: Patch: java.net: socket stuff
- From: Michael Koch <konqueror at gmx dot de>
- To: Mohan Embar <gnustuff at thisiscool dot com>
- Cc: Michael Koch <konqueror at gmx dot de>, Dalibor Topic <robilad at kaffe dot org>, java-patches at gcc dot gnu dot org
- Date: Tue, 25 Nov 2003 17:38:09 +0100
- Subject: Re: FYI: Patch: java.net: socket stuff
- References: <3FC35FC3.3000706@kaffe.org> <4YNKTQGXUNKOK87T95D976GDTPMLHD.3fc36f7a@p733>
On Tue, Nov 25, 2003 at 09:04:26AM -0600, Mohan Embar wrote:
> Hi People,
>
> >I like the patch, though I'm not a gcj developer. I have one small nit
> >to pick, though. Instead of copying
> >
> > if (isClosed())
> > throw new SocketException("socket is closed");
> >
> >so many times, you could have used a private method to do the checking
> >and throwing.
> >
> > checkIfIsClosed();
>
> This is somewhat related to this:
>
> http://gcc.gnu.org/ml/java-patches/2003-q4/msg00425.html
>
> I combined the check into another private variant of getImpl(),
> which could simplify the code even more. I wasn't happy with
> my choice of names, though.
I was very unhappy with this solution. The real code was shorter but imo
it was more difficult to understand. I see no reason to introduce a
method that makes the code more unmaintanable then it already is.
Michael