-
Enhancement
-
Resolution: Done
-
Minor
-
2.12.1
-
None
This one has been bothering me for a while. Typically, when an object exposes JavaBean-style methods such as getBindAddress() and setBindAddress(String), one expects a certain level of idempotency. For example:
TP transport;
String address = "127.0.0.1";
transport.setBindAddress(address);
Assert.assertEquals(address, transport.getBindAddress());
However, the assertion fails, because getBindAddress() returns the toString() of the InetAddress composed during setBindAddress(). InetAddress.toString() returns a combination of the host name, and a resolved host address. Therefore, "127.0.0.1" != "/127.0.0.1"
More annoying, however, is the inability to do transport.setBindAddress(transport.getBindAddress()), since the result of getBindAddress() is not a valid address as expected by setBindAddress(String).
It would be great if all the getXXXAddress() methods returned the result of InetAddress.getHostAddress(). 3.0 is a perfect opportunity to make this kind of change.