Autoboxing Makes Null Fun!
Technology March 17th, 2007Among the wonderful changes in Java 5 that make code easier to read and maintain (cough) is autoboxing. Consider the following line of code:
return handleIncorrectType(message, modelColumn, o, keyboard);
It was throwing a NullPointerException (not passing one from the underlying method invocation). I had to scratch my head for quite a few minutes to see how it would, as there was no invocation on the parameters that could cause it.
The answer was that one of the parameters was a primitive wrapper type (Boolean) set to a null value, and the autoboxing mechanism punts when coalescing wrapper nulls to primitive types. Fun!
WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 144)]
SELECT * FROM wp_comments WHERE comment_post_ID = '98' AND comment_approved = '1' ORDER BY comment_date

WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 144)]
SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,60) AS com_excerpt FROM wp_comments LEFT OUTER JOIN wp_posts ON (wp_comments.comment_post_ID = wp_posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5Recent Comments