Bugzilla 53369 fixed TestCellFormatPart.testDateFormat failing on jdk 1.7

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1364058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2012-07-21 10:08:07 +00:00
parent 681d7bd1b8
commit 00831d3c5b
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,7 @@
<changes>
<release version="3.9-beta1" date="2012-??-??">
<action dev="poi-developers" type="fix">53369 - Fixed tests failing on JDK 1.7</action>
<action dev="poi-developers" type="fix">53360 - Fixed SXSSF to correctly write text before escaped Unicode control character</action>
<action dev="poi-developers" type="add">Change HSMF Types to have full data on ID, Name and Length, rather than just being a simple ID</action>
<action dev="poi-developers" type="add">48469 - Updated case study</action>

View File

@ -150,7 +150,10 @@ public class CellDateFormatter extends CellFormatter {
StringBuffer descBuf = CellFormatPart.parseFormat(format,
CellFormatType.DATE, partHandler);
partHandler.finish(descBuf);
dateFmt = new SimpleDateFormat(descBuf.toString());
// tweak the format pattern to pass tests on JDK 1.7,
// See https://issues.apache.org/bugzilla/show_bug.cgi?id=53369
String ptrn = descBuf.toString().replaceAll("((y)(?!y))(?<!yy)", "yy");
dateFmt = new SimpleDateFormat(ptrn, LOCALE);
}
/** {@inheritDoc} */