Why was org.apache.common.lang3 StringEscapeUtils deprecated?

前端 未结 4 1181
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 01:53

I couldn\'t find any explanation why StringEscapeUtils was deprecated from Apache Lang3 v3.7.

https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/l

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 02:23

    The class was moved from package

    org.apache.commons.lang3

    to

    org.apache.commons.text

    You can replace the deprecated library easily:

    In your build.gradle:

    implementation 'org.apache.commons:commons-text:1.9'
    

    And in your class using StringEscapeUtils make sure you import the correct class:

    import org.apache.commons.text.StringEscapeUtils;
    

    1.9 is currently the newest version (last checked August 24th 2020) but you can check the versions at maven: https://mvnrepository.com/artifact/org.apache.commons/commons-text

提交回复
热议问题