This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI: Patch: java.net: socket stuff


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/




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]