-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add null check for Cleanup annotation #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👤 steve.klouvi 🕗 Oct 21, 2010 at 15:37 UTC It might be a good feature if code generated for Cleanup annotation does not include a null check. Initialiszation expression may throw an exception , and variable would be null. public class MissingNullCheck {
} BTW, it's a very impressive library ;) |
👤 r.spilker 🕗 Oct 21, 2010 at 15:46 UTC Thanks Steve, I'm not quite sure what your suggestion is and what problem it would solve. Are you saying that currently the statement
If you can give us an example of the problem and what the delomboked code should look like to solve the problem, that would be a great help. Roel |
👤 steve.klouvi 🕗 Oct 21, 2010 at 15:58 UTC Probably my mistake. I think i shouldn't do this in the first place. public class MissingNullCheck {
} |
👤 koen.verrecken 🕗 Oct 29, 2010 at 12:31 UTC Reading a file from the classpath is one such example. When the resource doesn't exist the classloader will return null and the @ Cleanup annotation will throw a NPE: @ Cleanup |
👤 reinierz 🕗 Oct 29, 2010 at 13:47 UTC So, what you are asking for is that instead of generating: try { We should generate: try { right? If so, well, I can't think of any reasons not to do so off the top of my head. Roel? |
👤 r.spilker 🕗 Nov 01, 2010 at 11:54 UTC Great suggestion. |
👤 r.spilker 🕗 Nov 06, 2010 at 23:19 UTC Fixed in 17bcfda. Will be in 0.9.4 "Burning Emu" |
👤 r.spilker 🕗 Nov 06, 2010 at 23:21 UTC |
End of migration |
Migrated from Google Code (issue 154)
The text was updated successfully, but these errors were encountered: