[jboss-jira] [JBoss JIRA] (DROOLS-764) Delete the dependency to commons-lang 2 in all poms in Drools and jBPM (use commons-lang 3 instead)

Michael Biarnes Kiefer (JIRA) issues at jboss.org
Wed Jan 25 11:25:00 EST 2017


    [ https://issues.jboss.org/browse/DROOLS-764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13353538#comment-13353538 ] 

Michael Biarnes Kiefer commented on DROOLS-764:
-----------------------------------------------

I upgraded 
guvnor-ala/guvnor-ala-spi/src/main/java/org/guvnor/ala/util/VariableInterpolation.java

Import org.apache.commons.lang.text.StrLookup to Import org.apache.commons.lang3.text.StrLookup
Import org.apache.commons.lang.text.StrSubstitutor to Import org.apache.commons.lang3.text.StrLookup

but I got this error: https://gist.github.com/mbiarnes/659fa0db8a4db1de3f1e280ef8c435e7

Lookng in Idea I saw that the classes org.apache.commons.lang.text.StrLookup and org.apache.commons.lang3.text.StrLookup are different.
So org.apache.commons.lang.text.StrSubstitutor and org.apache.commons.lang3.text.StrLookup.

> Delete the dependency to commons-lang 2 in all poms in Drools and jBPM (use commons-lang 3 instead)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-764
>                 URL: https://issues.jboss.org/browse/DROOLS-764
>             Project: Drools
>          Issue Type: Task
>            Reporter: Geoffrey De Smet
>            Assignee: Michael Biarnes Kiefer
>            Priority: Minor
>
> Make an inventory of all modules that still use commons-lang and ask their owners to replace the commons-lang 2 usage with commons-lang 3.
> See recipe below how they can quickly do that.
> Once all our modules are upgraded, see if we can remove the commons-lang 2 dependency as much as possible (including the ip-bom hopefully).
> {code}
> Currently we have commons-lang 2.6 and 3.1 in our classpath
> (which is not a problem because they use a different package namespace).
> Nevertheless, having it twice doesn't look good
> and 2.6 might miss security fixes.
> Luckily upgrading is easy (it took me 15 minutes for optaplanner):
> 1) Replace:
>     <dependency>
>       <groupId>commons-lang</groupId>
>       <artifactId>commons-lang</artifactId>
>     </dependency>
> with
>     <dependency>
>       <groupId>org.apache.commons</groupId>
>       <artifactId>commons-lang3</artifactId>
>     </dependency>
> (Both are already in the ip-bom, so no need to worry about <version>)
> 2) Replace "import org.apache.commons.lang."
> with "import org.apache.commons.lang3."
> I had about 170 occurrences.
> 3) Compile. If you have a compile error, look for that class on:
>   https://commons.apache.org/proper/commons-lang/article3_0.html
> I only had 1 error. Replacing "StringEscapeUtils.escapeHtml(s)"
> with "StringEscapeUtils.ESCAPE_HTML4.translate(s)" fixed that.
> {code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list