diff options
author | Roel Spilker <r.spilker@gmail.com> | 2011-01-31 23:55:06 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2011-01-31 23:55:06 +0100 |
commit | 95f73048ceb8ecd5ca2ae59d152d8c9101fff596 (patch) | |
tree | 15513a98c378899cda3216d8b7ad52903c5b5e96 /website/features | |
parent | cfbfa178765b6eba85d4360943930e1e73c71cef (diff) | |
download | lombok-95f73048ceb8ecd5ca2ae59d152d8c9101fff596.tar.gz lombok-95f73048ceb8ecd5ca2ae59d152d8c9101fff596.tar.bz2 lombok-95f73048ceb8ecd5ca2ae59d152d8c9101fff596.zip |
Issue 182: Cleanup documentation should include null-check
Diffstat (limited to 'website/features')
-rw-r--r-- | website/features/Cleanup.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/website/features/Cleanup.html b/website/features/Cleanup.html index 2efd6a3a..4ac4d75e 100644 --- a/website/features/Cleanup.html +++ b/website/features/Cleanup.html @@ -43,6 +43,12 @@ <div class="overview"> <h3>Small print</h3><div class="smallprint"> <p> + In the finally block, the cleanup method is only called if the given resource is not <code>null</code>. However, if you use <code>delombok</code> + on the code, a call to <code>lombok.Lombok.preventNullAnalysis(Object o)</code> is inserted to prevent warnings if static code analysis could + determine that a null-check would not be needed. Compilation with <code>lombok.jar</code> on the classpath removes that method call, + so there is no runtime dependency. + </p> + <p> If your code throws an exception, and the cleanup method call that is then triggered also throws an exception, then the original exception is hidden by the exception thrown by the cleanup call. You should <em>not</em> rely on this 'feature'. Preferably, lombok would like to generate code so that, if the main body has thrown an exception, any exception thrown by the close call is silently swallowed (but if the main body |