Re: [Simple-support] Bug in Persister
Brought to you by:
niallg
|
From: Federico F. <fed...@fi...> - 2007-06-12 11:05:35
|
Marco Vergari ha scritto:
> public <T> T read(Class<? extends T> type, File source) throws Exception {
> FileInputStream fis = new FileInputStream(source); // Patch: Close the
> FileInputStream
> try {
> return (T)read(type, fis);
> } finally {
> fis.close();
> }
> }
>
>
uhhm... IMHO the method should work with the object without changing its
state. That said, read methods that use "raw" inputstream and reader
should leave that stream/reader the way they received it, avoinding to
close it
Instead, read methods that accept String and File should close it, as
they created and opened the corresponding stream/reader
|