/**
*******************************************************************************
-* Copyright (C) 1996-2011, International Business Machines Corporation and *
+* Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*
// We drop the collation value into the buffer so if
// we need to do a "front patch" we don't have to
// check to see if we're hitting the last element.
+
+ if (trailingZeroIndex != 0) {
+ trailingZeroIndex = 0;
+ }
+
collateVal = digVal * 10;
m_utilStringBuffer_.setCharAt((digIndx >>> 1) + 2,
(char)((collateVal << 1) + 6));
}
int endIndex = trailingZeroIndex != 0 ? trailingZeroIndex
- : (digIndx >>> 1) + 2;
+ : (digIndx >>> 1) + 2;
+
if (digIndx % 2 != 0){
// We missed a value. Since digIndx isn't even, stuck too many
// values into the buffer (this is what we get for padding the
"\u0663\u0662",
"\u0663\u0663"
};
+
+ //Additional tests to cover bug reported in #9476
+ String lastDigitDifferent[]={"2004","2005",
+ "110005", "110006",
+ "11005", "11006",
+ "100000000005","100000000006"};
// Open our collator.
RuleBasedCollator coll
preZeroTestStrings[j],0);
}
}
+
+ //Testing that the behavior reported in #9476 is fixed
+ //We expect comparisons between adjacent pairs will result in -1
+ for (int i=0; i < lastDigitDifferent.length -1; i=i+2 ) {
+ CollationTest.doTest(this, coll, lastDigitDifferent[i], lastDigitDifferent[i+1], -1);
+ }
+
//cover setNumericCollationDefault, getNumericCollation
assertTrue("The Numeric Collation setting is on", coll.getNumericCollation());