[VFS] Exceptions in new file filter code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[VFS] Exceptions in new file filter code

garydgregory
Hi All:

In our new file filters ported from Commons IO, we have code like:

        } catch (final FileSystemException ex) {
            throw new RuntimeException(ex);
        }

I propose instead that we have the accept() methods throw
FileSystemException directly.

Gary
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Exceptions in new file filter code

Otto Fowler
Where these written to be used as lambdas?


On April 19, 2019 at 10:07:28, Gary Gregory ([hidden email]) wrote:

Hi All:

In our new file filters ported from Commons IO, we have code like:

} catch (final FileSystemException ex) {
throw new RuntimeException(ex);
}

I propose instead that we have the accept() methods throw
FileSystemException directly.

Gary
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Exceptions in new file filter code

garydgregory
On Fri, Apr 19, 2019 at 11:38 AM Otto Fowler <[hidden email]>
wrote:

> Where these written to be used as lambdas?
>

They were not. These were written a long time ago as part of Apache Commons
IO and recently ported to VFS.

Gary


>
>
> On April 19, 2019 at 10:07:28, Gary Gregory ([hidden email])
> wrote:
>
> Hi All:
>
> In our new file filters ported from Commons IO, we have code like:
>
> } catch (final FileSystemException ex) {
> throw new RuntimeException(ex);
> }
>
> I propose instead that we have the accept() methods throw
> FileSystemException directly.
>
> Gary
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Exceptions in new file filter code

Otto Fowler
+1 then, from looking at the code, I don’t see why RuntimeException would
be required there.


On April 19, 2019 at 12:38:02, Gary Gregory ([hidden email]) wrote:

On Fri, Apr 19, 2019 at 11:38 AM Otto Fowler <[hidden email]>
wrote:

> Where these written to be used as lambdas?
>

They were not. These were written a long time ago as part of Apache Commons
IO and recently ported to VFS.

Gary


>
>
> On April 19, 2019 at 10:07:28, Gary Gregory ([hidden email])
> wrote:
>
> Hi All:
>
> In our new file filters ported from Commons IO, we have code like:
>
> } catch (final FileSystemException ex) {
> throw new RuntimeException(ex);
> }
>
> I propose instead that we have the accept() methods throw
> FileSystemException directly.
>
> Gary
>