For example, JDK 7 is capable of switch(String) rather than just switch(Number/Enum).
If I wrote a GWT client that has switch(String) in its code, will there be any problems?
switch(String) is one of the issues I can think of. Are there compatibility issues beyond switch(String)?
GWT only officially supports Java 5. It does support a few of Java 6 though, such as allowing
@Overrideson methods implementing an interface method, andString.isEmpty(though that one is about the runtime emulation, so it’s not related to syntax and the compiler).BTW, GWT uses Eclipse JDT for parsing, and that one hasn’t yet been released with support for Java 7 (should come really soon though). Once that’s done, GWT would have to be updated to take into account the new “syntax sugar” added by Java 7. When that time come (which probably won’t come anytime soon, alas), I bet switch-on-strings will be one of the first supported features, given that JavaScript supports it (so it should be as easy to translate from Java to JS as a switch on an integer).
See also https://groups.google.com/d/topic/google-web-toolkit/dM8D9imIvAI/discussion