[
https://issues.apache.org/jira/browse/LANG-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18009065#comment-18009065
]
Gary D. Gregory commented on LANG-1779:
---------------------------------------
Or, a local variable or parameter can be typed as a CharSequence if that works
for the rest of the local context.
> How to pick the the non deprecated method removeFirst in
> org.apache.commons.lang3.RegExUtils
> --------------------------------------------------------------------------------------------
>
> Key: LANG-1779
> URL: https://issues.apache.org/jira/browse/LANG-1779
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 3.18.0
> Reporter: Daniel Stieglitz
> Priority: Minor
>
> I am a developer on Apache NIFI and I am trying to replace the use of the now
> deprecated method removeFirst whose first argument is a String and replace it
> with the new method removeFirst whose first argument is a CharSequence. The
> problem I am encountering is the Java compiler always picks methods based on
> specificity which would be the deprecated method whose argument is String
> which is more specific than a CharSequence. Hence I cannot ever use the new
> method. I assume this will also be a problem for the removeAll methods.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)