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: Mohan Embar <gnustuff at thisiscool dot com>
- To: Dalibor Topic <robilad at kaffe dot org>
- Cc: Michael Koch <konqueror at gmx dot de>, java-patches at gcc dot gnu dot org
- Date: Wed, 26 Nov 2003 11:32:02 -0600
- Subject: Re: FYI: Patch: java.net: socket stuff
- Reply-to: gnustuff at thisiscool dot com
Hi Dalibor,
>You could just move the exception messages to their own static inner
>class of SocketException (SocketException.Message) with package access
>for now. So it would become:
>
>throw new SocketException(SocketException.Message.CLOSED);
>
>though maybe simply having an interface in gnu/java/net/Messages would
>be better. Then, one fine day, when someone localizes libgcj, they can
>use a ResourceBundle scheme to initialize the constants in
>gnu/java/net/Messages, et voila, instant localization. Or spelling
>fixes. Or whatever you have.
>
>I think your patch would have a point. Nameless constants are bad,
>nameless redundant constants are worse. The way to fix that is to give
>the nameless constants a name, and delegate access to them to the single
>instance, in my opinion.
I agree with you, but what is the best way to do this in this particular case?
If we go the route of a static inner class or interface, we'd be arbitrarily
special-casing one thing and sort of ignoring the other stuff. A helper method
would be an easy way of delegating access to one place without introducing
subsystem-specific localization helper mechanisms to accomplish this.
Like I said, though, I'm not losing too much sleep over this. Michael's duplicated
code will probably be the least of the worries of whatever brave soul attempts
to localize libgcj....
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/