[jboss-jira] [JBoss JIRA] Resolved: (JGRP-1360) getXXXAddress() protocol methods are annoying
Bela Ban (JIRA)
jira-events at lists.jboss.org
Thu Sep 15 01:38:26 EDT 2011
[ https://issues.jboss.org/browse/JGRP-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bela Ban resolved JGRP-1360.
----------------------------
Resolution: Done
No, it's the only one
> getXXXAddress() protocol methods are annoying
> ---------------------------------------------
>
> Key: JGRP-1360
> URL: https://issues.jboss.org/browse/JGRP-1360
> Project: JGroups
> Issue Type: Enhancement
> Affects Versions: 2.12.1
> Reporter: Paul Ferraro
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 3.0
>
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list