[jsyn] VoiceAllocator Compiler Exception
philburk at s...
Thu Jan 3 19:42:02 EST 2002
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.
> 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
> can't remember.
More information about the JSyn