Delinquent
Posted by brucechapman on April 9, 2009 at 1:36 AM EDT
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.
Blog Links >>
- Printer-friendly version
- brucechapman's blog
- 739 reads






Comments
by brucechapman - 2009-04-13 16:22
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?). :-{)>by prague_hotel - 2009-04-13 11:49
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. :)