Community
Participate
Working Groups
class Alpha<T> extends RuntimeException {} class Beta { public void m() throws Alpha<String> {} } Above code produces error under javac 1.5.0beta1, but compiles fine under cheetah 0.5. To be honest, I'm not sure which behaviour is really correct. I'm also puzzled by both cheetah and javac allowing generic parameters as catch parameter, which is clearly forbidden by spec...
Javac seems to issue a parse error, indicating that their grammar doesn't allow parameterized type in throws clause. I agree that the spec draft did disallow generics in exception handling, but this was just the spec draft. Clearly something to look into some more once specs are finalized.
Aligned on javac since spec will likely be adjusted alike. Disallow use of parameterized types in throws clause and catch blocks. Fixed. Added regression test GenericTypeTest#test207 & test208.