Top.Mail.Ru
February 27th, 2004 - Java developers — LiveJournal
? ?

Java developers

February 27th, 2004

10:20 pm - dplass - Static exceptions

What do y'all think of this code:

public class Foo
{
 private static final Exception bad;

 static 
 {
   bad = new Exception();
 }

 public void amethod() throws Exception
 {
    throw bad;
 }
}


I though this was REALLY weird. Would'n't it screw up the call stack to throw an exception that is statically allocated?
Powered by LiveJournal.com