forked from I2P_Developers/i2p.i2p
Findbugs all over #2
Mostly char encoding Use StringWriter rather than OSW->BAOS->String
This commit is contained in:
@ -572,7 +572,7 @@ public class Reseeder {
|
||||
System.err.println("Reseed got no router infos from " + seedURL);
|
||||
return 0;
|
||||
}
|
||||
String content = new String(contentRaw);
|
||||
String content = DataHelper.getUTF8(contentRaw);
|
||||
// This isn't really URLs, but Base64 hashes
|
||||
// but they may include % encoding
|
||||
Set<String> urls = new HashSet<String>(1024);
|
||||
|
@ -442,7 +442,13 @@ class NtpMessage {
|
||||
// or stratum-1 (primary) servers, this is a four-character ASCII
|
||||
// string, left justified and zero padded to 32 bits.
|
||||
if(stratum==0 || stratum==1) {
|
||||
return new String(ref);
|
||||
StringBuilder buf = new StringBuilder(4);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (ref[i] == 0)
|
||||
break;
|
||||
buf.append((char) (ref[i] & 0xff));
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
// In NTP Version 3 secondary servers, this is the 32-bit IPv4
|
||||
|
Reference in New Issue
Block a user