[ 
https://issues.apache.org/jira/browse/IO-622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb resolved IO-622.
---------------------
    Resolution: Information Provided

There used to be just one readLines method with two parameters:
FileUtils.readLines(File, String encoding)

There are now two such methods:
FileUtils.readLines(File, String)
FileUtils.readLines(File, Charset)

The compiler can no longer determine whether the null parameter is a String, or 
a Charset.

You will have to change the source and recompile.
e.g.
FileUtils.readLines(TestFile, (String) null);

Note that the additional method does not affect binary compatibility.
[The compiled code includes the method signature, so the JVM can find the 
correct method to call.]

> FileUtils.readLines incompatible issue
> --------------------------------------
>
>                 Key: IO-622
>                 URL: https://issues.apache.org/jira/browse/IO-622
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 2.3, 2.4, 2.5, 2.6
>            Reporter: xia0c
>            Priority: Major
>              Labels: performance
>
> Hi,
> The following code snippets throw an incompatible issue when I try to rolling 
> update Commons IO to 2.6. It works well before 2.3.
> {code:java}
> @Test
> public void DemoTest(){
>       List<String> l = new ArrayList();
>       File TestFile = new File("TestFile");
>       try {
>           l.addAll(org.apache.commons.io.FileUtils.readLines(TestFile, null));
>       } catch (IOException e) {
>           e.printStackTrace();
>       }
> }
> {code}
> Thanks a lot.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to