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

Dominik Reinarz commented on IO-773:
------------------------------------

Passing a serializable lambda should work with 2.12.0?

if I use RegexFileFilter(pattern, (Function<Path, String> & Serializable) p -> 
p.getFileName().toString()):

java.lang.ClassCastException: cannot assign instance of 
java.lang.invoke.SerializedLambda to field 
org.apache.commons.io.filefilter.RegexFileFilter.pathToString of type 
java.util.function.Function in instance of 
org.apache.commons.io.filefilter.RegexFileFilter
    at java.base/java.io.ObjectStreamClass$FieldReflector.setObjFieldValues

also see https://mail.openjdk.org/pipermail/core-libs-dev/2019-March/059283.html

> RegexFileFilter is no longer Serializable
> -----------------------------------------
>
>                 Key: IO-773
>                 URL: https://issues.apache.org/jira/browse/IO-773
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.10.0, 2.11.0
>            Reporter: Dominik Reinarz
>            Priority: Major
>             Fix For: 2.12.0
>
>
> org.apache.commons.io.filefilter.RegexFileFilter cannot be serialized b/c 
> org.apache.commons.io.filefilter.RegexFileFilter.pathToString Function



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to