Fun With Generics

I was trying to declare a array variable this morning:

Map<String, String>[] mapArray = new Map<String, String>[2];

However, the compiler reports an error with the above statement: “Cannot create a generic array of Map<String,String>”. I had to replace the statement with:

@SuppressWarnings("unchecked") ... Map<String, String>[] mapArray = (Map<String, String>[]) new Map[2];

!?! If one of the goals of generics was to eliminate casts, it certainly failed here.

Bad Smells

We were working on some refactored code today that wasn’t refactored properly. The tests had been changed to make the refactored code pass. My colleague said that I should write-up my “profound” comment on the situation:

If you’re performing a refactoring and you find yourself changing asserts in existing unit tests, something should smell bad. You’ve probably done something more than refactor the code.

T-Mobile G1/Google Android

I got a G1 on Wednesday and I’m liking it. I’ve had an iPod Touch for over a year now and I’ve liked that, except for the keyboard. The introduction of Apple’s App Store and the revocation of apps from it concerns me. On the G1, I definitely like the keyboard and its ability to switch seamlessly between Wi-Fi, T-Mobile Hotspots (included with the data plan), 3G, and Edge. It’s also a 4-mode phone which means you can take it pretty much anywhere in the world. [Read More]

Ubiquitous Ubiquity

If you haven’t got it yet, go get the Ubiquity plugin for Firefox. This is one of the coolest things I’ve seen in a long time. I think applications should have this kind of feature. Instead of navigating menus, etc. have a shortcut that takes you where you want to go or helps you do a task.