tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dietrich Travkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TIKA-2756) Switch to commons-lang 3
Date Wed, 24 Oct 2018 12:03:00 GMT

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

Dietrich Travkin commented on TIKA-2756:
----------------------------------------

We don't need jackcess at all to reproduce the above error. The problem is in the commons-lang
library (and jackcess is dependent on it and could potentially produce the same error... and
tika depends on jackcess).

You can reproduce the problem with the following code
{code:java}
import org.apache.commons.lang.ArrayUtils;

public class RunWithJava11 {

    public static void main(String[] args) {
        String[] array = new String[] {"some Text"};
        String result = ArrayUtils.toString(array);
        System.out.println(result);
    }
}
{code}
and will get the following stacktrace:
{noformat}
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2276)
	at org.apache.commons.lang.builder.ToStringStyle.<clinit>(ToStringStyle.java:94)
	at org.apache.commons.lang.builder.ToStringBuilder.<clinit>(ToStringBuilder.java:98)
	at org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:180)
	at org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:161)
	at TestJava11.main(TestJava11.java:7)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
	at java.base/java.lang.String.substring(String.java:1874)
	at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1153)
	at org.apache.commons.lang.SystemUtils.<clinit>(SystemUtils.java:818)
	... 6 more
{noformat}

> Switch to commons-lang 3
> ------------------------
>
>                 Key: TIKA-2756
>                 URL: https://issues.apache.org/jira/browse/TIKA-2756
>             Project: Tika
>          Issue Type: Improvement
>            Reporter: Robert Munteanu
>            Priority: Major
>
> Tika 1.9.1 is using the legacy commons-lang 2.x series. This series is not going to receive
updates anymore and is completely superseded by commons-lang 3.x .
> Projects that use Tika are blocked from dropping commons-lang 2.x due to this dependency.
> The link that I found was from tika-parsers to jackcess and then to commons-lang 2.6
> {noformat}
> [INFO] +- com.healthmarketscience.jackcess:jackcess:jar:2.1.12:compile
> [INFO] |  \- commons-lang:commons-lang:jar:2.6:compile
> {noformat}
> If I understand correctly, this is the only commons-lang 2.x dependency from the Tika
runtime and it would be great to remove it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message