[kaffe] verifier and threads

Helmer Krämer hkraemer@freenet.de
Thu Jan 23 10:11:01 2003


On Tue, 21 Jan 2003 11:13:57 -0700
Patrick Tullmann <tullmann@cs.utah.edu> wrote:

> Helmer wrote:
> > seems like I tracked this one down. The problem was that
> > Class.forName () catched the VerifyError and threw a
> > ClassNotFoundException instead. I've attached a pretty
> > simple patch that should fix this.
> 
> While I admit that's weird to replace one exception with the other I'm
> quite certain it was done for a reason.  Since there aren't any
> comments of note, I'm guessing that the code you removed intentionally
> changed an unchecked Error into a checked Exception, so that users of
> the method would have a chance to deal with it.

Yep, I don't think it was changed without reason either, but

- the api spec states that forName throws a LinkageError and
  VerifyError is a subclass of it

- sun's jdk throws VerifyErrors

- if you simply convert a VerifyError into a ClassNotFoundException
  you can't tell whether the class was not found or whether the
  class was found but contains invalid byte code (or whatever)

- how would you handle a VerifyError? 

Greetings,
Helmer