You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Yauheni Salopiy (JIRA)" <ji...@apache.org> on 2015/03/26 16:04:54 UTC

[jira] [Commented] (TIKA-1512) WordParser fails on many Word files

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

Yauheni Salopiy commented on TIKA-1512:
---------------------------------------

Hi,

I guess I found the cause of this error.
It's failing here (bold font):

         if((text.startsWith("HYPERLINK") || text.startsWith(" HYPERLINK"))
                 && text.indexOf('"') > -1) {
             *String url = text.substring(
                   text.indexOf('"') + 1,
                   text.lastIndexOf('"')*
             );
             xhtml.startElement("a", "href", url);
             for(CharacterRun cr : texts) {
                handleCharacterRun(cr, skipStyling, xhtml);
             }
             xhtml.endElement("a");
          } else {
            ...
          }

I have a number of such failing docs and some of hyperlinks looks like this:

HYPERLINK "http://www.accountingresearchmanager.com/wk/rm.nsf/0/7C2AE86AEDF358A1652577740025E00A?OpenDocument”      (last quote *inclined*)
That's why we have here java.lang.*StringIndexOutOfBoundsException: String index out of range: -1*

I'm not sure whether such quotes are correct and is this content or code issue.

Best Regards,
Yauheni Salopiy

> WordParser fails on many Word files
> -----------------------------------
>
>                 Key: TIKA-1512
>                 URL: https://issues.apache.org/jira/browse/TIKA-1512
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.5, 1.6, 1.7, 1.8
>         Environment: Linux 64bit
> OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-x86_64)
> OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
> and
> java version "1.6.0"
> Java(TM) SE Runtime Environment
> IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 (JIT enabled, AOT enabled)
>            Reporter: F Seid
>            Assignee: Jukka Zitting
>
> WordParser fail on some word files. A negative value is sent to substring



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)