mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-15 02:06:00 -07:00
Fixed a lot of possible issues raised by a code inspection
This commit is contained in:
parent
39ff821aee
commit
042bf3077f
76 changed files with 148 additions and 225 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue