classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.lang.Class.newinstance(): exceptions; desired behavior?


From: Steven Augart
Subject: Re: java.lang.Class.newinstance(): exceptions; desired behavior?
Date: Fri, 24 Sep 2004 17:14:46 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Jeroen Frijters wrote:
Steven Augart wrote:

It is now the documented behaviour as of JDK 1.5.0rc1. (And it is *really annoying* to implement in a VM written in Java, like Jikes RVM).


A while ago it occurred to me that Thread.stop(Throwable) can also be
used to throw arbitrary exceptions (on the current thread). It's
deprecated of course, but Sun still supports it (as of JDK 1.5.0-rc).

BTW, I'm curious, why is it hard to implement VMClass.throwException on
JikesRVM?

I was wrong. I'd forgotten about a back door (our VM_Runtime.athrow method).

Of course, if Class.newInstance were properly declared (as throwing any Throwable) then I wouldn't have had to use VM_Runtime.athrow; implementing VMClass.throwException would have just been a matter of using the "throw" statement.

--Steve Augart

--
Steven Augart

Jikes RVM, a free, open source, Virtual Machine:
http://oss.software.ibm.com/jikesrvm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]