[ 
https://issues.apache.org/jira/browse/PDFBOX-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13899983#comment-13899983
 ] 

John Hewson commented on PDFBOX-1803:
-------------------------------------

I took a look at these patches and did a refactoring of DateConverter inspired 
by them, this is in trunk in r1567840. The nice thing about trunk is that it is 
2.0.0 so we can make breaking changes, so I've dispensed with the IOExcepiton 
and NullPointerException.

Most of the methods in DateConverter were only used internally, so I made them 
private and switched their JavaDoc for something more concise. Further 
discussion of refactoring DateConverter should occur in PDFBOX-1684. I'm 
leaving this issue as unresolved until I fix the original null exception in 1.8.

> StringIndexOutOfBound on DateConverter.toCalendar
> -------------------------------------------------
>
>                 Key: PDFBOX-1803
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1803
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel, Utilities
>    Affects Versions: 1.8.3
>            Reporter: Eric Leleu
>            Priority: Minor
>         Attachments: PDFBOX-1803-Trunk-USETHISONE.patch, 
> PDFBOX-1803-Trunk-tba.patch, PDFBOX-DateConverter-1.8-fred.patch, 
> PDFBox-DateConverter-Br18.patch, PDFBox-DateConverter-Trunk.patch
>
>
> Some PDF have an empty string as CreationDate &  ModDate in the Information 
> Dictionary.
> According to the PDF specification, this two element are optional.
> My first fix was to test the null & the empty string in the 
> toCalendar(String, String[]) method and I return null if one of the both 
> condition is verified.
> But according to a test case(TestDateUtil) a NullPointer is expected on null 
> value of text. Can you explain why this behaviour has been adopted?
> To fixe this unexpected exception in my execution path, I have added a test 
> on the empty string in the deprecated method toCalendar(String). (Patch in 
> attachment)
> I'm waiting your comment before commit this patch (or change it by my first 
> implementation)
> BR,
> Eric



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to