Cleanup exception handling
commitdf3a5f95efbf58451ed316c02516ceb50025ef99
authorJonas Fonseca <fonseca@diku.dk>
Thu, 30 Aug 2007 17:31:57 +0000 (30 19:31 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 30 Aug 2007 17:36:40 +0000 (30 19:36 +0200)
tree71a51408c3d2b6f33e0fba6e71d44481472411ad
parent7ddf50b27232e71a828d90b17ade67b61ab2f0e5
Cleanup exception handling

This changes the server side code not to save an exception and
rethrow it in the "finally" block. The "finally" block is
guaranteed to always run regardless of wether the exception
is temporarily held back. So instead of doing:

Exception ex = null;
try {
/* main code */
} catch (Exception e) {
ex = e;
} finally {
/* cleanup code */
if (ex != null)
throw ex;
}

we now do:

try {
/* main code */
} finally {
/* cleanup code */
}
src/authentication/AbstractAuthenticator.java
src/authentication/Authenticator.java
src/moteaccess/AbstractMoteAccess.java
src/motedata/MoteData.java