Generic function problem

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Generic function problem

Postby gregors » Tue Nov 25, 2008 2:32 pm

I am running GWT Designer 5.1.0.200810070819 and I am having an issue with a piece of code like this.

Code: Select all
public class Configuration<C extends Configurable>{

static Configuration<Hamburger> hamConifg = ...;
static Configuration<Joystick> joyConfig = ...;

public static <T extends Configurable> Configuration<T> getConfigForType(Class<T> c){
         if( c==Hamburger.class){
           return hamConfig;
         }else if(c==Joystick.class){
           return joyConfig;
         }
         return null;
}

}




It thinks T is an actual type instead of some generic type quantifier. GWT Designer is adding error markers to all places where T exists. The error is something like "T cannot be found in source packages. You may not be inheriting some required module."

This code actually will compile in and run in GWT 1.5. Is there a workaround for this so I don't get the markers?
gregors
 
Posts: 1
Joined: Tue Nov 25, 2008 2:19 pm

Re: Generic function problem

Postby Eric Clayberg » Wed Nov 26, 2008 5:41 am

gregors wrote:I am running GWT Designer 5.1.0.200810070819 and I am having an issue with a piece of code like this.

Please use the latest GWT Designer build. That issue was already addressed more than six weeks ago.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests