Skip to content

Commit

Permalink
fixed setAdditionalData()
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed May 13, 2006
1 parent 838cca0 commit ce27a1c
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/org/jgroups/stack/IpAddress.java
@@ -1,4 +1,4 @@
// $Id: IpAddress.java,v 1.33 2006/05/13 08:09:38 belaban Exp $
// $Id: IpAddress.java,v 1.34 2006/05/13 08:16:05 belaban Exp $

package org.jgroups.stack;

Expand All @@ -18,7 +18,7 @@
* @author Bela Ban
*/
public class IpAddress implements Address {
private InetAddress ip_addr;
private InetAddress ip_addr=null;
private int port=0;
private byte[] additional_data;
protected static final Log log=LogFactory.getLog(IpAddress.class);
Expand Down Expand Up @@ -105,7 +105,8 @@ public final byte[] getAdditionalData() {
* @param additional_data The additional_data to set
*/
public final void setAdditionalData(byte[] additional_data) {
this.additional_data = additional_data;
this.additional_data=additional_data;
size=-1; // changed May 13 2006 bela (suggested by Bruce Schuchardt)
size=size();
}

Expand Down Expand Up @@ -191,23 +192,6 @@ public String toString() {





/**
* Input: "daddy.nms.fnc.fujitsu.com", output: "daddy". Appends result to string buffer 'sb'.
* @param hostname The hostname in long form. Guaranteed not to be null
* @param sb The string buffer to which the result is to be appended
*/
private static void appendShortName(String hostname, StringBuffer sb) {
if(hostname == null) return;
int index=hostname.indexOf('.');
if(index > 0 && !Character.isDigit(hostname.charAt(0)))
sb.append(hostname.substring(0, index));
else
sb.append(hostname);
}


public void writeExternal(ObjectOutput out) throws IOException {
if(ip_addr != null) {
byte[] address=ip_addr.getAddress();
Expand Down

0 comments on commit ce27a1c

Please sign in to comment.