From 3c3f90ac70d68edf94e7bea5d168262c63fa7298 Mon Sep 17 00:00:00 2001 From: Doug Felt Date: Fri, 28 May 2004 22:55:17 +0000 Subject: [PATCH] ICU-3779 debug clean up X-SVN-Rev: 15629 --- icu4j/src/com/ibm/icu/text/DigitList.java | 63 ++++++++++++----------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/icu4j/src/com/ibm/icu/text/DigitList.java b/icu4j/src/com/ibm/icu/text/DigitList.java index eca092d8ac..5971e40f97 100755 --- a/icu4j/src/com/ibm/icu/text/DigitList.java +++ b/icu4j/src/com/ibm/icu/text/DigitList.java @@ -161,40 +161,43 @@ final class DigitList { */ public BigInteger getBigInteger(boolean isPositive) { if (isZero()) return BigInteger.valueOf(0); -// StringBuffer stringRep = new StringBuffer(count); -// if (!isPositive) { -// stringRep.append('-'); -// } -// for (int i=0; i count) { -// stringRep.append('0'); -// } -// return new BigInteger(stringRep.toString()); - int len = decimalAt > count ? decimalAt : count; - if (!isPositive) { - len += 1; - } - char[] text = new char[len]; - int n = 0; - if (!isPositive) { - text[0] = '-'; - for (int i = 0; i < count; ++i) { - text[i+1] = (char)digits[i]; + if (false) { + StringBuffer stringRep = new StringBuffer(count); + if (!isPositive) { + stringRep.append('-'); } - n = count+1; + for (int i=0; i count) { + stringRep.append('0'); + } + return new BigInteger(stringRep.toString()); } else { - for (int i = 0; i < count; ++i) { - text[i] = (char)digits[i]; + int len = decimalAt > count ? decimalAt : count; + if (!isPositive) { + len += 1; } - n = count; + char[] text = new char[len]; + int n = 0; + if (!isPositive) { + text[0] = '-'; + for (int i = 0; i < count; ++i) { + text[i+1] = (char)digits[i]; + } + n = count+1; + } else { + for (int i = 0; i < count; ++i) { + text[i] = (char)digits[i]; + } + n = count; + } + for (int i = n; i < text.length; ++i) { + text[i] = '0'; + } + return new BigInteger(new String(text)); } - for (int i = n; i < text.length; ++i) { - text[i] = '0'; - } - return new BigInteger(new String(text)); } /**