You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2015/06/05 04:46:38 UTC
[jira] [Commented] (TIKA-1233) PDFBox can throw
StringIndexOutOfBoundsException on some dates
[ https://issues.apache.org/jira/browse/TIKA-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14573967#comment-14573967 ]
Hudson commented on TIKA-1233:
------------------------------
SUCCESS: Integrated in tika-trunk-jdk1.7 #730 (See [https://builds.apache.org/job/tika-trunk-jdk1.7/730/])
TIKA-1233 reopened (tallison: http://svn.apache.org/viewvc/tika/trunk/?view=rev&rev=1683656)
* /tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/pdf/PDFParser.java
> PDFBox can throw StringIndexOutOfBoundsException on some dates
> --------------------------------------------------------------
>
> Key: TIKA-1233
> URL: https://issues.apache.org/jira/browse/TIKA-1233
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.5
> Reporter: Tim Allison
> Priority: Trivial
> Labels: easyfix
> Fix For: 1.6
>
>
> PDFBOX's date parser can throw a StringIndexOutOfBoundsException if a date string for parsing is empty or contains only spaces. A few of my test pdfs have this "feature."
> Until PDFBOX-1803 is resolved, we can add an extra catch to prevent this from causing problems in TIKA
> {noformat}
> @@ -171,6 +171,9 @@
> addMetadata(metadata, TikaCoreProperties.CREATED, info.getCreationDate());
> } catch (IOException e) {
> // Invalid date format, just ignore
> + } catch (StringIndexOutOfBoundsException e){
> + //remove after PDFBOX-1883 is fixed
> + // Invalid date format, just ignore
> }
> try {
> Calendar modified = info.getModificationDate();
> @@ -178,6 +181,9 @@
> addMetadata(metadata, TikaCoreProperties.MODIFIED, modified);
> } catch (IOException e) {
> // Invalid date format, just ignore
> + } catch (StringIndexOutOfBoundsException e){
> + //remove after PDFBOX-1883 is fixed
> + // Invalid date format, just ignore
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)