Bug 63590

Summary: [1.5] Cheetah allows generic throws clause
Product: [Eclipse Project] JDT Reporter: Artur Biesiadowski <abies>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Artur Biesiadowski CLA 2004-05-23 12:43:38 EDT
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...
Comment 1 Philipe Mulet CLA 2004-05-23 16:58:19 EDT
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.
Comment 2 Philipe Mulet CLA 2004-05-23 17:49:52 EDT
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.