The Java – GWT compiler ignores method comments
Can you create comments (or otherwise) to force the GWT compiler not to compile methods? I have a class that I also use on App Engine (in a shared folder). One of the methods only needs a server-side function, which makes GWT unable to compile I want GWT to ignore this method (App Engine does not)
I think of a comment or precompiled script that erases the method before compiling Both methods work for me, and it would be best if I could still compile through the eclipse ide
Has anyone thought about this or tried it?
Solution
Until recently, such comments have been added @ com google. gwt. core. shared. Gwtincompatible ("explain why...) Suitable for class or method
But the patch code has not been released! The official status is fixednotreleased And I can personally confirm that this is not the current GWT 2.5 1 version I hope the upcoming 2.5 two
See:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/core/shared/GwtIncompatible.java?spec=svn11570&r=11570
http://code.google.com/p/google-web-toolkit/issues/detail?id=3769
https://gwt-review.googlesource.com/#/c/2320/
Note that a similar comment, com. Com, already exists in gwt-dev.jar google. gwt. thirdparty. guava. common. annotations. Gwtincompatible it doesn't work, and the compiler still wants to compile incompatible methods in shared classes