A boolean Coding Gem

7 PM June 6, 2003

As I’ve mentioned before, I spend days working on a fairly large Java system. The odd piece of code has obviously slipped through code review, probably due to being written the day before a deadline or some such. Today I found this variable declaration:

    boolean isFound = Boolean.TRUE.booleanValue();

I showed a cow-orker, who quipped, “Tell me it’s not true.”

I’m sorry, but it’s as true as boolean can get.

By alang | # | Comments (1)
(Posted to Software Development)

Comments

Add Comment




(Not displayed)






(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)




© 2003-2006 Alan Green