On Feb 6, 2008 8:25 PM, Stephen Colebourne <[EMAIL PROTECTED]> wrote:
> The following would be binary backwards incompatible:
>
> > FileUtils
> >  - public static void writeStringToFile(File file, CharSequence data,
> > String encoding)
> >    [note CharSequence version replaces String falvour]
>
> > IOUtils
> >  - public static InputStream toInputStream(CharSequence input)
> >  - public static InputStream toInputStream(CharSequence input, String 
> > encoding)
> >  - public static void write(CharSequence data, Writer output)
> >  - public static void write(CharSequence data, OutputStream output)
> >  - public static void write(CharSequence data, OutputStream output,
> > String encoding)
> > [Note CharSequence replaces String and/or StringBuffer flavours]
>
> > So the changes are pretty minimal for IO - question is are these
> > incompatible changes with generics being erased? If not then perhaps
> > we can do this without breaking anything.

OK for the above I added new methods, rather than changing the method
signature - so still compatbile atm:
   http://svn.apache.org/viewvc?view=rev&revision=619188

> All the other changes are binary compatible. Except for the problem that
> the bytecode format for Java 5 is different as well, so you'd need
> retrotranslator to help you out as well.

Anything that depends on a JDK 1.5 IO version will have to also be
minimum JDK 1.5  and therefore direct or indirect users must be
running on JDK 1.5 - so I don't see any need for retrotranslator or
issues for users. Have I missed something?

> In addition to the changes above, you will probably want to change most
> APIs that take in a Collection to take an Iterable instead.

OK I just had a quick scan and it looks we have the following methods
where we could do this:
    FilenameUtils.isExtension()
    FileUtils.convertFileCollectionToFileArray()
    FileUtils.writeLines()
    IOUtils.writeLines()

but this could also be done by just adding new flavours with an
Iterable, rather than changing the existing methods.

> We should probably remove all references to arrays in the public API, as
> generics and arrays work badly together, and I would strongly recommend
> treating arrays as a type not to be exposed on any public API post-Java5.

Perhaps you could expand more on this because I don't see a big issue
for IO - are you thinking along the following lines:

http://www.tbray.org/ongoing/When/200x/2005/06/12/Comparable

or something else?

Niall

> Both these changes would be backwards incompatible.
>
> Finally, we should look to see if we can use the Appendable interface in
> any of our APIs. This may also result in incompatible changes.
>
>
> Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to