View | Details | Raw Unified | Return to bug 48113
Collapse All | Expand All

(-)tribes/membership/MemberImpl.java (-1 / +1 lines)
Lines 438-444 Link Here
438
                if (DO_DNS_LOOKUPS)
438
                if (DO_DNS_LOOKUPS)
439
                    this.hostname = java.net.InetAddress.getByAddress(host).getHostName();
439
                    this.hostname = java.net.InetAddress.getByAddress(host).getHostName();
440
                else 
440
                else 
441
                    this.hostname = org.apache.catalina.tribes.util.Arrays.toString(host);
441
                    this.hostname = org.apache.catalina.tribes.util.Arrays.toString(host, true);
442
                return this.hostname;
442
                return this.hostname;
443
            }catch ( IOException x ) {
443
            }catch ( IOException x ) {
444
                throw new RuntimeException("Unable to parse hostname.",x);
444
                throw new RuntimeException("Unable to parse hostname.",x);
(-)tribes/util/Arrays.java (-13 / +22 lines)
Lines 50-66 Link Here
50
        }
50
        }
51
        return match;
51
        return match;
52
    }
52
    }
53
    
53
54
    public static String toString(byte[] data) {
54
    public static String toString(byte[] data) {
55
        return toString(data,0,data!=null?data.length:0);
55
        return toString(data, false);
56
    }
56
    }
57
    
58
    public static String toString(byte[] data, boolean unsigned) {
59
        return toString(data, 0, data != null ? data.length : 0, unsigned);
60
    }
57
61
58
    public static String toString(byte[] data, int offset, int length) {
62
    public static String toString(byte[] data, int offset, int length) {
63
        return toString(data, offset, length, false);
64
    }
65
66
    public static String toString(byte[] data, int offset, int length, boolean unsigned) {
59
        StringBuffer buf = new StringBuffer("{");
67
        StringBuffer buf = new StringBuffer("{");
60
        if ( data != null && length > 0 ) {
68
        if (data != null && length > 0) {
61
            buf.append(data[offset++]);
69
            if (unsigned) {
62
            for (int i = offset; i < length; i++) {
70
                buf.append(data[offset++] & 0xff);
63
                buf.append(", ").append(data[i]);
71
                for (int i = offset; i < length; i++) {
72
                    buf.append(", ").append(data[i] & 0xff);
73
                }
74
            } else {
75
                buf.append(data[offset++]);
76
                for (int i = offset; i < length; i++) {
77
                    buf.append(", ").append(data[i]);
78
                }
64
            }
79
            }
65
        }
80
        }
66
        buf.append("}");
81
        buf.append("}");
Lines 203-210 Link Here
203
        return result;
218
        return result;
204
    }
219
    }
205
220
206
    
207
 
208
    public static byte[] convert(String s) {
221
    public static byte[] convert(String s) {
209
        try {
222
        try {
210
            return s.getBytes("ISO-8859-1");
223
            return s.getBytes("ISO-8859-1");
Lines 213-221 Link Here
213
            return s.getBytes();
226
            return s.getBytes();
214
        }
227
        }
215
    }
228
    }
229
}
216
230
217
218
    
219
    
220
    
221
}

Return to bug 48113