mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-03 07:53:37 +00:00
Fixed a lot of possible issues raised by a code inspection
This commit is contained in:
@@ -9,13 +9,13 @@ public class StringUtil {
|
||||
try {
|
||||
MessageDigest digest = java.security.MessageDigest.getInstance(MD5);
|
||||
digest.update(s.getBytes());
|
||||
byte messageDigest[] = digest.digest();
|
||||
byte[] messageDigest = digest.digest();
|
||||
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
for (byte aMessageDigest : messageDigest) {
|
||||
String h = Integer.toHexString(0xFF & aMessageDigest);
|
||||
StringBuilder h = new StringBuilder(Integer.toHexString(0xFF & aMessageDigest));
|
||||
while (h.length() < 2) {
|
||||
h = "0" + h;
|
||||
h.insert(0, "0");
|
||||
}
|
||||
hexString.append(h);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.tickaroo.tikxml.TypeConverter;
|
||||
public class ErrorCodeConverter implements TypeConverter<ErrorCode> {
|
||||
@Override
|
||||
public ErrorCode read(String value) throws Exception {
|
||||
return new ErrorCode(Integer.valueOf(value));
|
||||
return new ErrorCode(Integer.parseInt(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user