Tagged Questions
7
votes
2answers
523 views
Check parameters annotated with @Nonnull for null?
We've begun using FindBugs and annotating our parameters with @Nonnull appropriately, and it works great to point out bugs early in the cycle. So far we have continued checking these arguments for ...
4
votes
1answer
188 views
Nulls in every type and checked exceptions in Java?
I know that null being added to every type in Java is a source of much frustration regarding the language's type system. At the same time I generally hear complaining about checked exceptions - that ...
8
votes
9answers
727 views
Should security restrictions cause a service to return null or throw an exception?
I'm in a bit of a disagreement with a more experienced developer on this issue, and wondering what others think about it; our environment is Java, EJB 3, services, etc.
The code I wrote calls a ...
6
votes
7answers
3k views
Best way to handle nulls in Java?
I have some code that is failing because of NullPointerException. A method is being called on the object where the object does not exist.
However, this led me to think about the best way to fix ...