[jsyn] VoiceAllocator Compiler Exception

Phil Burk philburk at s...
Thu Jan 3 19:42:02 EST 2002

Hello Daniel,

Hmmm. I think you are right about it being illegal to throw new Exceptions
from an overriden method. My Java book (Arnold and Gosling) says:

"The overriding method's throws clause can be different from the throws
clause of the superclass's method as long as the throws clause doesn't
declare any types not covered in the original method definition."

I wonder why J++ and the JDK let me get away with it. Luckily SynthException
is now a RuntimeException so I can just remove all the throws declarations.
SynthException only gets thrown if something terrible and unexpected happens
in the native engine like outOfMemory.

Phil Burk

> compile (with jikes). I think you're correct about the compile-time error
> caused by the different signatures in the two constructors. I'm not sure
> 'legal' to override a method(or constructor) w'out keeping the return type
> exceptions the same, or maybe you can remove exceptions, but not add new
ones -
> can't remember.

More information about the JSyn mailing list