Skip to main content

Delinquent

Posted by brucechapman on April 8, 2009 at 10:36 PM PDT

With computers you can have the joy of delinquency without anyone getting hurt. Delinquency being different to maliciousness of course.

So when I saw that Throwable.initCause() method could throw an IAE if the argument was "this", the delinquent in me saw an opportunity for some harmless fun.

public class TheDevilMadeMeDoIt {
    public static void main(String[] args) {
        Throwable t1 = new Throwable("t1");
        Throwable t2 = new Throwable("t2");
        t1.initCause(t2);
        t2.initCause(t1);
        t1.printStackTrace();
    }
}

I'll leave the result as an exercise.

Comments

Prague_hotel, Once you try it out you'll see that it is something completely different. My code does not generate a IAE (tho' maybe it should?). :-{)>

Unxpected IAE at: java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6307563 Yours seems easier to try out. :)