Friday Free Stuff* everybody!
official business first.

this is your finger on the pulse of what's new at Sun Microsystems. September 21; 11 a.m. EDT. free admission. sign up for a reminder.
now let's see what we've in terms of a fabulous package of prizes*.

holy cow, (no offense intended) would you look at that! it's a t-shirt, a frisbee, three Java pins, a card that gets you a free ringtone on java.com, a yellow foam java.com mini armchair (don't really get that one), a Java Everywhere button and a Java watch (ladies model; sorry guys)!! full disclosure: minor issue with the watch. but it doesn't keep it from being the singular-must have fashion accessory for the fall.
oh, can you believe it! it's a regular cornucopia, people. one of you lucky* readers is going to get this package of prizes* shipped to your doorstep, gratis.
I was thinking that this week I'd pick the winner* using a centuries-old, tested, rigorous methodology.
But then Click and Hack said they'd officiate!
(See, I'm responsive. Manjunath tells me he wants more meat in this blog. I get all over it.)
Here is your chance to win* the Friday Free Stuff grand prize*... Please join me in savoring this week's puzzler! (Courtesy Click and Hack)
Way back in 1998, a bunch of thread
primitives were
deprecated
because they were unsafe. A particularly heinous example of what could
be done with one of these primitives follows:
public static void sneakyThrow(Throwable t) {
Thread.currentThread().stop(t); // deprecated
}
This nasty little method does exactly
what the throw statement does, except that it completely bypasses all
exception checking by the compiler: You can (sneakily) throw any
exception (checked or otherwise) from any point in your code, and the
compiler won't bat an eyelash.
Now, the puzzler: It turns out that it is still possible to write a functionally equivalent method without using any deprecated methods. In fact, Click and Hack know of two ways to do it, one of which takes advantage of Tiger (JDK 5.0) features. Can you come up with either or both? Extra points if you discover a technique unknown to Click and Hack.
post your answers as comments to this blog. you've got till Tuesday. (Monday is a holiday here in the U.S.)happy Friday, everybody!
mary
* Friday Free Stuff is not a contest. It's me giving away stuff that I personally own to somebody I choose. I pay for shipping with stamps that I buy at the post office. Sun employees can play but are not eligible to win* the prize.*


