modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/KeyStoreCertPrinter.java [340:367]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static String formatBytes(byte[] bytes) {
        int i;
        // The method is expected to format mostly message digest results and
        // the length of the String representing a SHA1 digest printed in
        // the way: "0A:1B:C3:D4:....:E5" is the biggest and is 59.
        StringBuffer buffer = new StringBuffer(59);
        int length;
        String currentByte;
        for (i = 0; i < bytes.length - 1; i++) {
            // TODO: change when String.format(..) method is implemented.
            // buffer.append(String.format("%02X", bytes[i]) + ":");
            currentByte = Integer.toHexString(bytes[i]).toUpperCase();
            if ((length = currentByte.length()) > 1) {
                buffer.append(currentByte.substring(length - 2) + ":");
            } else {
                buffer.append("0" + currentByte + ":");
            }
        }
        // The last byte doesn't need ":" after it ("...:E5:6F")
        // TODO: change in the same way to (String.format(..))
        currentByte = Integer.toHexString(bytes[i]).toUpperCase();
        if ((length = currentByte.length()) > 1) {
            buffer.append(currentByte.substring(length - 2));
        } else {
            buffer.append("0" + currentByte);
        }
        return new String(buffer);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java [340:367]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static String formatBytes(byte[] bytes) {
        int i;
        // The method is expected to format mostly message digest results and
        // the length of the String representing a SHA1 digest printed in
        // the way: "0A:1B:C3:D4:....:E5" is the biggest and is 59.
        StringBuffer buffer = new StringBuffer(59);
        int length;
        String currentByte;
        for (i = 0; i < bytes.length - 1; i++) {
            // TODO: change when String.format(..) method is implemented.
            // buffer.append(String.format("%02X", bytes[i]) + ":");
            currentByte = Integer.toHexString(bytes[i]).toUpperCase();
            if ((length = currentByte.length()) > 1) {
                buffer.append(currentByte.substring(length - 2) + ":");
            } else {
                buffer.append("0" + currentByte + ":");
            }
        }
        // The last byte doesn't need ":" after it ("...:E5:6F")
        // TODO: change in the same way to (String.format(..))
        currentByte = Integer.toHexString(bytes[i]).toUpperCase();
        if ((length = currentByte.length()) > 1) {
            buffer.append(currentByte.substring(length - 2));
        } else {
            buffer.append("0" + currentByte);
        }
        return new String(buffer);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



