1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 10:49:41 +02:00

SMACK-534 Refactored all System.out/err and printStackTrace calls with appropriate Java util logging calls.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_4_0@13887 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2014-02-02 22:39:07 +00:00
parent 9bb940da4b
commit 1b651d4939
30 changed files with 189 additions and 183 deletions

View file

@ -34,6 +34,8 @@ import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -41,7 +43,8 @@ import java.util.regex.Pattern;
* A collection of utility methods for String objects.
*/
public class StringUtils {
private static Logger log = Logger.getLogger(StringUtils.class.getName());
/**
* Date format as defined in XEP-0082 - XMPP Date and Time Profiles. The time zone is set to
* UTC.
@ -619,8 +622,7 @@ public class StringUtils {
digest = MessageDigest.getInstance("SHA-1");
}
catch (NoSuchAlgorithmException nsae) {
System.err.println("Failed to load the SHA-1 MessageDigest. " +
"Jive will be unable to function normally.");
log.log(Level.SEVERE, "Failed to load the SHA-1 MessageDigest. Smack will be unable to function normally.", nsae);
}
}
// Now, compute hash.
@ -628,7 +630,7 @@ public class StringUtils {
digest.update(data.getBytes("UTF-8"));
}
catch (UnsupportedEncodingException e) {
System.err.println(e);
log.log(Level.SEVERE, "Error computing hash", e);
}
return encodeHex(digest.digest());
}
@ -664,7 +666,7 @@ public class StringUtils {
bytes = data.getBytes("ISO-8859-1");
}
catch (UnsupportedEncodingException uee) {
uee.printStackTrace();
throw new IllegalStateException(uee);
}
return encodeBase64(bytes);
}