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

Fred Hansen commented on PDFBOX-1684:
-------------------------------------

The r1567840 version of DateConverter ignores the several advances in patch
PDFBOX-1803-Trunk-USETHISONE.patch above.

Why change the "internal" methods to private? Many of them are useful in 
themselves and none retains state, so there is no downside to exposing them. 
With the aid of the "internal" methods, clients may implement date parsers that 
accept a much wider set of dates.

The choice of returning an error date instead of null was made after careful 
deliberation as noted above. The previous note claims, "I've dispensed with the 
IOException and NullPointerException." But NullPointerException _will_ occur 
when programmers fail to test the result for null, as is happening in existing 
code and will continue to happen as long as programmers are human.

Before the work leading up to PDFBOX-1803-Trunk-USETHISONE.patch, the three 
versions of DateConverter were clearly derived from one single source. The 
patch version is upward compatible and should be used instead of the versions 
in xmpbox and jempbox.

All in all, however, I am happy to see a commiter take over DateConverter.
Thank you.


> DateConverter source is in three places and has diverged
> --------------------------------------------------------
>
>                 Key: PDFBOX-1684
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1684
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0.0
>         Environment: Win 8, maven 3.0.5, svn 1.7.8 (r1419691), javac 1.7.0_25
>            Reporter: Fred Hansen
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> Versions of DateConverter,java are in three (3) packages: jempbox.impl, 
> pdfbox.util, and xmpbox. They have diverged as updates have been made to one 
> or the other. 
> Date Converter is used in these modules:
>     jempbox.xmp.ResourceEvent.java
>     jempbox.xmp.XMPSchema.java
>     pdfbox.cos.COSDictionary.java
>     pdfbox.pdmodel.fdf.FDFAnnotation.java
>     preflight.metadata.SynchronizedMetaDataValidation.java
>     xmpbox.type.DateType.java
> The smallest library is xmpbox, so let's consider it as a home for 
> DateConverter. Preflight already imports xmpbox. Pdfbox requires jempbox, so 
> importing xmpbox into jempbox will satisfy both.  Since xmpbox defines some 
> xmp features, it seems likely that jempbox could take further advantage of 
> xmpbox.
> { incorrect: Conclusion and recommendation:  have a single copy of 
> DateConverter in xmpbox. }
> Conclusion: create another top-level pdfbox package for DateConverter and 
> other utilities that do not depend on pdfbox classes.



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

Reply via email to