Hi there, I'm trying to update wave to gwt 2.7. There the superdev mode is very improved (among other things).
The mainly problem that I found is this with the new profiling functionality: [ERROR] Errors in '/org/waveprotocol/box/stat/Statistic.java' [ERROR] Line 108: The method getDeclaredFields() is undefined for the type Class<capture#1-of ?> [ERROR] Hint: Your source appears not to live underneath a subpackage called 'client'; no problem, but you'll need to use the <source> directive in your module to make it accessible gwt 2.7 reflection fails with getDeclaredFields. Seems that this package org.waveprotocol.box.stat is shared between server and client, but now fails in client side. Attached a work in progress patch above https://reviews.apache.org/r/28724/ with the failing part commented if someone want to continue this work (maybe akaplanov can give some advice). In this patch, gwt 2.7 compilation and superdev works in the different dev modes (with ant superdev-gwt you can refresh and see you changes in your code with a fast and partial compilation). Note: gwt 2.7 uses asm 5.X so I've added as a dependency. BR, Vicente
diff --git a/.classpath b/.classpath index 824e720..fe0e8b8 100644 --- a/.classpath +++ b/.classpath @@ -84,8 +84,8 @@ <classpathentry kind="lib" path="third_party/runtime/atmosphere-runtime-2.1.0.jar"/> <classpathentry kind="lib" path="third_party/runtime/slf4j-api-1.6.1.jar"/> <classpathentry kind="lib" path="third_party/runtime/slf4j-simple-1.6.1.jar"/> - <classpathentry kind="lib" path="third_party/codegen/gwt-codeserver-2.6.1.jar"/> - <classpathentry kind="lib" path="third_party/codegen/gwt-dev-2.6.1.jar"/> - <classpathentry kind="lib" path="third_party/codegen/gwt-user-2.6.1.jar"/> + <classpathentry kind="lib" path="third_party/codegen/gwt-codeserver-2.7.0.jar"/> + <classpathentry kind="lib" path="third_party/codegen/gwt-dev-2.7.0.jar"/> + <classpathentry kind="lib" path="third_party/codegen/gwt-user-2.7.0.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/build.xml b/build.xml index a6bd9c2..1042054 100644 --- a/build.xml +++ b/build.xml @@ -469,14 +469,15 @@ description="Runs the superdev mode, for debugging the GWT client in a browser."> <java failonerror="true" fork="true" classname="com.google.gwt.dev.codeserver.CodeServer"> <classpath> - <pathelement location="${lib.codegen}/gwt-dev-2.6.1.jar" /> - <pathelement location="${lib.codegen}/gwt-codeserver-2.6.1.jar" /> + <pathelement location="${lib.codegen}/gwt-dev-2.7.0.jar" /> + <pathelement location="${lib.codegen}/gwt-codeserver-2.7.0.jar" /> <pathelement location="${src.dir}"/> <pathelement location="${gen.dir}/messages"/> <path refid="libpath"/> </classpath> <arg line="${gwt.args}"/> <arg line="-src src"/> + <arg line="-launcherDir war"/> <arg value="org.waveprotocol.box.webclient.WebClientDev"/> </java> </target> @@ -499,8 +500,8 @@ <target name="editor-superdev" depends="compile" description="Runs the editor harness through the GWT superdev mode server, for debugging in a browser."> <java failonerror="true" fork="true" classname="com.google.gwt.dev.codeserver.CodeServer"> <classpath> - <pathelement location="${lib.codegen}/gwt-dev-2.6.1.jar" /> - <pathelement location="${lib.codegen}/gwt-codeserver-2.6.1.jar" /> + <pathelement location="${lib.codegen}/gwt-dev-2.7.0.jar" /> + <pathelement location="${lib.codegen}/gwt-codeserver-2.7.0.jar" /> <pathelement location="${src.dir}"/> <path refid="libpath"/> </classpath> @@ -528,8 +529,8 @@ <target name="waveharness-superdev" depends="compile" description="Runs the wave panel harness through the GWT superdev mode server, for debugging in a browser."> <java failonerror="true" fork="true" classname="com.google.gwt.dev.codeserver.CodeServer"> <classpath> - <pathelement location="${lib.codegen}/gwt-dev-2.6.1.jar" /> - <pathelement location="${lib.codegen}/gwt-codeserver-2.6.1.jar" /> + <pathelement location="${lib.codegen}/gwt-dev-2.7.0.jar" /> + <pathelement location="${lib.codegen}/gwt-codeserver-2.7.0.jar" /> <pathelement location="${src.dir}"/> <path refid="libpath"/> </classpath> @@ -976,9 +977,10 @@ <target name="get-third-party-codegen" description="Download code generating third party dependencies"> <get dest="${lib.codegen}" usetimestamp="true" skipexisting="true"> <url url="http://www.antlr3.org/download/antlr-3.2.jar" /> - <url url="http://central.maven.org/maven2/com/google/gwt/gwt-dev/2.6.1/gwt-dev-2.6.1.jar" /> - <url url="http://central.maven.org/maven2/com/google/gwt/gwt-user/2.6.1/gwt-user-2.6.1.jar" /> - <url url="http://central.maven.org/maven2/com/google/gwt/gwt-codeserver/2.6.1/gwt-codeserver-2.6.1.jar" /> + <url url="http://download.forge.objectweb.org/asm/asm-5.0.3.jar" /> + <url url="http://central.maven.org/maven2/com/google/gwt/gwt-dev/2.7.0/gwt-dev-2.7.0.jar" /> + <url url="http://central.maven.org/maven2/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar" /> + <url url="http://central.maven.org/maven2/com/google/gwt/gwt-codeserver/2.7.0/gwt-codeserver-2.7.0.jar" /> <url url="http://repo1.maven.org/maven2/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar" /> <url url="http://repo1.maven.org/maven2/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-sources.jar" /> <url url="https://archive.apache.org/dist/velocity/engine/1.6.3/velocity-1.6.3.jar" /> diff --git a/src/org/waveprotocol/box/stat/Statistic.java b/src/org/waveprotocol/box/stat/Statistic.java index a4d3be3..0fb6bf5 100644 --- a/src/org/waveprotocol/box/stat/Statistic.java +++ b/src/org/waveprotocol/box/stat/Statistic.java @@ -21,7 +21,7 @@ package org.waveprotocol.box.stat; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import java.lang.reflect.Field; +// import java.lang.reflect.Field; import java.util.Collection; import java.util.List; import java.util.logging.Level; @@ -73,29 +73,29 @@ public class Statistic { public abstract String getValue(); } - private static class FieldEntry extends Entry { - final Field field; - final Object ref; +// private static class FieldEntry extends Entry { + // final Field field; + // final Object ref; - FieldEntry(Stat stat, Field field, Object ref) { - super(stat.name(), stat.help()); - this.field = field; - this.ref = ref; - } + //FieldEntry(Stat stat, Field field, Object ref) { + //super(stat.name(), stat.help()); + //this.field = field; + // this.ref = ref; + // } - @Override - public String getValue() { - field.setAccessible(true); - try { - return field.get(ref).toString(); - } catch (IllegalArgumentException e) { - LOG.log(Level.WARNING, "Failed to get field.", e); - } catch (IllegalAccessException e) { - LOG.log(Level.WARNING, "Failed to access field.", e); - } - return ""; - } - } + // @Override + //public String getValue() { + // field.setAccessible(true); + // try { + // return field.get(ref).toString(); +// } catch (IllegalArgumentException e) { + // LOG.log(Level.WARNING, "Failed to get field.", e); + //} catch (IllegalAccessException e) { + // LOG.log(Level.WARNING, "Failed to access field.", e); + // } + // return ""; + // } + //} private static final List<Entry> trackedStats = Lists.newLinkedList(); @@ -105,12 +105,12 @@ public class Statistic { * @param clazz the class type to track. */ public static void trackClass(Class<?> clazz) { - for (Field field : clazz.getDeclaredFields()) { +/* for (Field field : clazz.getDeclaredFields()) { Stat stat = field.getAnnotation(Stat.class); if (stat != null) { trackedStats.add(new FieldEntry(stat, field, null)); } - } + } */ } /** diff --git a/src/org/waveprotocol/wave/client/editor/Editor.gwt.xml b/src/org/waveprotocol/wave/client/editor/Editor.gwt.xml index 24af85f..214b158 100644 --- a/src/org/waveprotocol/wave/client/editor/Editor.gwt.xml +++ b/src/org/waveprotocol/wave/client/editor/Editor.gwt.xml @@ -60,4 +60,7 @@ <!-- collapse all properties to decrease the amount of time spend compiling --> <collapse-all-properties /> + <!-- this also decrease the number of permutations --> + <set-property name="mobile.user.agent" value="not_mobile" /> + </module> diff --git a/src/org/waveprotocol/wave/client/testing/UndercurrentHarness.gwt.xml b/src/org/waveprotocol/wave/client/testing/UndercurrentHarness.gwt.xml index c5d6167..c8bcc25 100644 --- a/src/org/waveprotocol/wave/client/testing/UndercurrentHarness.gwt.xml +++ b/src/org/waveprotocol/wave/client/testing/UndercurrentHarness.gwt.xml @@ -50,4 +50,7 @@ <!-- collapse all properties to decrease the amount of time spend compiling --> <collapse-all-properties /> + <!-- this also decrease the number of permutations --> + <set-property name="mobile.user.agent" value="not_mobile" /> + </module>