poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48389] New: DateUtil.isADateFormat Replaces Characters Incorrectly
Date Mon, 14 Dec 2009 22:34:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48389

           Summary: DateUtil.isADateFormat Replaces Characters Incorrectly
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: barlock@us.ibm.com


I have an Excel 2003 spreadsheet in which a cell has the custom date format:

yyyy\-mm\-dd\Thh:mm:ss

DateUtil.isaDateFormat trashes this by converting the '\T' to '.'  The problem
is this line of code:

        // And \. into .
        fs = fs.replaceAll("\\\\.",".");

It should be:

        fs = fs.replaceAll("\\\\\\.",".");

The regex parser sees the former as '\\.' which it interprets as backslash
followed by any character.  The regex parser sees the latter as '\\\.' which it
reads as backslash followed by period -- which is what the code wanted to do.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message