Bug 63590 - [1.5] Cheetah allows generic throws clause
Summary: [1.5] Cheetah allows generic throws clause
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-23 12:43 EDT by Artur Biesiadowski CLA
Modified: 2005-01-11 11:02 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.