[gwt-contrib] Re: Fix the escaping done by UrlBuilder. (issue754803)
I don't quite understand what this change in RemoteServiceServlet has to do with UrlBuilder... http://gwt-code-reviews.appspot.com/754803/diff/21001/22002 File user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java (right): http://gwt-code-reviews.appspot.com/754803/diff/21001/22002#newcode79 user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java:79: String contextRelativePath = URLDecoder.decode(modulePath.substring(contextPath.length())); Beware! URLDecoder will decode + into a space, whereas it might really mean a +. What I mean is that this is probably a breaking change. http://gwt-code-reviews.appspot.com/754803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
Okay, so here's my main issue with the general idea. As far as I can tell, the lifetime of the 'storage' is the same as the lifetime of generator instances. I sort of see how it's expedient to have it accessible via GeneratorContext... however, the downside is you give up static typing and red squiggleys if you try to lookup something that isn't there. Net-net, I'm not sure we want to add more methods to support, that don't really buy anything. Instead of passing GeneratorContext's everywhere, any Generator subsystem could pass around a strongly-typed thing instead; or even extend GeneratorContext and add a couple of strongly-typed getters. http://gwt-code-reviews.appspot.com/826802/diff/3001/4001 File dev/core/src/com/google/gwt/core/ext/GeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4001#newcode88 dev/core/src/com/google/gwt/core/ext/GeneratorContext.java:88: * com / google / gwt / core / client / Foo.properties/code would be exposed Formatter hates you. http://gwt-code-reviews.appspot.com/826802/diff/3001/4002 File dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4002#newcode502 dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java:502: return 0; Thought you'd already committed this. :) http://gwt-code-reviews.appspot.com/826802/diff/3001/4004 File dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4004#newcode251 dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java:251: private final MapString, Object storage = new HashMapString, Object(); As far as I can tell, lifetime of this map should be exactly the same as the lifetime of generators, right? http://gwt-code-reviews.appspot.com/826802/diff/3001/4004#newcode272 dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java:272: generators.clear(); For sure you want to storage.clear() here. http://gwt-code-reviews.appspot.com/826802/diff/3001/4005 File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java (left): http://gwt-code-reviews.appspot.com/826802/diff/3001/4005#oldcode486 dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:486: Memory.maybeDumpMemory(GoldenCudsBuilt); You've verified that the i18n cached state gets cleared here? http://gwt-code-reviews.appspot.com/826802/diff/3001/4009 File user/src/com/google/gwt/i18n/rebind/AnnotationsResource.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4009#newcode413 user/src/com/google/gwt/i18n/rebind/AnnotationsResource.java:413: throws AnnotationsError { No real changes in this file. http://gwt-code-reviews.appspot.com/826802/diff/3001/4017 File user/src/com/google/gwt/i18n/rebind/ResourceFactory.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4017#newcode84 user/src/com/google/gwt/i18n/rebind/ResourceFactory.java:84: String key = ResourceFactory.classLocale(clazz, locale); By the way, there's a class you could use here that might interest you: com.google.gwt.dev.util.StringKey. http://gwt-code-reviews.appspot.com/826802/diff/3001/4017#newcode112 user/src/com/google/gwt/i18n/rebind/ResourceFactory.java:112: Extra space http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add SafeHtml support to ui widgets. (issue829801)
http://gwt-code-reviews.appspot.com/829801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a strange compiler bug where types generated into new packages may not be found. (issue831802)
lgtm http://gwt-code-reviews.appspot.com/831802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8697 committed - Remove the unnecessary dependency of the expenses sample on AspectJ....
Revision: 8697 Author: amitman...@google.com Date: Thu Sep 2 04:06:39 2010 Log: Remove the unnecessary dependency of the expenses sample on AspectJ. Patch by: amitmanjhi Review by: rjrjr (tbr) http://code.google.com/p/google-web-toolkit/source/detail?r=8697 Modified: /trunk/samples/expenses/pom.xml === --- /trunk/samples/expenses/pom.xml Wed Sep 1 14:06:25 2010 +++ /trunk/samples/expenses/pom.xml Thu Sep 2 04:06:39 2010 @@ -9,7 +9,6 @@ properties roo.version1.1.0.M2/roo.version spring.version3.0.3.RELEASE/spring.version - aspectj.version1.6.10.M1/aspectj.version slf4j.version1.6.1/slf4j.version gae.version1.3.4/gae.version gae-test.version1.3.4/gae-test.version @@ -98,11 +97,6 @@ version${slf4j.version}/version /dependency dependency - groupIdorg.aspectj/groupId - artifactIdaspectjrt/artifactId - version${aspectj.version}/version - /dependency - dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version @@ -464,43 +458,6 @@ /configuration /plugin plugin - groupIdorg.codehaus.mojo/groupId - artifactIdaspectj-maven-plugin/artifactId - version1.0/version - dependencies - !-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -- - dependency - groupIdorg.aspectj/groupId - artifactIdaspectjrt/artifactId - version${aspectj.version}/version - /dependency - dependency - groupIdorg.aspectj/groupId - artifactIdaspectjtools/artifactId - version${aspectj.version}/version - /dependency - /dependencies - executions - execution - goals - goalcompile/goal - goaltest-compile/goal - /goals - /execution - /executions - configuration - outxmltrue/outxml - aspectLibraries - aspectLibrary - groupIdorg.springframework/groupId - artifactIdspring-aspects/artifactId - /aspectLibrary - /aspectLibraries - source1.6/source - target1.6/target - /configuration - /plugin - plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-resources-plugin/artifactId version2.4.2/version -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
On 2010/09/02 13:44:49, scottb wrote: Okay, so here's my main issue with the general idea. As far as I can tell, the lifetime of the 'storage' is the same as the lifetime of generator instances. I thought we agreed after discussing the previous patch for this that the GeneratorContext was the right lifetime cycle for these caches? I sort of see how it's expedient to have it accessible via GeneratorContext... however, the downside is you give up static typing and red squiggleys if you try to lookup something that isn't there. Net-net, I'm not sure we want to add more methods to support, that don't really buy anything. Instead of passing GeneratorContext's everywhere, any Generator subsystem could pass around a strongly-typed thing instead; or even extend GeneratorContext and add a couple of strongly-typed getters. It's unclear to me from your suggestions how to get the same lifetime for the caches. If the generators themselves hold onto them, then they won't survive across different instances of the generator in the same ModuleSpace. http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add SafeHtml support to ui widgets. (issue829801)
http://gwt-code-reviews.appspot.com/829801/diff/7001/8002 File user/src/com/google/gwt/user/User.gwt.xml (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8002#newcode51 user/src/com/google/gwt/user/User.gwt.xml:51: inherits name=com.google.gwt.safehtml.SafeHtml / Maybe alphabetize? http://gwt-code-reviews.appspot.com/829801/diff/7001/8004 File user/src/com/google/gwt/user/client/ui/CheckBox.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8004#newcode70 user/src/com/google/gwt/user/client/ui/CheckBox.java:70: * Creates a check box with the specified text label. text - html or safe html http://gwt-code-reviews.appspot.com/829801/diff/7001/8005 File user/src/com/google/gwt/user/client/ui/HTML.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode45 user/src/com/google/gwt/user/client/ui/HTML.java:45: public class HTML extends Label implements HasDirectionalSafeHtml { Do you mean to remove HasDirectionalHTML? In general, changes to interfaces can cause a lot of compatibility problems -- is there a strategy on how to deprecate the raw HTML interfaces without breaking all users at once? http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode85 user/src/com/google/gwt/user/client/ui/HTML.java:85: setHTML(html.asString()); Shouldn't this call some variant of setSafeHtml? http://gwt-code-reviews.appspot.com/829801/diff/7001/8010 File user/src/com/google/gwt/user/client/ui/MenuItem.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8010#newcode42 user/src/com/google/gwt/user/client/ui/MenuItem.java:42: * Similar to {...@link #MenuItem(String, boolean)} Maybe change this to: Similar to {...@link #MenuItem(String, boolean) MenuItem(String, true)} to indicate that the effect is like setting the flag to true http://gwt-code-reviews.appspot.com/829801/diff/7001/8010#newcode227 user/src/com/google/gwt/user/client/ui/MenuItem.java:227: Spaces http://gwt-code-reviews.appspot.com/829801/diff/7001/8010#newcode231 user/src/com/google/gwt/user/client/ui/MenuItem.java:231: Spaces http://gwt-code-reviews.appspot.com/829801/diff/7001/8010#newcode253 user/src/com/google/gwt/user/client/ui/MenuItem.java:253: Spaces http://gwt-code-reviews.appspot.com/829801/diff/7001/8011 File user/src/com/google/gwt/user/client/ui/RadioButton.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8011#newcode77 user/src/com/google/gwt/user/client/ui/RadioButton.java:77: * @param label this radio button's label as SafeHtml http://gwt-code-reviews.appspot.com/829801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
http://gwt-code-reviews.appspot.com/826802/diff/3001/4001 File dev/core/src/com/google/gwt/core/ext/GeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4001#newcode88 dev/core/src/com/google/gwt/core/ext/GeneratorContext.java:88: * com / google / gwt / core / client / Foo.properties/code would be exposed On 2010/09/02 13:44:49, scottb wrote: Formatter hates you. i hate it. i have followed the README exactly. this is either another formatter bug or this file wasn't formatter properly before. http://gwt-code-reviews.appspot.com/826802/diff/3001/4002 File dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4002#newcode502 dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java:502: return 0; On 2010/09/02 13:44:49, scottb wrote: Thought you'd already committed this. :) Nope. This and a couple other changes were pulled in from the old approach. http://gwt-code-reviews.appspot.com/826802/diff/3001/4004 File dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4004#newcode251 dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java:251: private final MapString, Object storage = new HashMapString, Object(); On 2010/09/02 13:44:49, scottb wrote: As far as I can tell, lifetime of this map should be exactly the same as the lifetime of generators, right? More concretely, it looks like it's tied to the ModuleSpace. http://gwt-code-reviews.appspot.com/826802/diff/3001/4005 File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java (left): http://gwt-code-reviews.appspot.com/826802/diff/3001/4005#oldcode486 dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:486: Memory.maybeDumpMemory(GoldenCudsBuilt); On 2010/09/02 13:44:49, scottb wrote: You've verified that the i18n cached state gets cleared here? There are two components that were getting cleared via this hack. The ResourceFactory is addressed in this patch. The LocaleUtils I also address, but you may note that there is now now clearing of the GwtLocaleFactoryImpl. jat says that the GwtLocaleFactoryImpl was needlessly being cleared and recreated as it does not change between loads and is safe to share. http://gwt-code-reviews.appspot.com/826802/diff/3001/4009 File user/src/com/google/gwt/i18n/rebind/AnnotationsResource.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4009#newcode413 user/src/com/google/gwt/i18n/rebind/AnnotationsResource.java:413: throws AnnotationsError { On 2010/09/02 13:44:49, scottb wrote: No real changes in this file. i had some changes earlier but nuked them. formatter hates me. http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a strange compiler bug where types generated into new packages may not be found. (issue831802)
http://gwt-code-reviews.appspot.com/831802/diff/5001/3004 File dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java (right): http://gwt-code-reviews.appspot.com/831802/diff/5001/3004#newcode257 dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java:257: } Are we going to need to loop here like we do with optimizers? Couldn't additional types found with rebinds lead to further discovery of new types with JSNI? Or maybe just run the doFindAdditionalTypesUsingJsni one more time (in case the generator creates more JSNI) http://gwt-code-reviews.appspot.com/831802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a strange compiler bug where types generated into new packages may not be found. (issue831802)
http://gwt-code-reviews.appspot.com/831802/diff/5001/3004 File dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java (right): http://gwt-code-reviews.appspot.com/831802/diff/5001/3004#newcode257 dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java:257: } The short answer is no: the looping behavior is intrinsic in how we interact with JDT. Once we add the new types (as source), then once they get compiled by JDT we will visit the compiled units and look for more rebinds and jsni, iteratively. I did the reordering here because only Rebinds can actually generate any new types that weren't in CompilationState before. JSNI can only reference existing type. http://gwt-code-reviews.appspot.com/831802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a strange compiler bug where types generated into new packages may not be found. (issue831802)
LGTM2 On Thu, Sep 2, 2010 at 11:30 AM, sco...@google.com wrote: http://gwt-code-reviews.appspot.com/831802/diff/5001/3004 File dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java (right): http://gwt-code-reviews.appspot.com/831802/diff/5001/3004#newcode257 dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java:257: } The short answer is no: the looping behavior is intrinsic in how we interact with JDT. Once we add the new types (as source), then once they get compiled by JDT we will visit the compiled units and look for more rebinds and jsni, iteratively. I did the reordering here because only Rebinds can actually generate any new types that weren't in CompilationState before. JSNI can only reference existing type. http://gwt-code-reviews.appspot.com/831802/show -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8698 committed - Fixes a strange compiler bug where types generated into new packages m...
Revision: 8698 Author: sco...@google.com Date: Thu Sep 2 05:59:40 2010 Log: Fixes a strange compiler bug where types generated into new packages may not be found. The bug happened to me when generating types into a package which didn't exist on disk, in this com.google.gwt.user.client.rpc.core.java.lang.annotation. The WebModeCompiler thought the types didn't exist. This fix makes it so that newly-generated types get packages added immediately. http://gwt-code-reviews.appspot.com/831802/show http://code.google.com/p/google-web-toolkit/source/detail?r=8698 Modified: /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java === --- /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java Wed Aug 18 11:56:28 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java Thu Sep 2 05:59:40 2010 @@ -246,12 +246,15 @@ String[] typeNames = outer.doFindAdditionalTypesUsingJsni(branch, unit); addAdditionalTypes(branch, typeNames); -typeNames = outer.doFindAdditionalTypesUsingRebinds(branch, unit); -addAdditionalTypes(branch, typeNames); - typeNames = outer.doFindAdditionalTypesUsingArtificialRescues(branch, unit); addAdditionalTypes(branch, typeNames); + +typeNames = outer.doFindAdditionalTypesUsingRebinds(branch, unit); +addAdditionalTypes(branch, typeNames); +if (typeNames.length 0) { + refreshPackagesFromCompState(); +} // Optionally remember this cud. // @@ -516,10 +519,7 @@ compiler = new CompilerImpl(env, pol, options, req, probFact); // Initialize the packages list. - for (CompilationUnit unit : outer.compilationState.getCompilationUnits()) { -String packageName = Shared.getPackageName(unit.getTypeName()); -rememberPackage(packageName); - } + refreshPackagesFromCompState(); } public void clear() { @@ -546,6 +546,13 @@ } return unit; } + +private void refreshPackagesFromCompState() { + for (CompilationUnit unit : outer.compilationState.getCompilationUnits()) { +String packageName = Shared.getPackageName(unit.getTypeName()); +rememberPackage(packageName); + } +} /** * Causes the compilation service itself to recognize the specified package @@ -557,13 +564,14 @@ * ShellJavaScriptHost. */ private void rememberPackage(String packageName) { - int i = packageName.lastIndexOf('.'); - if (i != -1) { -// Ensure the parent package is also created. -// -rememberPackage(packageName.substring(0, i)); - } - knownPackages.add(packageName); + if (knownPackages.add(packageName)) { +int i = packageName.lastIndexOf('.'); +if (i != -1) { + // Ensure the parent package is also created. + // + rememberPackage(packageName.substring(0, i)); +} + } } } === --- /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Fri Aug 6 12:01:02 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Thu Sep 2 05:59:40 2010 @@ -33,7 +33,7 @@ import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -87,7 +87,7 @@ @Override protected String[] doFindAdditionalTypesUsingRebinds(TreeLogger logger, CompilationUnitDeclaration cud) { -SetString dependentTypeNames = new HashSetString(); +SetString dependentTypeNames = new LinkedHashSetString(); // Find all the deferred binding request types. FindDeferredBindingSitesVisitor v = new FindDeferredBindingSitesVisitor(); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add SafeHtml support to ui widgets. (issue829801)
http://gwt-code-reviews.appspot.com/829801/diff/7001/8003 File user/src/com/google/gwt/user/client/ui/ButtonBase.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8003#newcode50 user/src/com/google/gwt/user/client/ui/ButtonBase.java:50: extra spaces http://gwt-code-reviews.appspot.com/829801/diff/7001/8003#newcode52 user/src/com/google/gwt/user/client/ui/ButtonBase.java:52: getElement().setInnerHTML(html.asString()); I think we should delegate to setHtml(String) in case a subclass overrides the method: setHtml(html.asString()) Same for all other files http://gwt-code-reviews.appspot.com/829801/diff/7001/8004 File user/src/com/google/gwt/user/client/ui/CheckBox.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8004#newcode72 user/src/com/google/gwt/user/client/ui/CheckBox.java:72: * Similar to {...@link #CheckBox(String)} I don't think you need any of these similar to comments. http://gwt-code-reviews.appspot.com/829801/diff/7001/8004#newcode80 user/src/com/google/gwt/user/client/ui/CheckBox.java:80: extra spaces http://gwt-code-reviews.appspot.com/829801/diff/7001/8004#newcode266 user/src/com/google/gwt/user/client/ui/CheckBox.java:266: extra spaces - also in other files. Auto-format should fix them. http://gwt-code-reviews.appspot.com/829801/diff/7001/8005 File user/src/com/google/gwt/user/client/ui/HTML.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode45 user/src/com/google/gwt/user/client/ui/HTML.java:45: public class HTML extends Label implements HasDirectionalSafeHtml { Agreed - HasDirectionSafeHtml doesn't extend HasDirectionHtml, so you'll need to leave them both in there. http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode135 user/src/com/google/gwt/user/client/ui/HTML.java:135: public HTML(SafeHtml html, boolean wordWrap) { I argue that we delete this constructor and deprecate the old version. GWT has a big problem with constructor bloat for every option. In general, if a class provides a setter and the argument isn't fundamentally important to the class (such as the HTML to display), then we shouldn't have a constructor. http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode164 user/src/com/google/gwt/user/client/ui/HTML.java:164: public String getHTML() { Should we also have getSafeHtml? I'm going to argue no even though I brought it up. It seems like it would have some value, but not at the cost of having to store the SafeHtml in a field and manage it if the user calls setText. http://gwt-code-reviews.appspot.com/829801/diff/7001/8005#newcode199 user/src/com/google/gwt/user/client/ui/HTML.java:199: public void setSafeHtml(SafeHtml html) { You can delete the JavaDoc for this method, and it will be inherited automatically from HasSafeHtml (I think) http://gwt-code-reviews.appspot.com/829801/diff/7001/8006 File user/src/com/google/gwt/user/client/ui/HTMLPanel.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8006#newcode86 user/src/com/google/gwt/user/client/ui/HTMLPanel.java:86: public HTMLPanel(String tag, String html) { We need to overload this constructor too. http://gwt-code-reviews.appspot.com/829801/diff/7001/8014 File user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8014#newcode255 user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java:255: Extra newline http://gwt-code-reviews.appspot.com/829801/diff/7001/8014#newcode284 user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java:284: } Is there still a newline at the end of this file? http://gwt-code-reviews.appspot.com/829801/diff/7001/8015 File user/test/com/google/gwt/user/client/ui/HTMLTest.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8015#newcode45 user/test/com/google/gwt/user/client/ui/HTMLTest.java:45: assertEquals(html, htmlElement.getHTML()); add .toLowerCase. Some browser capitalize all tags http://gwt-code-reviews.appspot.com/829801/diff/7001/8015#newcode57 user/test/com/google/gwt/user/client/ui/HTMLTest.java:57: assertEquals(html, htmlElementWW.getHTML()); .toLowerCase() http://gwt-code-reviews.appspot.com/829801/diff/7001/8015#newcode72 user/test/com/google/gwt/user/client/ui/HTMLTest.java:72: assertEquals(html, htmlElementLTR.getHTML()); .toLowerCase http://gwt-code-reviews.appspot.com/829801/diff/7001/8016 File user/test/com/google/gwt/user/client/ui/InlineHTMLTest.java (right): http://gwt-code-reviews.appspot.com/829801/diff/7001/8016#newcode38 user/test/com/google/gwt/user/client/ui/InlineHTMLTest.java:38: assertEquals(html, htmlElement.getHTML()); .toLowerCase() http://gwt-code-reviews.appspot.com/829801/diff/7001/8016#newcode50 user/test/com/google/gwt/user/client/ui/InlineHTMLTest.java:50: assertEquals(html, htmlElementLTR.getHTML()); .toLowerCase() http://gwt-code-reviews.appspot.com/829801/diff/7001/8016#newcode62 user/test/com/google/gwt/user/client/ui/InlineHTMLTest.java:62:
[gwt-contrib] [google-web-toolkit] r8699 committed - Revert r8691 due to api break...
Revision: 8699 Author: rj...@google.com Date: Thu Sep 2 06:12:48 2010 Log: Revert r8691 due to api break [Was: Add debugging information to CssResource.] http://code.google.com/p/google-web-toolkit/source/detail?r=8699 Deleted: /trunk/user/src/com/google/gwt/resources/EnableCssResourceDebugging.gwt.xml /trunk/user/src/com/google/gwt/resources/client/impl/CssResourceObserver.java /trunk/user/src/com/google/gwt/resources/css/CssDebugInfo.java /trunk/user/src/com/google/gwt/resources/css/CssDebugInfoImpl.java /trunk/user/test/com/google/gwt/resources/client/CssResourceDebugInfoTest.java Modified: /trunk/user/src/com/google/gwt/resources/Resources.gwt.xml /trunk/user/src/com/google/gwt/resources/client/CssResource.java /trunk/user/src/com/google/gwt/resources/css/ClassRenamer.java /trunk/user/src/com/google/gwt/resources/css/ast/CssStylesheet.java /trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java /trunk/user/test/com/google/gwt/resources/ResourcesSuite.java /trunk/user/test/com/google/gwt/resources/client/CSSResourceTest.java === --- /trunk/user/src/com/google/gwt/resources/EnableCssResourceDebugging.gwt.xml Wed Sep 1 12:11:35 2010 +++ /dev/null @@ -1,22 +0,0 @@ -!-- -- -!-- Copyright 2008 Google Inc. -- -!-- Licensed under the Apache License, Version 2.0 (the License); you-- -!-- may not use this file except in compliance with the License. You may -- -!-- may obtain a copy of the License at-- -!-- -- -!-- http://www.apache.org/licenses/LICENSE-2.0 -- -!-- -- -!-- Unless required by applicable law or agreed to in writing, software-- -!-- distributed under the License is distributed on an AS IS BASIS, -- -!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or-- -!-- implied. License for the specific language governing permissions and -- -!-- limitations under the License. -- - -!-- Enables CssResource.getDebugInfo() and records obfuscated name map -- -module - inherits name=com.google.gwt.resources.Resources / - set-configuration-property name=CssResource.enableDebugInfo value=true / - replace-with class=com.google.gwt.resources.client.impl.CssResourceObserver.Mapper -when-type-is class=com.google.gwt.resources.client.impl.CssResourceObserver / - /replace-with -/module === --- /trunk/user/src/com/google/gwt/resources/client/impl/CssResourceObserver.java Wed Sep 1 12:11:35 2010 +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.resources.client.impl; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.resources.client.CssResource; -import com.google.gwt.resources.client.CssResource.DebugInfo; - -import java.util.Map; - -/** - * Enables CssResources to be intercepted before injection. The base - * implementation is a no-op. - * p - * emThis is an internal implementation API that is subject to change./em - */ -public class CssResourceObserver { - private static final CssResourceObserver IMPL = GWT.create(CssResourceObserver.class); - - /** - * An implementation of CssResourceObserver that records CssResource - * obfuscation data into a JavaScriptObject accessible on the main application - * window as code$wnd.gwtCssResource['moduleName']/code. - * p - * The keys on this object will be of the form - * codelt;ClientBundle type name.lt;CssResource method name.lt;Raw css class selector/code - * . An example key might be - * codecom.example.Resources.superButton.button-outer-div/code. The value - * associated with the key is the (possibly obfuscated) CSS class selector - * used in the injected code. - */ - public static class Mapper extends CssResourceObserver { -private final JavaScriptObject myMap; - -public Mapper() { - myMap = ensureMap(); -} - -@Override -protected T extends CssResource T registerImpl(T resource) { -
[gwt-contrib] [google-web-toolkit] r8700 committed - This should have been in r8671
Revision: 8700 Author: fabb...@google.com Date: Thu Sep 2 09:18:59 2010 Log: This should have been in r8671 http://code.google.com/p/google-web-toolkit/source/detail?r=8700 Modified: /trunk/eclipse/settings/code-style/gwt-checkstyle.xml === --- /trunk/eclipse/settings/code-style/gwt-checkstyle.xml Fri Aug 27 09:23:17 2010 +++ /trunk/eclipse/settings/code-style/gwt-checkstyle.xml Thu Sep 2 09:18:59 2010 @@ -1,3 +1,4 @@ +//depot/google3/third_party/java_src/gwt/svn/trunk/eclipse/settings/code-style/gwt-checkstyle.xml#3 - edit change 17030460 (text) ?xml version=1.0 encoding=UTF-8? !-- This configuration file was written by the eclipse-cs plugin configuration editor @@ -193,7 +194,12 @@ module name=MethodParamPad/ module name=NoWhitespaceBefore property name=severity value=error/ -property name=tokens value=SEMI,DOT,POST_DEC,POST_INC/ +property name=tokens value=SEMI,POST_DEC,POST_INC/ +/module +module name=NoWhitespaceBefore +property name=severity value=error/ +property name=allowLineBreaks value=true/ +property name=tokens value=DOT/ /module module name=RedundantModifier/ module name=EqualsHashCode/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding support for Direction.LINE_START/END to DockLayoutPanel and SplitLayoutPanel. (issue828801)
http://gwt-code-reviews.appspot.com/828801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding support for Direction.LINE_START/END to DockLayoutPanel and SplitLayoutPanel. (issue828801)
Patch Set 2 updates DOMRtlTest, which was never really in RTL mode until DockLayoutPanelRtlTest came along. The body isn't put into RTL mode until RootPanel.get() is called, but DOMRtlTest never called it. I also renamed DockLayoutPanelTestRtl to DockLayoutPanelRtlTest. http://gwt-code-reviews.appspot.com/828801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8701 committed - Support adding code-gen/runtime related classes directly to the second...
Revision: 8701 Author: to...@google.com Date: Thu Sep 2 07:29:17 2010 Log: Support adding code-gen/runtime related classes directly to the secondary JDT compilation for the GWT AST. Review at http://gwt-code-reviews.appspot.com/830801 http://code.google.com/p/google-web-toolkit/source/detail?r=8701 Modified: /trunk/dev/core/src/com/google/gwt/dev/jdt/BasicWebModeCompiler.java /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java /trunk/dev/core/src/com/google/gwt/dev/jjs/UnifiedAst.java === --- /trunk/dev/core/src/com/google/gwt/dev/jdt/BasicWebModeCompiler.java Wed Jul 28 11:12:18 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jdt/BasicWebModeCompiler.java Thu Sep 2 07:29:17 2010 @@ -30,6 +30,7 @@ import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -64,8 +65,8 @@ * Build the initial set of compilation units. */ public CompilationResults getCompilationUnitDeclarations( - TreeLogger logger, String[] seedTypeNames) - throws UnableToCompleteException { + TreeLogger logger, String[] seedTypeNames, + ICompilationUnit... additionalUnits) throws UnableToCompleteException { TypeOracle oracle = compilationState.getTypeOracle(); SetJClassType intfTypes = oracle.getSingleJsoImplInterfaces(); @@ -80,7 +81,9 @@ SetCompilationUnit alreadyAdded = new HashSetCompilationUnit(); ListICompilationUnit icus = new ArrayListICompilationUnit( -seedTypeNames.length + intfTypes.size()); +seedTypeNames.length + intfTypes.size() + additionalUnits.length); + +Collections.addAll(icus, additionalUnits); for (String seedTypeName : seedTypeNames) { CompilationUnit unit = getUnitForType(logger, classMapBySource, === --- /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Thu Sep 2 05:59:40 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Thu Sep 2 07:29:17 2010 @@ -27,6 +27,7 @@ import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; @@ -46,12 +47,13 @@ public static CompilationResults getCompilationUnitDeclarations( TreeLogger logger, String[] seedTypeNames, - RebindPermutationOracle rebindPermOracle, TypeLinker linker) - throws UnableToCompleteException { + RebindPermutationOracle rebindPermOracle, TypeLinker linker, + ICompilationUnit... additionalUnits) throws UnableToCompleteException { Event getCompilationUnitsEvent = SpeedTracerLogger.start(CompilerEventType.GET_COMPILATION_UNITS); CompilationResults results = new WebModeCompilerFrontEnd(rebindPermOracle, -linker).getCompilationUnitDeclarations(logger, seedTypeNames); +linker).getCompilationUnitDeclarations(logger, seedTypeNames, +additionalUnits); getCompilationUnitsEvent.end(); return results; } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/UnifiedAst.java Thu Jun 17 10:13:10 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/UnifiedAst.java Thu Sep 2 07:29:17 2010 @@ -54,7 +54,7 @@ return jProgram; } -JsProgram getJsProgram() { +public JsProgram getJsProgram() { return jsProgram; } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fixes a bug in LayoutImplIE8 where we convert the unit conversition to an integer before multipl... (issue834801)
Reviewers: rice, Description: Fixes a bug in LayoutImplIE8 where we convert the unit conversition to an integer before multiplying by the height/width, resulting in too much rounding. For example, 12pt becomes 12px instead of 15px because the conversion factor (1.33) is converted to 1. We now multiply by the value first, then convert to an int before setting the property. Please review this at http://gwt-code-reviews.appspot.com/834801/show Affected files: M user/src/com/google/gwt/layout/client/LayoutImplIE8.java Index: user/src/com/google/gwt/layout/client/LayoutImplIE8.java === --- user/src/com/google/gwt/layout/client/LayoutImplIE8.java(revision 8699) +++ user/src/com/google/gwt/layout/client/LayoutImplIE8.java(working copy) @@ -105,8 +105,7 @@ break; default: -value = value -* (int) getUnitSizeInPixels(layer.container, unit, vertical); +value = value * getUnitSizeInPixels(layer.container, unit, vertical); unit = Unit.PX; break; } @@ -117,6 +116,6 @@ } } -layer.getContainerElement().getStyle().setProperty(prop, value, unit); +layer.getContainerElement().getStyle().setProperty(prop, (int) value, unit); } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug in LayoutImplIE8 where we convert the unit conversition to an integer before multipl... (issue834801)
LGTM http://gwt-code-reviews.appspot.com/834801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
I'll review the rest separately, but I wanted to get this to you first. http://gwt-code-reviews.appspot.com/826802/diff/3001/4001 File dev/core/src/com/google/gwt/core/ext/GeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4001#newcode74 dev/core/src/com/google/gwt/core/ext/GeneratorContext.java:74: Object getContextStorage(String key); I think I would prefer to separate this out, and make it parameterized. You also need to worry about collisions from different generators/etc, so I would recommend something more like: interface CacheK,V { boolean contains(K); V get(K key); void put(K key, V value); } in GeneratorContext: K,V CacheK,V getCache(Class? clazz); So a generator would do something like: CacheGwtLocale, AbstractResource cache = ctx.getCache(MyGenerator.class); AbstractReource res = cache.get(locale); if (res == null) { res = computeResource(locale); cache.put(locale, res); } That way you get type safety and avoid collisions, rather than having to have every caller follow some convention of constructing the string keys. You could even define getCache on an interface which GeneratorContext implements, which would make it easier to mock uses of the cache. http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
The i18n stuff looks good except where commented. http://gwt-code-reviews.appspot.com/826802/diff/3001/4004 File dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4004#newcode402 dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java:402: } Suggest instead: @SuppressWarnings(unchecked) public K, V CacheK, V getCache(Class? clazz) { CacheK, V cache = (CacheK, V) storage.get(clazz); if (cache == null) { cache = new MyCacheK, V(); storage.put(clazz, cache); } return cache; } and it would create an empty cache if it didn't already exist. You could still use clazz.getCanonicalName() if you needed to avoid keeping the class alive by being a key in the map. You could also just use Map instead of Cache if you prefer. http://gwt-code-reviews.appspot.com/826802/diff/3001/4015 File user/src/com/google/gwt/i18n/rebind/LocaleUtils.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4015#newcode199 user/src/com/google/gwt/i18n/rebind/LocaleUtils.java:199: return contextCache; As mentioned in the other thread, I would suggest moving this into a GeneratorContext.getCache instead of repeating it. http://gwt-code-reviews.appspot.com/826802/diff/3001/4017 File user/src/com/google/gwt/i18n/rebind/ResourceFactory.java (right): http://gwt-code-reviews.appspot.com/826802/diff/3001/4017#newcode47 user/src/com/google/gwt/i18n/rebind/ResourceFactory.java:47: private static final String CONTEXT_STORAGE_KEY = ResourceFactory; I think this would be better as a class literal instead of a string, even if GeneratorContext used the name of the class as the key internally. That way you have to worry lessage about collisions and refactoring happens automatically. http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] RR : Factor a bean-like-object editor framework out of the RequestFactory editor work. (issue835801)
Reviewers: rjrjr, Message: Review requested. The SimpleBeanEditorDriver will be used to test general Editor framework behavior without requiring the use of RequestFactory. Description: Factor a bean-like-object editor framework out of the RequestFactory editor work. Add editor.client.adapters package. Provide mock implementations for public API interfaces. Patch by: bobv Review by: rjrjr Please review this at http://gwt-code-reviews.appspot.com/835801/show Affected files: M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/AddressEditor.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/NameLabel.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/PersonEditor.java M user/src/com/google/gwt/editor/Editor.gwt.xml D user/src/com/google/gwt/editor/client/BooleanEditor.java D user/src/com/google/gwt/editor/client/ByteEditor.java D user/src/com/google/gwt/editor/client/CharacterEditor.java D user/src/com/google/gwt/editor/client/DoubleEditor.java M user/src/com/google/gwt/editor/client/Editor.java M user/src/com/google/gwt/editor/client/EditorDelegate.java D user/src/com/google/gwt/editor/client/FloatEditor.java D user/src/com/google/gwt/editor/client/IntegerEditor.java D user/src/com/google/gwt/editor/client/LongEditor.java D user/src/com/google/gwt/editor/client/ShortEditor.java A user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java D user/src/com/google/gwt/editor/client/StringEditor.java M user/src/com/google/gwt/editor/client/ValueAwareEditor.java A user/src/com/google/gwt/editor/client/adapters/BooleanEditor.java A user/src/com/google/gwt/editor/client/adapters/ByteEditor.java A user/src/com/google/gwt/editor/client/adapters/CharacterEditor.java A user/src/com/google/gwt/editor/client/adapters/DoubleEditor.java A user/src/com/google/gwt/editor/client/adapters/FloatEditor.java A user/src/com/google/gwt/editor/client/adapters/IntegerEditor.java A user/src/com/google/gwt/editor/client/adapters/LongEditor.java A user/src/com/google/gwt/editor/client/adapters/ShortEditor.java A user/src/com/google/gwt/editor/client/adapters/StringEditor.java A user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java A user/src/com/google/gwt/editor/client/impl/AbstractSimpleBeanEditorDriver.java A user/src/com/google/gwt/editor/client/impl/SimpleBeanEditorDelegate.java A user/src/com/google/gwt/editor/client/testing/MockEditorDelegate.java A user/src/com/google/gwt/editor/client/testing/MockSimpleBeanEditorDriver.java A user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java A user/src/com/google/gwt/editor/rebind/SimpleBeanEditorDriverGenerator.java A user/src/com/google/gwt/editor/rebind/model/EditorAccess.java A user/src/com/google/gwt/editor/rebind/model/EditorData.java A user/src/com/google/gwt/editor/rebind/model/EditorModel.java M user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java M user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java A user/src/com/google/gwt/requestfactory/client/testing/MockRequestFactoryEditorDriver.java D user/src/com/google/gwt/requestfactory/rebind/EditorAccess.java D user/src/com/google/gwt/requestfactory/rebind/EditorData.java D user/src/com/google/gwt/requestfactory/rebind/EditorModel.java M user/src/com/google/gwt/requestfactory/rebind/RequestFactoryEditorDriverGenerator.java A user/test/com/google/gwt/editor/EditorSuite.java A user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java A user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java M user/test/com/google/gwt/requestfactory/RequestFactorySuite.java M user/test/com/google/gwt/requestfactory/client/EditorTest.java D user/test/com/google/gwt/requestfactory/rebind/EditorModelTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8704 committed - Missing file from SafeHtml work + whitespace fix
Revision: 8704 Author: r...@google.com Date: Thu Sep 2 09:08:23 2010 Log: Missing file from SafeHtml work + whitespace fix http://code.google.com/p/google-web-toolkit/source/detail?r=8704 Modified: /trunk/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/SortableHeader.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java === --- /trunk/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/SortableHeader.java Thu Sep 2 08:33:16 2010 +++ /trunk/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/SortableHeader.java Thu Sep 2 09:08:23 2010 @@ -1,12 +1,12 @@ /* * Copyright 2010 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the License); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the === --- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java Tue Aug 17 10:14:36 2010 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java Thu Sep 2 09:08:23 2010 @@ -23,6 +23,7 @@ import com.google.gwt.i18n.client.Constants; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.sample.showcase.client.ContentWidget; import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseData; import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseRaw; @@ -88,31 +89,25 @@ } @Override -public void render(ContactInfo value, Object key, StringBuilder sb) { - // Value can be null, so do a null check. +public void render(ContactInfo value, Object key, SafeHtmlBuilder sb) { + // Value can be null, so do a null check.. if (value == null) { return; } - sb.append(table); + sb.appendHtmlConstant(table); // Add the contact image. - sb.append(trtd rowspan='3'); - sb.append(imageHtml); - sb.append(/td); - - // Add the name. - sb.append(td style='font-size:95%;'); - sb.append(value.getFullName()); - sb.append(/td); - sb.append(/tr); - - // Add the address. - sb.append(trtd); - sb.append(value.getAddress()); - sb.append(/td/tr); - - sb.append(/table); + sb.appendHtmlConstant(trtd rowspan='3'); + sb.appendHtmlConstant(imageHtml); + sb.appendHtmlConstant(/td); + + // Add the name and address. + sb.appendHtmlConstant(td style='font-size:95%;'); + sb.appendEscaped(value.getFullName()); + sb.appendHtmlConstant(/td/trtrtd); + sb.appendEscaped(value.getAddress()); + sb.appendHtmlConstant(/td/tr/table); } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add SafeHtml support to ui widgets. (issue829801)
http://gwt-code-reviews.appspot.com/829801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8705 committed - Fixes a bug in LayoutImplIE8 where we convert the unit conversition to...
Revision: 8705 Author: jlaba...@google.com Date: Thu Sep 2 09:39:09 2010 Log: Fixes a bug in LayoutImplIE8 where we convert the unit conversition to an integer before multiplying by the height/width, resulting in too much rounding. For example, 12pt becomes 12px instead of 15px because the conversion factor (1.33) is converted to 1. We now multiply by the value first, then convert to an int before setting the property. Review at http://gwt-code-reviews.appspot.com/834801 Review by: r...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8705 Modified: /trunk/user/src/com/google/gwt/layout/client/LayoutImplIE8.java === --- /trunk/user/src/com/google/gwt/layout/client/LayoutImplIE8.java Wed Jun 30 06:04:21 2010 +++ /trunk/user/src/com/google/gwt/layout/client/LayoutImplIE8.java Thu Sep 2 09:39:09 2010 @@ -105,8 +105,7 @@ break; default: -value = value -* (int) getUnitSizeInPixels(layer.container, unit, vertical); +value = value * getUnitSizeInPixels(layer.container, unit, vertical); unit = Unit.PX; break; } @@ -117,6 +116,7 @@ } } -layer.getContainerElement().getStyle().setProperty(prop, value, unit); +layer.getContainerElement().getStyle().setProperty(prop, +(int) (value + 0.5), unit); } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Adding RTL support to the images used in CellTree. Removing automatic keyboard focus from the co... (issue836801)
Reviewers: rice, Description: Adding RTL support to the images used in CellTree. Removing automatic keyboard focus from the constructor because it can result in an IndexOutOfBoundsEception if the tree nodes are loaded asynchronously. Please review this at http://gwt-code-reviews.appspot.com/836801/show Affected files: M user/src/com/google/gwt/user/cellview/client/CellTree.java Index: user/src/com/google/gwt/user/cellview/client/CellTree.java === --- user/src/com/google/gwt/user/cellview/client/CellTree.java (revision 8705) +++ user/src/com/google/gwt/user/cellview/client/CellTree.java (working copy) @@ -53,12 +53,15 @@ */ public static interface CleanResources extends Resources { +@ImageOptions(flipRtl = true) @Source(cellTreeClosedArrow.png) ImageResource cellTreeClosedItem(); +@ImageOptions(flipRtl = true) @Source(cellTreeLoadingClean.gif) ImageResource cellTreeLoading(); +@ImageOptions(flipRtl = true) @Source(cellTreeOpenArrow.png) ImageResource cellTreeOpenItem(); @@ -118,22 +121,25 @@ /** * An image indicating a closed branch. */ +@ImageOptions(flipRtl = true) ImageResource cellTreeClosedItem(); /** * An image indicating that a node is loading. */ +@ImageOptions(flipRtl = true) ImageResource cellTreeLoading(); /** * An image indicating an open branch. */ +@ImageOptions(flipRtl = true) ImageResource cellTreeOpenItem(); /** * The background used for selected items. */ -@ImageOptions(repeatStyle = RepeatStyle.Horizontal) +@ImageOptions(repeatStyle = RepeatStyle.Horizontal, flipRtl = true) ImageResource cellTreeSelectedBackground(); /** @@ -521,7 +527,6 @@ this, null, null, getElement(), rootValue); keyboardSelectedNode = rootNode = root; root.setOpen(true, false); -keyboardSelectedNode.keyboardEnter(0, false); } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding RTL support to the images used in CellTree. Removing automatic keyboard focus from the co... (issue836801)
LGTM http://gwt-code-reviews.appspot.com/836801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: RR : Factor a bean-like-object editor framework out of the RequestFactory editor work. (issue835801)
LGTM http://gwt-code-reviews.appspot.com/835801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8707 committed - Added tests for constraint violations....
Revision: 8707 Author: amitman...@google.com Date: Thu Sep 2 10:56:13 2010 Log: Added tests for constraint violations. Patch by: amitmanjhi Review by: robertvawter,fabbott http://code.google.com/p/google-web-toolkit/source/detail?r=8707 Modified: /trunk/user/build.xml /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java /trunk/user/test/com/google/gwt/requestfactory/server/SimpleFoo.java === --- /trunk/user/build.xml Fri Aug 20 07:59:07 2010 +++ /trunk/user/build.xml Thu Sep 2 10:56:13 2010 @@ -61,6 +61,10 @@ pathelement location=${gwt.tools.lib}/objectweb/asm-3.1.jar/ pathelement location=${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar / pathelement location=${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar / +pathelement location=${gwt.tools.lib}/apache/log4j/log4j-1.2.16.jar / +pathelement location=${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar / +pathelement location=${gwt.tools.lib}/slf4j/slf4j-api/slf4j-api-1.6.1.jar / +pathelement location=${gwt.tools.lib}/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar / pathelement location=${gwt.tools}/redist/json/r2_20080312/json-1.5.jar / pathelement location=${gwt.dev.jar} / /path === --- /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Wed Aug 25 17:41:41 2010 +++ /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Thu Sep 2 10:56:13 2010 @@ -26,6 +26,7 @@ import com.google.gwt.requestfactory.shared.SimpleRequestFactory; import com.google.gwt.requestfactory.shared.SyncResult; +import java.util.Map; import java.util.Set; /** @@ -33,6 +34,53 @@ */ public class RequestFactoryTest extends GWTTestCase { + public void testViolationPresent() { +final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); +HandlerManager hm = new HandlerManager(null); +req.init(hm); +delayTestFinish(5000); + +SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class); +final RequestObjectVoid fooReq = req.simpleFooRequest().persist(newFoo); + +newFoo = fooReq.edit(newFoo); +newFoo.setUserName(A); // will cause constraint violation + +fooReq.fire(new ReceiverVoid() { + public void onSuccess(Void ignore, SetSyncResult syncResults) { +assertEquals(1, syncResults.size()); +SyncResult syncResult = syncResults.iterator().next(); +assertTrue(syncResult.hasViolations()); +MapString, String violations = syncResult.getViolations(); +assertEquals(1, violations.size()); +assertEquals(size must be between 3 and 30, violations.get(userName)); +finishTest(); + } +}); + } + + public void testViolationAbsent() { +final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); +HandlerManager hm = new HandlerManager(null); +req.init(hm); +delayTestFinish(5000); + +SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class); +final RequestObjectVoid fooReq = req.simpleFooRequest().persist(newFoo); + +newFoo = fooReq.edit(newFoo); +newFoo.setUserName(Amit); // will not cause violation. + +fooReq.fire(new ReceiverVoid() { + public void onSuccess(Void ignore, SetSyncResult syncResults) { +assertEquals(1, syncResults.size()); +SyncResult syncResult = syncResults.iterator().next(); +assertFalse(syncResult.hasViolations()); +finishTest(); + } +}); + } + /* * TODO: all these tests should check the final values. It will be easy when * we have better persistence than the singleton pattern. @@ -138,7 +186,8 @@ new ReceiverSimpleFooRecord() { public void onSuccess(SimpleFooRecord finalFooRecord, SetSyncResult syncResults) { -// newFoo hasn't been persisted, so userName is the old value. +// newFoo hasn't been persisted, so userName is the old +// value. assertEquals(GWT, finalFooRecord.getUserName()); finishTest(); } @@ -204,7 +253,7 @@ }); } - public void testPersistRecursiveRelation() { + public void testPersistRecursiveRelation() { final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); HandlerManager hm = new HandlerManager(null); req.init(hm); @@ -324,12 +373,12 @@ public void onSuccess(SimpleFooRecord response, SetSyncResult syncResult) { SimpleBarRecord bar = req.create(SimpleBarRecord.class); -RequestObjectString helloReq = req.simpleFooRequest().hello(response, bar); +RequestObjectString
[gwt-contrib] Refactoring the Showcase sample to use standards mode, and make use of LayoutPanels. The new Sho... (issue837801)
Reviewers: rice, Description: Refactoring the Showcase sample to use standards mode, and make use of LayoutPanels. The new Showcase looks different, but the features are the same. The main menu is now a CellTree backed by a TreeViewModel. The Application class, which used to perform active layout of the entire app, has been replaced by layout panels. The ShowcaseShell uses UiBinder to control the outer layout. The buttons to switch style themes have been removed. Opening a Category in the main menu prefetches the code for the sample under the category; the old behavior was for each ContentWidget to call a static method to preload other examples in the same category. Note that this change does not update the examples within showcase aside from couple of minor tweaks. In a later patch, we will deprecate old examples, add new examples for new GWT features, and make the examples look prettier with the rest of the app. This patch is smaller than it looks because more of the changes to the examples are related to a refactor in ContentWidget, so they are repetitive and small. Please review this at http://gwt-code-reviews.appspot.com/837801/show Affected files: M samples/showcase/src/com/google/gwt/i18n/client/LocalizableResource.properties M samples/showcase/src/com/google/gwt/i18n/client/LocalizableResource_ar.properties M samples/showcase/src/com/google/gwt/i18n/client/LocalizableResource_fr.properties M samples/showcase/src/com/google/gwt/i18n/client/LocalizableResource_zh.properties M samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml D samples/showcase/src/com/google/gwt/sample/showcase/client/Application.java M samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java A samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java A samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml A samples/showcase/src/com/google/gwt/sample/showcase/client/MainMenuTreeViewModel.java A samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.css M samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java M samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java D samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.properties D samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_ar.properties D samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_fr.properties D samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_zh.properties D samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseImages.java A samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseResources.java A samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java A samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml D samples/showcase/src/com/google/gwt/sample/showcase/client/StyleSheetLoader.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellBrowser.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTree.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellValidation.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwBidiFormatting.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwBidiInput.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwConstantsExample.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwConstantsWithLookupExample.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwDateTimeFormat.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwDictionaryExample.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwMessagesExample.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwNumberFormat.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/i18n/CwPluralFormsExample.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwListBox.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwMenuBar.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwSuggestBox.java M
[gwt-contrib] Re: Fix the escaping done by UrlBuilder. (issue754803)
In brief: URIs (RFC 3986) is a mess, and back to URL.encode for the path in UrlBuilder? (with a second pass though) http://gwt-code-reviews.appspot.com/754803/diff/21001/22002 File user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java (right): http://gwt-code-reviews.appspot.com/754803/diff/21001/22002#newcode79 user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java:79: String contextRelativePath = URLDecoder.decode(modulePath.substring(contextPath.length())); On 2010/09/02 10:17:07, hhchan wrote: On 2010/09/02 09:00:57, tbroyer wrote: Beware! URLDecoder will decode + into a space, whereas it might really mean a +. What I mean is that this is probably a breaking change. modulePath is only the path though, whcih doesn't include query string. Therefore, we shouldn't be seeing '+'. Why? + is a valid character in path segments, and I can actually map the servlet at any path I want, including one containing a +: servlet-mapping servlet-namefoo/servlet-name url-pattern/foo+bar/url-pattern /servlet-mapping I hit this because in one of the tests, the module name is actually /com.google.gwt.junit.JUnitTestWithProperties.JUnit.locale$en_US.my.property$one/com.google.gwt.junit.JUnitTestWithProperties.JUnit.locale$en_US.my.property$one.nocache.js' which gets encoded by the UrlBuilder on the client side as: /com.google.gwt.junit.JUnitTestWithProperties.JUnit.locale%24en_US.my.property%24one/com.google.gwt.junit.JUnitTestWithProperties.JUnit.locale%24en_US.my.property%24one.nocache.js' if I don't decode it here, the tests never pass. Then I'd rather fix UrlBuilder. The issue is that '$' is a reserved char in URI, which means that a plain '$' and a %-encoded one (%24) are not interchangeable (they can mean different things to the server). I faced something like this with a '+' in the path that was treated as a space by the server (that was a bit more convoluted, as I was sending a %2B but Apache mod_jk were decoding it in its request to Tomcat); I raised an issue and they invoked this obscure rule of RFC 3986: https://issues.alfresco.com/jira/browse/ALF-1857 Therefore, I think maybe UrlBuilder should rather use URL.encode(), as if the path were a full URI, but add a second pass to ensure there are no stray '#' or '?' that could be confused with a hash or query-string delimiter. I am not sure whether module path like this will ever show up in practice, but I think decoding the path is more correct anyways. Well, as it's passed to ServletContext#getResourceAsStream, I don't think so. The JavaDoc says (from getResource, to which getResourceAsStream redirects): The path must begin with a / and is interpreted as relative to the current context root.pThis method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war file.; also note that it throws a MalformedURLException if the pathname is not given in the correct form; so it should be a URL path, which to me means URL-encoded (though I might be wrong, I'm only interpreting the JavaDoc here!) http://gwt-code-reviews.appspot.com/754803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Renamed *Record* to *Proxy*. Also renamed variables in a few classes. (issue825802)
Reviewers: rjrjr, Description: Renamed *Record* to *Proxy*. Also renamed variables in a few classes. Renamed DataTransferObject - ProxyFor. patch by: amitmanjhi Review by: rjrjr Please review this at http://gwt-code-reviews.appspot.com/825802/show Affected files: M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxyChanged.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxy.java M samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxyChanged.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseList.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseTree.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/Expenses.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobile.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseDetails.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseList.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportList.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxy.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxyChanged.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecord.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecordChanged.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRequest.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxy.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxyChanged.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecord.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecordChanged.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRequest.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpensesEntityTypesProcessor.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxy.java A samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxyChanged.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecord.java D samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecordChanged.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRequest.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeDetailsView.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeEditView.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeListView.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeRenderer.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportDetailsView.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportEditView.java M samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportListView.java M user/src/com/google/gwt/app/client/EditorSupport.java M user/src/com/google/gwt/app/client/NullParser.java A user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java A user/src/com/google/gwt/app/place/AbstractProxyListActivity.java A user/src/com/google/gwt/app/place/AbstractProxyListView.java D user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java D user/src/com/google/gwt/app/place/AbstractRecordListActivity.java D user/src/com/google/gwt/app/place/AbstractRecordListView.java M
[gwt-contrib] Re: Fix DevMode memory leaks by attaching cache lifetimes to the GeneratorContext (issue826802)
LGTM for i18n parts. http://gwt-code-reviews.appspot.com/826802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Renamed *Record* to *Proxy*. Also renamed variables in a few classes. (issue825802)
http://gwt-code-reviews.appspot.com/825802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Renamed *Record* to *Proxy*. Also renamed variables in a few classes. (issue825802)
LGTM On 2010/09/02 23:35:48, amitmanjhi wrote: http://gwt-code-reviews.appspot.com/825802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8708 committed - Add @UiChild annotation to specify how UiBinder should add a child ele...
Revision: 8708 Author: son...@google.com Date: Thu Sep 2 13:27:55 2010 Log: Add @UiChild annotation to specify how UiBinder should add a child element. Patch by: sonnyf Reviw by: bobv, rjrjr Review at http://gwt-code-reviews.appspot.com/794801 http://code.google.com/p/google-web-toolkit/source/detail?r=8708 Added: /trunk/user/src/com/google/gwt/uibinder/client/UiChild.java /trunk/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/UiChildParserTest.java Modified: /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JPrimitiveType.java /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /trunk/user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java /trunk/user/test/com/google/gwt/uibinder/rebind/model/OwnerFieldClassTest.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/uibinder/client/UiChild.java Thu Sep 2 13:27:55 2010 @@ -0,0 +1,62 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.uibinder.client; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Mark a method as the appropriate way to add a child widget to the parent + * class. + * + * p + * The limit attribute specifies the number of times the function can be safely + * called. If no limit is specified, it is assumed to be unlimited. Only one + * child is permitted under each custom tag specified so the limit represents + * the number of times the tag can be present in any object. + * + * p + * The tagname attribute indicates the name of the tag this method will handle + * in the {...@link UiBinder} template. If none is specified, the method name must + * begin with add, and the tag is assumed to be the remaining characters + * (after the add prefix) entirely in lowercase. + * + * p + * For example, code + * + * @UiChild MyWidget#addCustomChild(Widget w) /code and + * + * pre + * p:MyWidget + * p:customchild + * g:SomeWidget / + * /p:customchild + * /p:MyWidget + * /pre would invoke the codeaddCustomChild/code function to add + * an instance of SomeWidget. + */ +...@documented +...@retention(RetentionPolicy.RUNTIME) +...@target(ElementType.METHOD) +public @interface UiChild { + + int limit() default -1; + + String tagname() default ; +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java Thu Sep 2 13:27:55 2010 @@ -0,0 +1,166 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.uibinder.elementparsers; + +import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.core.ext.typeinfo.JAbstractMethod; +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.JMethod; +import com.google.gwt.core.ext.typeinfo.JParameter; +import com.google.gwt.dev.util.Pair; +import com.google.gwt.uibinder.rebind.UiBinderWriter; +import com.google.gwt.uibinder.rebind.XMLElement; +import com.google.gwt.uibinder.rebind.XMLElement.Interpreter; +import com.google.gwt.uibinder.rebind.model.OwnerFieldClass; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * Parses any children of widgets that use the {...@link UiChild} annotation. + */ +public class UiChildParser implements ElementParser { + + private String fieldName; + + /** + * Mapping of child tag to the number of times it has been called + */ + private MapString, Integer numCallsToChildMethod = new HashMapString, Integer(); + private MapString, PairJMethod,
[gwt-contrib] Re: Change UiBinder Message generation to use consistent examples for HTML and Widget placeholders t... (issue838801)
Wow, nice to see it's such a small change. And using tag rather than span is a good choice. Rather than having that funky protected field, how about adding an overload of nextPlaceholder that doesn't take an example, and defaults to tag On 2010/09/02 23:40:14, mbx wrote: http://gwt-code-reviews.appspot.com/838801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8709 committed - Rolling back the following due to test failures:...
Revision: 8709 Author: j...@google.com Date: Thu Sep 2 14:24:35 2010 Log: Rolling back the following due to test failures: Added tests for constraint violations. Patch by: amitmanjhi Review by: robertvawter,fabbott http://code.google.com/p/google-web-toolkit/source/detail?r=8709 Modified: /trunk/user/build.xml /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java /trunk/user/test/com/google/gwt/requestfactory/server/SimpleFoo.java === --- /trunk/user/build.xml Thu Sep 2 10:56:13 2010 +++ /trunk/user/build.xml Thu Sep 2 14:24:35 2010 @@ -61,10 +61,6 @@ pathelement location=${gwt.tools.lib}/objectweb/asm-3.1.jar/ pathelement location=${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar / pathelement location=${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar / -pathelement location=${gwt.tools.lib}/apache/log4j/log4j-1.2.16.jar / -pathelement location=${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar / -pathelement location=${gwt.tools.lib}/slf4j/slf4j-api/slf4j-api-1.6.1.jar / -pathelement location=${gwt.tools.lib}/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar / pathelement location=${gwt.tools}/redist/json/r2_20080312/json-1.5.jar / pathelement location=${gwt.dev.jar} / /path === --- /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Thu Sep 2 10:56:13 2010 +++ /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Thu Sep 2 14:24:35 2010 @@ -26,7 +26,6 @@ import com.google.gwt.requestfactory.shared.SimpleRequestFactory; import com.google.gwt.requestfactory.shared.SyncResult; -import java.util.Map; import java.util.Set; /** @@ -34,53 +33,6 @@ */ public class RequestFactoryTest extends GWTTestCase { - public void testViolationPresent() { -final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); -HandlerManager hm = new HandlerManager(null); -req.init(hm); -delayTestFinish(5000); - -SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class); -final RequestObjectVoid fooReq = req.simpleFooRequest().persist(newFoo); - -newFoo = fooReq.edit(newFoo); -newFoo.setUserName(A); // will cause constraint violation - -fooReq.fire(new ReceiverVoid() { - public void onSuccess(Void ignore, SetSyncResult syncResults) { -assertEquals(1, syncResults.size()); -SyncResult syncResult = syncResults.iterator().next(); -assertTrue(syncResult.hasViolations()); -MapString, String violations = syncResult.getViolations(); -assertEquals(1, violations.size()); -assertEquals(size must be between 3 and 30, violations.get(userName)); -finishTest(); - } -}); - } - - public void testViolationAbsent() { -final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); -HandlerManager hm = new HandlerManager(null); -req.init(hm); -delayTestFinish(5000); - -SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class); -final RequestObjectVoid fooReq = req.simpleFooRequest().persist(newFoo); - -newFoo = fooReq.edit(newFoo); -newFoo.setUserName(Amit); // will not cause violation. - -fooReq.fire(new ReceiverVoid() { - public void onSuccess(Void ignore, SetSyncResult syncResults) { -assertEquals(1, syncResults.size()); -SyncResult syncResult = syncResults.iterator().next(); -assertFalse(syncResult.hasViolations()); -finishTest(); - } -}); - } - /* * TODO: all these tests should check the final values. It will be easy when * we have better persistence than the singleton pattern. @@ -186,8 +138,7 @@ new ReceiverSimpleFooRecord() { public void onSuccess(SimpleFooRecord finalFooRecord, SetSyncResult syncResults) { -// newFoo hasn't been persisted, so userName is the old -// value. +// newFoo hasn't been persisted, so userName is the old value. assertEquals(GWT, finalFooRecord.getUserName()); finishTest(); } @@ -253,7 +204,7 @@ }); } - public void testPersistRecursiveRelation() { + public void testPersistRecursiveRelation() { final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class); HandlerManager hm = new HandlerManager(null); req.init(hm); @@ -373,12 +324,12 @@ public void onSuccess(SimpleFooRecord response, SetSyncResult syncResult) { SimpleBarRecord bar = req.create(SimpleBarRecord.class); -RequestObjectString helloReq = req.simpleFooRequest().hello( -
[gwt-contrib] incubator and gwt 2.1
What is the plan to bring incubator into compatability with gwt 2.1 ? Cheers Cameron -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Clarify EditorDriver behavior with combinations of Editor mix-in interfaces through brute-force ... (issue840801)
Reviewers: rjrjr, Message: Review requested. Description: Clarify EditorDriver behavior with combinations of Editor mix-in interfaces through brute-force testing. Patch by: bobv Review by: rjrjr Please review this at http://gwt-code-reviews.appspot.com/840801/show Affected files: M user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java M user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java M user/src/com/google/gwt/editor/rebind/model/EditorModel.java M user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java M user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Clarify EditorDriver behavior with combinations of Editor mix-in interfaces through brute-force ... (issue840801)
LGTM http://gwt-code-reviews.appspot.com/840801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8710 committed - Clarify EditorDriver behavior with combinations of Editor mix-in inter...
Revision: 8710 Author: b...@google.com Date: Thu Sep 2 16:22:41 2010 Log: Clarify EditorDriver behavior with combinations of Editor mix-in interfaces through brute-force testing. Patch by: bobv Review by: rjrjr Review at http://gwt-code-reviews.appspot.com/840801 http://code.google.com/p/google-web-toolkit/source/detail?r=8710 Modified: /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java /trunk/user/src/com/google/gwt/editor/rebind/model/EditorModel.java /trunk/user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java /trunk/user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java === --- /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java Thu Sep 2 10:32:07 2010 +++ /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java Thu Sep 2 16:22:41 2010 @@ -17,6 +17,7 @@ import com.google.gwt.editor.client.Editor; import com.google.gwt.editor.client.EditorDelegate; +import com.google.gwt.editor.client.LeafValueEditor; import com.google.gwt.editor.client.ValueAwareEditor; import com.google.gwt.event.shared.EventBus; import com.google.gwt.event.shared.HandlerRegistration; @@ -43,7 +44,7 @@ } protected EventBus eventBus; - + protected LeafValueEditorT leafValueEditor; /** * This field avoids needing to repeatedly cast {...@link #editor}. */ @@ -60,6 +61,13 @@ if (valueAwareEditor != null) { valueAwareEditor.flush(); } + +// See comment in initialize about LeafValueEditors +if (leafValueEditor != null) { + setObject(leafValueEditor.getValue()); + return; +} + if (getObject() == null) { return; } @@ -67,6 +75,8 @@ setObject(ensureMutable(getObject())); flushValues(); } + + public abstract T getObject(); public String getPath() { return path; @@ -86,17 +96,33 @@ protected abstract void flushValues(); - protected abstract T getObject(); - protected void initialize(EventBus eventBus, String pathSoFar, T object, E editor) { this.eventBus = eventBus; this.path = pathSoFar; setEditor(editor); setObject(object); + +// Set up pre-casted fields to access the editor +if (editor instanceof LeafValueEditor?) { + leafValueEditor = (LeafValueEditorT) editor; +} if (editor instanceof ValueAwareEditor?) { valueAwareEditor = (ValueAwareEditorT) editor; valueAwareEditor.setDelegate(this); +} + +/* + * Unusual case: The user may have installed an editor subtype that adds the + * LeafValueEditor interface into a plain Editor field. If this has + * happened, only set the value and don't descend into any sub-Editors. + */ +if (leafValueEditor != null) { + leafValueEditor.setValue(object); + return; +} + +if (valueAwareEditor != null) { valueAwareEditor.setValue(object); } if (object != null) { === --- /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java Thu Sep 2 10:32:07 2010 +++ /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java Thu Sep 2 16:22:41 2010 @@ -108,7 +108,7 @@ sw.println(protected void setEditor(%s editor) {this.editor=editor;}, editor.getQualifiedSourceName()); sw.println(private %s object;, proxy.getQualifiedSourceName()); - sw.println(protected %s getObject() {return object;}, + sw.println(public %s getObject() {return object;}, proxy.getQualifiedSourceName()); sw.println(protected void setObject(%s object) {this.object=object;}, proxy.getQualifiedSourceName()); @@ -127,7 +127,8 @@ sw.println(protected void attachSubEditors() {); sw.indent(); for (EditorData d : data) { -if (d.isBeanEditor()) { +if (d.isBeanEditor() !d.isLeafValueEditor() +|| d.isValueAwareEditor()) { String subDelegateType = getEditorDelegate(d.getEditedType(), d.getEditorType()); sw.println(if (editor.%s != null) {, d.getSimpleExpression()); @@ -147,8 +148,15 @@ sw.indent(); for (EditorData d : data) { if (d.isBeanEditor()) { - sw.println(if (%1$sDelegate != null) %1$sDelegate.flush();, + sw.println(if (%1$sDelegate != null) { %1$sDelegate.flush();, d.getPropertyName()); + if (d.getSetterName() != null) { +String mutableObjectExpression = mutableObjectExpression(String.format( +getObject()%s, d.getBeanOwnerExpression())); +sw.println(%s.%s(%sDelegate.getObject());, +mutableObjectExpression, d.getSetterName(), d.getPropertyName()); + } + sw.println(}); } }
[gwt-contrib] RR: Add statistics to optimizers (issue841801)
Reviewers: scottb, robertvawter, cromwellian, Description: RR: Add statistics to optimizers Updates the compiler optimizers to returns statistics about each pass instead of a simple boolean. This could be used to analyze the effectiveness of an individual optimizer, tune the compiler for code size/ compile time trade offs, or predict the effectiveness of future passes of an optimizer. Please review this at http://gwt-code-reviews.appspot.com/841801/show Affected files: M dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java M dev/core/src/com/google/gwt/dev/jjs/ast/JModVisitor.java M dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java M dev/core/src/com/google/gwt/dev/jjs/impl/Finalizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/LongCastNormalizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java M dev/core/src/com/google/gwt/dev/jjs/impl/MethodCallTightener.java M dev/core/src/com/google/gwt/dev/jjs/impl/MethodInliner.java A dev/core/src/com/google/gwt/dev/jjs/impl/OptimizerStats.java M dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java M dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java M dev/core/src/com/google/gwt/dev/jjs/impl/gflow/DataflowOptimizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/gflow/liveness/LivenessTransformation.java M dev/core/src/com/google/gwt/dev/jjs/impl/gflow/unreachable/DeleteNodeVisitor.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: RR: Add statistics to optimizers (issue841801)
On 2010/09/03 03:38:46, zundel wrote: Just a general comment, if you want to get even more granularity, look at this old path of mine, which instrumented MethodInliner to give really good information on exactly how many times something was inlined vs not, and a count of the failure types, which would tell you how the optimizer is failing on certain code constructs. Here's a link: http://gwt-code-reviews.appspot.com/64813/diff/1/2 http://gwt-code-reviews.appspot.com/841801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: RR: Add statistics to optimizers (issue841801)
I'm looking for feedback on this proposed change, mainly, is the statistical information worth the added complexity? Currently, this only dumps out a diagnostic when you specify -Dgwt.jjs.traceMethods=com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.optimize on the Compiler command line. Here's a sample of what the statistical output looks like on a minimal GWT app: Pass 1 ( 0/ 0) Pruner 27.94% ( 3132/ 11211)Finalizer 45.64% ( 2455/ 5379) MakeCallsStatic 7.94% ( 812/ 10229) TypeTightener 2.41% ( 1226/ 50966) MethodCallTightener 1.96% (70/ 3569) DeadCodeElimination 1.93% ( 1277/ 66324) MethodInliner 28.84% ( 5430/ 18830) SameParameterValueOptimizer 0.58% (44/ 7588) Pass 2 ( 0/ 0) Pruner 12.24% ( 1089/ 8895)Finalizer 0.09% ( 4/ 4400) MakeCallsStatic 2.68% ( 182/ 6796) TypeTightener 0.80% ( 272/ 33915) MethodCallTightener 1.36% (32/ 2353) DeadCodeElimination 0.41% ( 166/ 40201) MethodInliner 9.95% ( 956/ 9609) SameParameterValueOptimizer 0.24% (14/ 5776) Pass 3 ( 0/ 0) Pruner 1.79% ( 240/ 13392)Finalizer 0.00% ( 0/ 4036) MakeCallsStatic 0.50% (31/ 6221) TypeTightener 0.31% (62/ 20088) MethodCallTightener 0.05% ( 1/ 2190) DeadCodeElimination 0.20% (74/ 37391) MethodInliner 2.90% ( 250/ 8608) SameParameterValueOptimizer 0.11% ( 6/ 5325) Pass 4 ( 0/ 0) Pruner 0.54% (57/ 10492)Finalizer 0.03% ( 1/ 3948) MakeCallsStatic 0.02% ( 1/ 6086) TypeTightener 0.05% ( 8/ 14660) MethodCallTightener 0.05% ( 1/ 2147) DeadCodeElimination 0.47% ( 173/ 36545) MethodInliner 2.07% ( 172/ 8310) SameParameterValueOptimizer 0.02% ( 1/ 5126) Pass 5 ( 0/ 0) Pruner 0.67% (66/ 9896)Finalizer 0.03% ( 1/ 3747) MakeCallsStatic 0.02% ( 1/ 5732) TypeTightener 0.01% ( 2/ 13845) MethodCallTightener 0.00% ( 0/ 2012) DeadCodeElimination 0.05% (19/ 35210) MethodInliner 0.20% (16/ 8001) SameParameterValueOptimizer 0.00% ( 0/ 4976) Pass 6 ( 0/ 0) Pruner 0.30% (22/ 7338)Finalizer 0.00% ( 0/ 3695) MakeCallsStatic 0.00% ( 0/ 5691) TypeTightener 0.07% ( 9/ 13660) MethodCallTightener 0.00% ( 0/ 2001) DeadCodeElimination 0.06% (13/ 23220) MethodInliner 0.00% ( 0/ 2638) SameParameterValueOptimizer 0.00% ( 0/ 4938) Pass 7 ( 0/ 0) Pruner 0.10% ( 5/ 4890)Finalizer 0.00% ( 0/ 3688) MakeCallsStatic 0.04% ( 2/ 5690) TypeTightener 0.00% ( 0/ 4548) MethodCallTightener 0.00% ( 0/ 2001) DeadCodeElimination 0.00% ( 0/ 11605) MethodInliner 0.38% (20/ 5283) SameParameterValueOptimizer 0.00% ( 0/ 4937) Pass 8 ( 0/ 0) Pruner 0.04% ( 2/ 4886)Finalizer 0.00% ( 0/ 3686) MakeCallsStatic 0.00% ( 0/ 5684) TypeTightener 0.01% ( 1/ 9093) MethodCallTightener 0.00% ( 0/ 1999) DeadCodeElimination 0.00% ( 0/ 11601) MethodInliner 0.00% ( 0/ 2634) SameParameterValueOptimizer 0.00% ( 0/ 4933) Pass 9 ( 0/ 0) Pruner 0.00% ( 0/ 2443)Finalizer 0.00% ( 0/ 3686) MakeCallsStatic 0.00% ( 0/ 5684) TypeTightener 0.00% ( 0/ 4546) MethodCallTightener 0.00% ( 0/ 1999) DeadCodeElimination 0.00% ( 0/ 11601) MethodInliner 0.00% ( 0/ 2634) SameParameterValueOptimizer 0.00% ( 0/ 4933) DataflowOptimizer 0.46% ( 5/ 1080) I think the information is interesting on its own, but it could prove useful if we decide to implement a compiler option to allow users to make a compilation time/code size output trade off. Our current options are either minimal optimization or maximum possible optimization. We could probably cut the production compile down a bit if we had an in-between option (and maybe made it the default). In a couple of places, I got rid of the didChange() overload on JModVisitor subclasses. I know that there is a difference, I'm wondering if it is important. My eclipse environment is a mess - please don't bother with code formatting feedback until I dig myself out from under it. -Eric. On Thu, Sep 2, 2010 at 11:38 PM, zun...@google.com wrote: Reviewers: scottb, robertvawter, cromwellian, Description: RR: Add statistics to optimizers Updates the compiler optimizers to returns statistics about each pass instead of a simple boolean. This could be used to analyze the effectiveness of an individual optimizer, tune the compiler for code size/ compile time trade offs, or predict the effectiveness of future passes of an optimizer. Please review this at http://gwt-code-reviews.appspot.com/841801/show Affected files: M