[jitsi-dev] Re: PATCH avoid exception if command file not found


#1

OK so here's another patch that logs a message if the command isn't found.
Anyway, if you think that the try/catch clause is better/enough then let it be.
Thanks!

Vieri

CommandNotificationHandlerImpl.java.diff (620 Bytes)

···

--- On Fri, 3/15/13, Lyubomir Marinov <lyubomir.marinov@jitsi.org> wrote:

From: Lyubomir Marinov <lyubomir.marinov@jitsi.org>
Subject: [jitsi-dev] Re: PATCH avoid exception if command file not found
To: dev@jitsi.java.net
Date: Friday, March 15, 2013, 6:16 AM
2013/3/15 Vieri <rentorbuy@yahoo.com>:
> Simple patch to avoid exception when command file not
found.

Your patch may prevent the IOException but it also fails to
log an
error/warning message that the command file does not exist.

> I still don't know why the try/catch doesn't avoid it
but anyway this patch seems to solve the issue.

The catch does not "avoid" the IOException but it handles it
and logs
an error message and the stack trace. Moreover, the
IOException's
message contains additional information about the cause.

Overall, I think the patch in its current form should not be
committed.


#2

I don't believe that the patch and trunk are functionally equivalent
in terms of the number of commands that they are capable to execute.
The documentation on Runtime.exec states that the resolution of the
commands is system-dependent while the patch dictates that commands
should resolve as ordinary files by the rules of the File class. What
about commands which are located by the system via the PATH
environment variable?


#3

OK, good point.

Vieri

···

--- On Fri, 3/15/13, Lyubomir Marinov <lyubomir.marinov@jitsi.org> wrote:

What
about commands which are located by the system via the PATH
environment variable?


#4

true, this can only be handeled in the catch clause...

···

Am 15.03.2013 12:43, schrieb Lyubomir Marinov:

I don't believe that the patch and trunk are functionally equivalent
in terms of the number of commands that they are capable to execute.
The documentation on Runtime.exec states that the resolution of the
commands is system-dependent while the patch dictates that commands
should resolve as ordinary files by the rules of the File class. What
about commands which are located by the system via the PATH
environment variable?