How do you handle the following scenario without null? You have this problem (In Java): BigDecimal sales = ...; BigDecimal cost = ...; BigDecimal profit = sales.subtract(cost); // Profit Margin = ...
Related to this question i want to know if there is a concise way to eleminate null values out of code in general or if there is not. E.g. imagine a class that represents a user with birthday as ...
Why didn't Java designers create static versions of string manipulation methods in the java.lang.String class? The following methods are what I refer to, but the question can be extended to other ...
Background Tony Hoare's billion dollar mistake was the invention of null. Subsequently, a lot of code has become riddled with null pointer exceptions (segfaults) when software developers try to use ...
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 ...
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 ...
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 ...
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 ...