src/java.rmi/share/classes/java/rmi/dgc/VMID.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 107                 if (addr.length != vmid.addr.length)
 108                     return false;
 109                 for (int i = 0; i < addr.length; ++ i)
 110                     if (addr[i] != vmid.addr[i])
 111                         return false;
 112             }
 113             return true;
 114         } else {
 115             return false;
 116         }
 117     }
 118 
 119     /**
 120      * Return string representation of this VMID.
 121      */
 122     public String toString() {
 123         StringBuilder sb = new StringBuilder();
 124         if (addr != null)
 125             for (int i = 0; i < addr.length; ++ i) {
 126                 int x = addr[i] & 0xFF;
 127                 sb.append((x < 0x10 ? "0" : "") +
 128                           Integer.toString(x, 16));
 129             }
 130         sb.append(':');
 131         sb.append(uid.toString());
 132         return sb.toString();
 133     }
 134 }


 107                 if (addr.length != vmid.addr.length)
 108                     return false;
 109                 for (int i = 0; i < addr.length; ++ i)
 110                     if (addr[i] != vmid.addr[i])
 111                         return false;
 112             }
 113             return true;
 114         } else {
 115             return false;
 116         }
 117     }
 118 
 119     /**
 120      * Return string representation of this VMID.
 121      */
 122     public String toString() {
 123         StringBuilder sb = new StringBuilder();
 124         if (addr != null)
 125             for (int i = 0; i < addr.length; ++ i) {
 126                 int x = addr[i] & 0xFF;
 127                 sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16));

 128             }
 129         sb.append(':');
 130         sb.append(uid.toString());
 131         return sb.toString();
 132     }
 133 }