OT: Getting the .class of a Java5 generic 2005-12-22 - By Darryl L. Pierce
Back I'm trying to use EasyMock with Java5 on a project. In particular, I'm trying to mock a List of WebForm objects. So I have the following code:
private MockControl<List<WebForm>> controlWebFormList; private List<WebForm> webFormList;
public void setUp() { controlWebFormList = MockControl.createControl(List<WebForm>.class); webFormList = controlWebForm.getMock(); }
However, the compiler complains:
Syntax error on token ">", void expected after this token
How do I get the .class field from a typed generic at compile time?
-- Darryl L. Pierce <mcpierce@(protected)> Homepage: http://mcpierce.multiply.com/ "McVeigh's lawyer got him the death penalty, which, quite frankly, I could have done." - Jon Stewart
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|