Merge "Fix bug in MacAddress.fromString()"
am: cdb84d2fc7 Change-Id: If4c85f0a5ea259f53f9cffa6eacb58fcde1fd1df
This commit is contained in:
@@ -280,9 +280,8 @@ public final class MacAddress implements Parcelable {
|
||||
throw new IllegalArgumentException(addr + " was not a valid MAC address");
|
||||
}
|
||||
long longAddr = 0;
|
||||
int index = ETHER_ADDR_LEN;
|
||||
while (index-- > 0) {
|
||||
int x = Integer.valueOf(parts[index], 16);
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
int x = Integer.valueOf(parts[i], 16);
|
||||
if (x < 0 || 0xff < x) {
|
||||
throw new IllegalArgumentException(addr + "was not a valid MAC address");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user