I hit a really stupid problem today, and I’ve only got myself to blame (as usual).
The problem was really simple. I was making an object that needed to know when it was created. This creation date wasn’t necessarily “now”, so I was passing a Calendar object in to the constructor of the object to represent the creation date.
Continue reading “Aliasing problems and final member variables”
For Christmas, I (like many geeks and non-geeks around the world) got a copy of the “The Two Towers” boxed set (the 4 disc one). Should my wife ever read this, thanks again for this present.
Continue reading “Refactoring the “The Two Towers””
At the request of a reader, I’ve decided to post some examples on how something like the Employee class described in Allen Holub’s article More on getters and setters could evolve. This may not be the only way, but it certainly is one way.
Continue reading “Examples for “More on getters and setters””
Saw an interesting post while cruising JavaBlogs. Weiqi Gao makes some interesting observations on what will happen to IntelliJ’s IDEA product over the next few years.
Continue reading “Why IntelliJ is becoming more expensive”
Okay, you’ve found my blog. Congratulations. I hope you enjoy it.
Continue reading “Welcome to my blog, and other random musings”
Here’s a technique I sometimes use when I’m doing test-driven development (which is my preferred coding technique). Let’s say I’ve got a bunch of test cases that are all basically the same, but they have slightly different inputs and slightly different outputs. A typical test case might look like this:
Continue reading “JUnit and data-driven tests”