[gwt-contrib] Re: Announcing GPE/GWT 2.2 RC1
in addition, in most cases it doesnt matter what java version to use for GWT code, if your environment still allows java1.4 and you want to integrate latest GWT into your project, it will do perfectly if you keep GWT out of serverside as GWT does not dictate to use RPC communications, or the recent RequestFactory and for any distributed applications nowadays, one anyway would prefer to use the most common interchange format... just imagine one server (GAE at best) serving many different clients, like android, iPhone, or GWT ... :o) ok, but thats another story... On 8 Feb., 08:47, stuckagain david.no...@gmail.com wrote: What features in Java 6 would be so fundamental to GWT that 1.5 becomes deprecated ? -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)
Removed the hibernate validation implementation as it is not necessary. I guess we need to decide between adding stuff to gwt-user.jar with this approach or to add the respective jars to each gwtc invocation as in: http://gwt-code-reviews.appspot.com/1342803/show On 2011/02/09 15:19:17, rchandia wrote: http://gwt-code-reviews.appspot.com/1323803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Generator Result Caching implementation for ClientBundle (issue1236801)
LGTM http://gwt-code-reviews.appspot.com/1236801/diff/110014/111014 File user/src/com/google/gwt/resources/rebind/context/AbstractClientBundleGenerator.java (right): http://gwt-code-reviews.appspot.com/1236801/diff/110014/111014#newcode231 user/src/com/google/gwt/resources/rebind/context/AbstractClientBundleGenerator.java:231: if (!canBeCacheable) { On 2011/02/07 20:32:10, jbrosenberg wrote: We don't want to change the behavior, or incur unnecessary overhead, if caching is not enabled or available. One would expect different exception behavior when different code paths are taken, no? What wouldn't be expected is inconsistent input validation, especially for an API that appears to mirror an existing one (addPermutationAxis()) that always validates. http://gwt-code-reviews.appspot.com/1236801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Added validation jars to all calls to GWTC to provide classes rquired by (issue1342803)
On 2011/02/08 19:02:29, rjrjr wrote: Don't you need to make the same changes to samples/expenses/pom.xml? Done. http://gwt-code-reviews.appspot.com/1342803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
I did a spot check. There is one odd thing that happens with the new settings on eclipse 3.5 (found in JsCatchScope) @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent().equals(ident)) { return name; } } becomes @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent() .equals(ident)) { return name; } } http://gwt-code-reviews.appspot.com/1346803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix TestUtil.PathImpl to correctly test for non matching (issue1352801)
LGTM http://gwt-code-reviews.appspot.com/1352801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Make UiBinder accept IsWidget subinterfaces properly (issue1295806)
http://gwt-code-reviews.appspot.com/1295806/diff/1/10 File user/src/com/google/gwt/user/client/ui/HTMLTable.java (right): http://gwt-code-reviews.appspot.com/1295806/diff/1/10#newcode1105 user/src/com/google/gwt/user/client/ui/HTMLTable.java:1105: Element td = cleanCell(row, column, true); I guess the answer is... probably. The question is, what should the code below do? table.setText(0, 0, hello world); table.setWidget(0, 0, null); If you think the call to setWidget should clear the text hello world (and I think that makes sense), then yes, cleanCell() should be outside of the conditional. If you think hello world should remain, then no change is needed. Assuming we want to change it, we should add a test case. Do you want me to take care of it? http://gwt-code-reviews.appspot.com/1295806/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
The whitespace is me cutting and pasting. I trimmed the function of some stuff that wasn't pertinent to the problem. On Wed, Feb 9, 2011 at 10:50 AM, John Tamplin j...@google.com wrote: On Wed, Feb 9, 2011 at 10:43 AM, zun...@google.com wrote: I did a spot check. There is one odd thing that happens with the new settings on eclipse 3.5 (found in JsCatchScope) @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent().equals(ident)) { return name; } } becomes @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent() .equals(ident)) { return name; } } Yes, we have lots of cases like this, where 2 or 3 method calls are chained but not in a builder pattern. I suggest just letting it break before a dot if it needs to in order to fit on the line, but not force it. Also, shouldn't the .equals line be indented 2 more? And where did the extra blank line come from? -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
Was the intention to require all expressions to be put on a new line, or only when the dots are preceeded by whitespace? On Wed, Feb 9, 2011 at 10:48 AM, Ray Ryan rj...@google.com wrote: That's pretty bad. I'll tweak. Even if we can't have perfect builders we can at least wrap long lines better. On Feb 9, 2011 7:43 AM, zun...@google.com wrote: I did a spot check. There is one odd thing that happens with the new settings on eclipse 3.5 (found in JsCatchScope) @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent().equals(ident)) { return name; } } becomes @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent() .equals(ident)) { return name; } } http://gwt-code-reviews.appspot.com/1346803/show -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Sort the top level validator class to handle most specific classes first. (issue1346804)
LGTM http://gwt-code-reviews.appspot.com/1346804/diff/1/5 File user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java (right): http://gwt-code-reviews.appspot.com/1346804/diff/1/5#newcode37 user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java:37: // ConstraintCompositionGwtTest.DummyEntityWithZipCode.class Indentation http://gwt-code-reviews.appspot.com/1346804/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
The intention was all but the first call on its own line, and was not very well thought out — I had builders on the brain. There is another option to have it wrap when it needs to, which we have turned off at the moment. I'll set it to that and do more spot checks. On Wed, Feb 9, 2011 at 7:56 AM, Eric Ayers zun...@google.com wrote: Was the intention to require all expressions to be put on a new line, or only when the dots are preceeded by whitespace? On Wed, Feb 9, 2011 at 10:48 AM, Ray Ryan rj...@google.com wrote: That's pretty bad. I'll tweak. Even if we can't have perfect builders we can at least wrap long lines better. On Feb 9, 2011 7:43 AM, zun...@google.com wrote: I did a spot check. There is one odd thing that happens with the new settings on eclipse 3.5 (found in JsCatchScope) @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent().equals(ident)) { return name; } } becomes @Override protected JsName findExistingNameNoRecurse(String ident) { if (name.getIdent() .equals(ident)) { return name; } } http://gwt-code-reviews.appspot.com/1346803/show -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Make UiBinder accept IsWidget subinterfaces properly (issue1295806)
On Wed, Feb 9, 2011 at 7:54 AM, jlaba...@google.com wrote: http://gwt-code-reviews.appspot.com/1295806/diff/1/10 File user/src/com/google/gwt/user/client/ui/HTMLTable.java (right): http://gwt-code-reviews.appspot.com/1295806/diff/1/10#newcode1105 user/src/com/google/gwt/user/client/ui/HTMLTable.java:1105: Element td = cleanCell(row, column, true); I guess the answer is... probably. The question is, what should the code below do? table.setText(0, 0, hello world); table.setWidget(0, 0, null); If you think the call to setWidget should clear the text hello world (and I think that makes sense), then yes, cleanCell() should be outside of the conditional. If you think hello world should remain, then no change is needed. Assuming we want to change it, we should add a test case. Do you want me to take care of it? Love those breaking changes for correctness. :-/ This is why lines that start if (foo == null) should require papal dispensation. // null check cert #38828 granted by His Holiness Pope John Paul Secondus 19 Jan 2005 What would happen in this case? table.setWidget(0, 0, new Label(Dude!)); table.setWidget(0, 0, null); If the answer is that the widget will just stay there, it seems like we should make the fix, even on the chance it will cause some surprises for code relying on the unfriendly friendliness. And yes, if you could make that change it would be very kind of you. http://gwt-code-reviews.appspot.com/1295806/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
http://gwt-code-reviews.appspot.com/1346803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
Okay, ready for re-review. Less ambitious now. Allows foo.bar().baz().bang().imagineManyOfThese(hi mom); to wrap as: foo.bar().baz().bang() .imagineManyOfThese(hi mom); instead of what happens now: foo.bar().baz().bang().imagineManyOfThese( hi mom); On Wed, Feb 9, 2011 at 11:21 AM, rj...@google.com wrote: http://gwt-code-reviews.appspot.com/1346803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: - Use z-index to layer multiple notifications in hosted.html (issue1323801)
http://gwt-code-reviews.appspot.com/1323801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fix a NullPointerException in Editor framework when a null sub-Editor is encountered during trav... (issue1354802)
Reviewers: rjrjr, Description: Fix a NullPointerException in Editor framework when a null sub-Editor is encountered during traversal. Patch by: bobv Review by: rjrjr Please review this at http://gwt-code-reviews.appspot.com/1354802/show Affected files: M user/src/com/google/gwt/editor/client/impl/AbstractEditorContext.java M user/src/com/google/gwt/editor/client/impl/RootEditorContext.java M user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java M user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick patch, in follow up to r9344, which replaces remaining uses of the legacy 'compiler.emulat... (issue1338804)
http://gwt-code-reviews.appspot.com/1338804/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
On Wed, Feb 9, 2011 at 2:25 PM, Ray Ryan rj...@google.com wrote: Okay, ready for re-review. Less ambitious now. Allows foo.bar().baz().bang().imagineManyOfThese(hi mom); to wrap as: foo.bar().baz().bang() .imagineManyOfThese(hi mom); instead of what happens now: foo.bar().baz().bang().imagineManyOfThese( hi mom); One other thing to check is what sort of diffs show up if you do Ctrl-Alt-F on the whole codebase (just spot check of course). I think it is a problem if most files would change how they auto-format. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fixing a bug in DeckLayoutPanel where animating the current widget causes the current widget to ... (issue1354801)
LGTM http://gwt-code-reviews.appspot.com/1354801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick patch, in follow up to r9344, which replaces remaining uses of the legacy 'compiler.emulat... (issue1338804)
LGTM Rietveld has my username as bobv. http://gwt-code-reviews.appspot.com/1338804/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick patch, in follow up to r9344, which replaces remaining uses of the legacy 'compiler.emulat... (issue1338804)
LGTM http://gwt-code-reviews.appspot.com/1338804/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Untangle JSNI methods produced in CompilationStateBuilder to facilitate serialization. (issue1350801)
LGTM http://gwt-code-reviews.appspot.com/1350801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9705 committed - Fix a NullPointerException in Editor framework when a null sub-Editor ...
Revision: 9705 Author: gwt.mirror...@gmail.com Date: Wed Feb 9 12:06:22 2011 Log: Fix a NullPointerException in Editor framework when a null sub-Editor is encountered during traversal. Patch by: bobv Review by: rjrjr Review at http://gwt-code-reviews.appspot.com/1354802 http://code.google.com/p/google-web-toolkit/source/detail?r=9705 Modified: /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorContext.java /trunk/user/src/com/google/gwt/editor/client/impl/RootEditorContext.java /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java /trunk/user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java === --- /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorContext.java Mon Feb 7 09:56:00 2011 +++ /trunk/user/src/com/google/gwt/editor/client/impl/AbstractEditorContext.java Wed Feb 9 12:06:22 2011 @@ -41,11 +41,6 @@ private final LeafValueEditorT leafValueEditor; private final ValueAwareEditorT valueAwareEditor; - public AbstractEditorContext(AbstractEditorDelegateT, ? delegate) { -this(delegate.getEditor(), delegate.getPath()); -this.delegate = delegate; - } - public AbstractEditorContext(EditorT editor, String path) { this.editor = editor; this.path = path; @@ -122,6 +117,10 @@ public boolean isHalted() { return isHalted; } + + public void setEditorDelegate(AbstractEditorDelegateT, ? delegate) { +this.delegate = delegate; + } public abstract void setInModel(T data); === --- /trunk/user/src/com/google/gwt/editor/client/impl/RootEditorContext.java Wed Feb 2 03:25:11 2011 +++ /trunk/user/src/com/google/gwt/editor/client/impl/RootEditorContext.java Wed Feb 9 12:06:22 2011 @@ -28,7 +28,8 @@ public RootEditorContext(AbstractEditorDelegateT, ? editorDelegate, ClassT editedType, T value) { -super(editorDelegate); +super(editorDelegate.getEditor(), editorDelegate.getPath()); +setEditorDelegate(editorDelegate); this.editedType = editedType; this.value = value; } === --- /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java Wed Feb 2 03:25:11 2011 +++ /trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java Wed Feb 9 12:06:22 2011 @@ -27,7 +27,6 @@ import com.google.gwt.editor.client.Editor; import com.google.gwt.editor.client.EditorVisitor; import com.google.gwt.editor.client.impl.AbstractEditorContext; -import com.google.gwt.editor.client.impl.AbstractEditorDelegate; import com.google.gwt.editor.client.impl.RootEditorContext; import com.google.gwt.editor.rebind.model.EditorData; import com.google.gwt.editor.rebind.model.EditorModel; @@ -192,17 +191,18 @@ sw.println(getEditorChain().accept(visitor);); } for (EditorData d : data) { +if (d.isDelegateRequired()) { + sw.println(if (%s != null) , delegateFields.get(d)); +} sw.println({); sw.indent(); String editorContextName = getEditorContext(delegateData, d); +sw.println( +%s ctx = new %s(getObject(), editor.%s, appendPath(\%s\));, +editorContextName, editorContextName, d.getSimpleExpression(), +d.getDeclaredPath()); if (d.isDelegateRequired()) { - sw.println(%s ctx = new %s(getObject(), %s);, editorContextName, - editorContextName, delegateFields.get(d)); -} else { - sw.println( - %s ctx = new %s(getObject(), editor.%s, appendPath(\%s\));, - editorContextName, editorContextName, d.getSimpleExpression(), - d.getDeclaredPath()); + sw.println(ctx.setEditorDelegate(%s);, delegateFields.get(d)); } sw.println(ctx.traverse(visitor, %s);, d.isDelegateRequired() ? delegateFields.get(d) : null); @@ -250,19 +250,13 @@ if (pw != null) { ClassSourceFileComposerFactory f = new ClassSourceFileComposerFactory( pkg, simpleName); - String editedSourceName = data.getEditedType().getQualifiedSourceName(); + String editedSourceName = data.getEditedType().getParameterizedQualifiedSourceName(); f.setSuperclass(AbstractEditorContext.class.getCanonicalName() + + editedSourceName + ); SourceWriter sw = f.createSourceWriter(context, pw); String parentSourceName = parent.getEditedType().getQualifiedSourceName(); sw.println(private final %s parent;, parentSourceName); - sw.println(public %s(%s parent, %s%s, ? delegate) {, simpleName, - parentSourceName, AbstractEditorDelegate.class.getCanonicalName(), - editedSourceName); - sw.indentln(super(delegate);); - sw.indentln(this.parent = parent;); - sw.println(}); sw.println(public %s(%s parent, %s%s editor, String
[gwt-contrib] [google-web-toolkit] r9706 committed - Fix TestUtil.PathImpl to correctly test for non matching...
Revision: 9706 Author: ncha...@google.com Date: Wed Feb 9 08:55:13 2011 Log: Fix TestUtil.PathImpl to correctly test for non matching RegExp groups. getGroup returns null or depending on the browser. [JSR 303 TCK Result] 93 of 257 (36.19%) Pass with 33 Failures and 14 Errors. Review at http://gwt-code-reviews.appspot.com/1352801 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9706 Modified: /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java /trunk/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/util/TestUtil.java === --- /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java Mon Feb 7 07:41:58 2011 +++ /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java Wed Feb 9 08:55:13 2011 @@ -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 @@ -23,6 +23,7 @@ * Wraps {@link ConstraintCompositionTest}. */ public class ConstraintCompositionGwtTest extends GWTTestCase { + private final ConstraintCompositionTest delegate = new ConstraintCompositionTest(); @Override @@ -40,16 +41,12 @@ delegate.testAttributesDefinedOnComposingConstraints(); } - @Failing(issue = 5882) public void testComposedConstraints() { delegate.testComposedConstraints(); -fail(This test only fails on IE. Forcing it to fail here to keep the counts even. See issue 5882.); } - @Failing(issue = 5882) public void testComposedConstraintsAreRecursive() { delegate.testComposedConstraintsAreRecursive(); -fail(This test only fails on IE. Forcing it to fail here to keep the counts even. See issue 5882.); } @Failing(issue = 5799) === --- /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java Mon Feb 7 07:41:58 2011 +++ /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java Wed Feb 9 08:55:13 2011 @@ -30,10 +30,8 @@ return org.hibernate.jsr303.tck.tests.constraints.customconstraint.TckTest; } - @Failing(issue = 5882) public void testDefaultPropertyPath() { delegate.testDefaultPropertyPath(); -fail(This test only fails on IE. Forcing it to fail here to keep the counts even. See issue 5882.); } @Failing(issue = 5800) === --- /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java Mon Feb 7 07:41:58 2011 +++ /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java Wed Feb 9 08:55:13 2011 @@ -34,10 +34,8 @@ delegate.testAmbiguousValidatorResolution(); } - @Failing(issue = 5882) public void testResolutionOfMinMaxForDifferentTypes() { delegate.testResolutionOfMinMaxForDifferentTypes(); -fail(This test only fails on IE. Forcing it to fail here to keep the counts even. See issue 5882.); } @Failing(issue = 5806) === --- /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java Mon Feb 7 10:54:02 2011 +++ /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java Wed Feb 9 08:55:13 2011 @@ -30,10 +30,8 @@ delegate.testConstraintDescriptorWithoutExplicitGroup(); } - @Failing(issue = 5882) public void testConstraintViolation() { delegate.testConstraintViolation(); -fail(This test only fails on IE. Forcing it to fail here to keep the counts even. See issue 5882.); } @Failing(issue = 5982) === --- /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java Mon Feb 7 07:41:58 2011 +++
[gwt-contrib] Re: Recompute whether an interface is dual-implemented by JSO and Java types after each compiler opt... (issue1351801)
On Wed, Feb 9, 2011 at 3:36 PM, cromwell...@google.com wrote: It is strange, then again, it is strange that a JSO that is null can still be invoked. :) However, I think I've come back to sanity on rethinking this. Since it is only used for a single use case in my Json library (JsonNull), I think I'll just change the API slightly. I wanted an unwrapped JsonNull to represent json nulls (most APIs use a Java wrapper). Instead, I'll just use the real 'null', and add an extra method to check for the difference between 'null' and undefined. Thanks. :) It would seem really strange if all Java nulls were implicitly treated as JSOs! This is a different issue, and my gut says they will only partially get cleaned up. Consider: Cast.isJavaObject(foo) ? foo.method() : Jso$foo$method(); Maybe that pass is simply generating the wrong code. I'm not saying this, by itself, would work, but maybe the right solution involves generating something like: (foo instanceof JavaScriptObject) ? JsoFoo.$method(foo) : foo.method() So that dead code can optimize the instanceof test at some point. Or, maybe we should leave the call site alone initially... If we model the JSO method as having an upref to the interface method, CFA and TypeTightener might do the right things implicitly, then we modify the appropriate optimizer pass to convert the interface call into the JSO direct call if that's the only viable option. Then we add the appropriate logic to JsoDevirtualizer to handler this post-optimization for cases that still exist. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Remove a bunch of unused SOYC infrastructure. (issue1345801)
LGTM http://gwt-code-reviews.appspot.com/1345801/diff/2001/2004 File dev/core/src/com/google/gwt/core/ext/soyc/Member.java (left): http://gwt-code-reviews.appspot.com/1345801/diff/2001/2004#oldcode44 dev/core/src/com/google/gwt/core/ext/soyc/Member.java:44: Hypothetically, would the soyc-generator be able to get this info from the symbolMaps file anyway? http://gwt-code-reviews.appspot.com/1345801/diff/2001/2019 File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java (left): http://gwt-code-reviews.appspot.com/1345801/diff/2001/2019#oldcode963 dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:963: SourceInfo sourceInfo = program.createSourceInfoSynthetic( A little unfortunate, since it is nice to be able to track how big the bootstrap or stats stuff is. If we used separate token class literals like JavaToJavaScriptCompiler.BootStrap.class, it might restore some ability to disambiguate these synthetics. http://gwt-code-reviews.appspot.com/1345801/diff/2001/2024 File dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java (right): http://gwt-code-reviews.appspot.com/1345801/diff/2001/2024#newcode588 dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java:588: // and line number. Interesting idea, although there might be some overhead from throwing/catching a large number of exceptions. A quicker hack is to just require unique tokens, e.g. interface FooSourceLocation{} http://gwt-code-reviews.appspot.com/1345801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Simplify JArrayType handling; reduce serialization footprint. (issue1352803)
Reviewers: jbrosenberg, cromwellian, Please review this at http://gwt-code-reviews.appspot.com/1352803/show Affected files: M dev/core/src/com/google/gwt/dev/jjs/ast/JArrayType.java M dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java M dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java M dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter.java M dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/ToStringGenerationVisitor.java M dev/core/src/com/google/gwt/dev/jjs/impl/TypeMap.java M dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java M dev/core/test/com/google/gwt/dev/jjs/JjsTypeTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Refactor SOYC to reduce memory footprint. (issue1352804)
Reviewers: cromwellian, Description: Before: correlations from parents get copied to every single child SourceInfoCorrelation, using lots of extra memory. After: SourceInfoCorrelations have parent pointers, and the list of correlations is computed on demand, saving a lot of memory. Other changes: - Got rid of the idea of merging and having more than one correlation of a given type per node. These features were only used in practice a couple of minor cases (static evaluation of string concats, for example). - Generally, not routing through JProgram to create child nodes. - Cleaned up a couple of wrongful/wonky attributes. - Output is nearly identical after this change. Please review this at http://gwt-code-reviews.appspot.com/1352804/show Affected files: M dev/core/src/com/google/gwt/core/ext/soyc/impl/StoryRecorder.java M dev/core/src/com/google/gwt/dev/jjs/SourceInfo.java M dev/core/src/com/google/gwt/dev/jjs/SourceInfoCorrelation.java M dev/core/src/com/google/gwt/dev/jjs/SourceOrigin.java M dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java M dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/JsoDevirtualizer.java M dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java M dev/core/src/com/google/gwt/dev/jjs/impl/ResolveRebinds.java M dev/core/src/com/google/gwt/dev/js/JsParser.java M dev/core/src/com/google/gwt/dev/js/JsStaticEval.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9708 committed - Sort the top level validator class to handle most specific classes fir...
Revision: 9708 Author: gwt.mirror...@gmail.com Date: Wed Feb 9 13:27:07 2011 Log: Sort the top level validator class to handle most specific classes first. [JSR 303 TCK Result] 87 of 257 (33.85%) Pass with 39 Failures and 14 Errors. Review at http://gwt-code-reviews.appspot.com/1346804 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9708 Modified: /trunk/user/src/com/google/gwt/validation/rebind/Util.java /trunk/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java /trunk/user/test/com/google/gwt/validation/rebind/UtilTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java /trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTestValidatorFactory.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTestValidatorFactory.java === --- /trunk/user/src/com/google/gwt/validation/rebind/Util.java Mon Feb 7 07:41:58 2011 +++ /trunk/user/src/com/google/gwt/validation/rebind/Util.java Wed Feb 9 13:27:07 2011 @@ -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 @@ -22,10 +22,10 @@ import com.google.gwt.thirdparty.guava.common.collect.ImmutableSet; import com.google.gwt.thirdparty.guava.common.collect.Iterables; import com.google.gwt.thirdparty.guava.common.collect.Lists; -import com.google.gwt.thirdparty.guava.common.collect.Ordering; import com.google.gwt.thirdparty.guava.common.collect.Sets; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Set; @@ -37,14 +37,14 @@ /** * Creates a Predicate that returns false if source contains an associated * class that is a super type of the class associated with the tested T. - * + * * @param T the type to test - * @param source the Set of T to look for class matches. + * @param source the set of T to look for class matches. * @param toClass Function from T to Class * @return newly create predicate. */ - static T PredicateT createMostSpecificMatchPredicate(final SetT source, - final FunctionT, Class? toClass) { + static T PredicateT createMostSpecificMatchPredicate( + final IterableT source, final FunctionT, Class? toClass) { return new PredicateT() { public boolean apply(T input) { @@ -62,7 +62,7 @@ /** * Selects first only the classes that are assignable from the target, and * then returns the most specific matching classes. - * + * * @param target the Class to match * @param availableClasses classes to search * @return Set of only the most specific classes that match the target. @@ -91,16 +91,24 @@ */ static T ImmutableListT sortMostSpecificFirst(IterableT classes, FunctionT, Class? toClass) { -SetT working = Sets.newHashSet(classes); +ListT working = Lists.newArrayList(); +// strip duplicates +for (T t : classes) { + if (!working.contains(t)) { +working.add(t); + } +} ListT sorted = Lists.newArrayList(); -PredicateT mostSpecific = createMostSpecificMatchPredicate(working, toClass); +PredicateT mostSpecific = createMostSpecificMatchPredicate(working, +toClass); boolean changed = false; do { changed = false; - for (T t : Ordering.usingToString().sortedCopy(working)) { + for (IteratorT iterator = working.iterator(); iterator.hasNext();) { +T t = iterator.next(); if (mostSpecific.apply(t)) { sorted.add(t); - working.remove(t); + iterator.remove(); changed = true; } } === --- /trunk/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java Mon Feb 7 07:41:58 2011 +++ /trunk/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java Wed Feb 9 13:27:07 2011 @@ -20,6 +20,7 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.thirdparty.guava.common.collect.ImmutableList; import com.google.gwt.thirdparty.guava.common.collect.Lists; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; @@ -43,10 +44,9 @@ /** *
[gwt-contrib] Re: Simplify JArrayType handling; reduce serialization footprint. (issue1352803)
LGTM. I don't its worth nuking the 'dims' field, I mean, feel free, but I'm ok with leaving it as a transient cache. http://gwt-code-reviews.appspot.com/1352803/diff/1/5 File dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java (right): http://gwt-code-reviews.appspot.com/1352803/diff/1/5#newcode195 dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java:195: leafQueryId = program.getQueryId(((JReferenceType) elementType).getUnderlyingType()); 80 cols? http://gwt-code-reviews.appspot.com/1352803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9709 committed - Quick patch, in follow up to r9344, which replaces remaining uses of t...
Revision: 9709 Author: fre...@google.com Date: Wed Feb 9 11:45:33 2011 Log: Quick patch, in follow up to r9344, which replaces remaining uses of the legacy 'compiler.emulatedStack' property, with the corresponding 'compiler.stackMode'. Fixes issues: 5692 Review at http://gwt-code-reviews.appspot.com/1338804 Review by: jlaba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9709 Modified: /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java === --- /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml Thu Oct 14 08:15:26 2010 +++ /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml Wed Feb 9 11:45:33 2011 @@ -32,7 +32,7 @@ set-property name=gwt.logging.simpleRemoteHandler value=DISABLED / !-- Uncomment if you are enabling server side deobfuscation of StackTraces - set-property name=compiler.emulatedStack value=true / + set-property name=compiler.stackMode value=emulated / set-configuration-property name=compiler.emulatedStack.recordLineNumbers value=true / set-configuration-property name=compiler.emulatedStack.recordFileNames value=true / -- === --- /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml Mon Jun 7 12:20:31 2010 +++ /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml Wed Feb 9 11:45:33 2011 @@ -26,7 +26,7 @@ !-- We do not want stack traces. -- set-configuration-property name=compiler.emulatedStack.recordFileNames value=false / - set-property name=compiler.emulatedStack value=false / + set-property name=compiler.stackMode value=native / generate-with class=com.google.gwt.benchmarks.rebind.BenchmarkGenerator when-type-assignable class=com.google.gwt.benchmarks.client.Benchmark/ === --- /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml Thu Dec 9 04:33:35 2010 +++ /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml Wed Feb 9 11:45:33 2011 @@ -33,7 +33,7 @@ !-- We want to provide consistent stack traces across all browsers. -- set-configuration-property name=compiler.emulatedStack.recordFileNames value=true / - set-property name=compiler.emulatedStack value=true / + set-property name=compiler.stackMode value=emulated / !-- Override the regular symbolMaps linker to put the data somewhere we can find it -- define-linker name=symbolMaps class=com.google.gwt.junit.linker.JUnitSymbolMapsLinker / === --- /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java Mon Jan 24 18:37:39 2011 +++ /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java Wed Feb 9 11:45:33 2011 @@ -31,7 +31,7 @@ /** * Deobfuscates stack traces on the server side. This class requires that you * have turned on emulated stack traces, via - * codelt;set-property name=compiler.emulatedStack value=true /gt;/code + * codelt;set-property name=compiler.stackMode value=emulated /gt;/code * in your code.gwt.xml/code module file, and moved your symbol map files to * a location accessible by your server sever side code. You can use the GWT * compiler code-deploy/code command line argument to specify the location -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] TypeOracle to allow access to the list of annotations on an element. (issue1352805)
Reviewers: tobyr, schmitt_google.com, Description: This brings HasAnnotations up to spec with java.lang.reflect.AnnotatedElement. Please review this at http://gwt-code-reviews.appspot.com/1352805/show Affected files: M dev/core/src/com/google/gwt/core/ext/typeinfo/HasAnnotations.java M dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JAbstractMethod.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JArrayType.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JClassType.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JDelegatingClassType.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JField.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JPackage.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JParameter.java M dev/core/src/com/google/gwt/dev/javac/typemodel/JRealClassType.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TypeOracle to allow access to the list of annotations on an element. (issue1352805)
http://gwt-code-reviews.appspot.com/1352805/diff/1/3 File dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java (right): http://gwt-code-reviews.appspot.com/1352805/diff/1/3#newcode110 dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java:110: Collections.sort(values, ANNOTATION_COMPARATOR); Is information being lost here by sorting? Ie, do the order of annotations have to match the source, and if so, could that affect how they are interpreted? http://gwt-code-reviews.appspot.com/1352805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TypeOracle to allow access to the list of annotations on an element. (issue1352805)
http://gwt-code-reviews.appspot.com/1352805/diff/1/3 File dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java (right): http://gwt-code-reviews.appspot.com/1352805/diff/1/3#newcode110 dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java:110: Collections.sort(values, ANNOTATION_COMPARATOR); The incoming order is based on a plain HashMap, so the order already doesn't match source order. I don't think there's any expectation that the list here should match source order, it really doesn't matter. http://gwt-code-reviews.appspot.com/1352805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Simplify JArrayType handling; reduce serialization footprint. (issue1352803)
http://gwt-code-reviews.appspot.com/1352803/diff/1/5 File dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java (right): http://gwt-code-reviews.appspot.com/1352803/diff/1/5#newcode195 dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java:195: leafQueryId = program.getQueryId(((JReferenceType) elementType).getUnderlyingType()); My autoformatter doesn't want to wrap this; but I hear they're working on some new settings. http://gwt-code-reviews.appspot.com/1352803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TypeOracle to allow access to the list of annotations on an element. (issue1352805)
LGTM http://gwt-code-reviews.appspot.com/1352805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Delegate Html element type lookups to a pluggable factory. (issue1352802)
LGTM http://gwt-code-reviews.appspot.com/1352802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9711 committed - Simplify JArrayType handling; reduce serialization footprint....
Revision: 9711 Author: sco...@google.com Date: Wed Feb 9 13:07:01 2011 Log: Simplify JArrayType handling; reduce serialization footprint. http://gwt-code-reviews.appspot.com/1352803/show Review by: cromwell...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9711 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JArrayType.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ArrayNormalizer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ToStringGenerationVisitor.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeMap.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java /trunk/dev/core/test/com/google/gwt/dev/jjs/JjsTypeTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JArrayType.java Wed Feb 9 11:52:03 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JArrayType.java Wed Feb 9 13:07:01 2011 @@ -22,24 +22,15 @@ */ public class JArrayType extends JReferenceType { - private static String calcName(JType leafType, int dims) { -String name = leafType.getName(); -for (int i = 0; i dims; ++i) { - name = name + []; -} -return name; - } - - private int dims; - private JType elementType; - private JType leafType; - - public JArrayType(JType elementType, JType leafType, int dims) { -super(leafType.getSourceInfo().makeChild(SourceOrigin.UNKNOWN), calcName( -leafType, dims)); + private transient int dims = 0; + private final JType elementType; + private transient JType leafType = null; + + public JArrayType(JType elementType) { +super(elementType.getSourceInfo().makeChild(SourceOrigin.UNKNOWN), +elementType.getName() + []); +assert !(elementType instanceof JNonNullType); this.elementType = elementType; -this.leafType = leafType; -this.dims = dims; } @Override @@ -48,6 +39,12 @@ } public int getDims() { +if (dims == 0) { + dims = 1; + if (elementType instanceof JArrayType) { +dims += ((JArrayType) elementType).getDims(); + } +} return dims; } @@ -57,23 +54,22 @@ @Override public String getJavahSignatureName() { -String s = leafType.getJavahSignatureName(); -for (int i = 0; i dims; ++i) { - s = _3 + s; -} -return s; +return _3 + elementType.getJavahSignatureName(); } @Override public String getJsniSignatureName() { -String s = leafType.getJsniSignatureName(); -for (int i = 0; i dims; ++i) { - s = [ + s; -} -return s; +return [ + elementType.getJsniSignatureName(); } public JType getLeafType() { +if (leafType == null) { + if (elementType instanceof JArrayType) { +leafType = ((JArrayType) elementType).getLeafType(); + } else { +leafType = elementType; + } +} return leafType; } @@ -87,7 +83,7 @@ } public boolean isFinal() { -return leafType.isFinal(); +return elementType.isFinal(); } public void traverse(JVisitor visitor, Context ctx) { === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java Wed Feb 9 11:52:03 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java Wed Feb 9 13:07:01 2011 @@ -46,7 +46,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.TreeSet; /** * Root for the AST representing an entire Java program. @@ -316,17 +315,13 @@ public final JTypeOracle typeOracle = new JTypeOracle(this); - /** - * Sorted to avoid nondeterministic iteration. - */ - private final SetJArrayType allArrayTypes = new TreeSetJArrayType( - ARRAYTYPE_COMPARATOR); - /** * Special serialization treatment. */ private transient ListJDeclaredType allTypes = new ArrayListJDeclaredType(); + private final HashMapJType, JArrayType arrayTypes = new HashMapJType, JArrayType(); + private final MapJType, JClassLiteral classLiterals = new IdentityHashMapJType, JClassLiteral(); /** @@ -334,13 +329,6 @@ */ private final CorrelationFactory correlator; - /** - * Each entry is a HashMap(JType = JArrayType), arranged such that the number - * of dimensions is that index (plus one) at which the JArrayTypes having that - * number of dimensions resides. - */ - private final ArrayListHashMapJType, JArrayType dimensions = new ArrayListHashMapJType, JArrayType(); - private final MapString,
[gwt-contrib] [google-web-toolkit] r9712 committed - TypeOracle to allow access to the list of annotations on an element....
Revision: 9712 Author: gwt.mirror...@gmail.com Date: Wed Feb 9 13:08:24 2011 Log: TypeOracle to allow access to the list of annotations on an element. This brings HasAnnotations up to spec with java.lang.reflect.AnnotatedElement. http://gwt-code-reviews.appspot.com/1352805/show Review by: to...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9712 Modified: /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/HasAnnotations.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JAbstractMethod.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JArrayType.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JClassType.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JDelegatingClassType.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JField.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JPackage.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JParameter.java /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JRealClassType.java === --- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/HasAnnotations.java Wed Feb 13 11:40:04 2008 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/HasAnnotations.java Wed Feb 9 13:08:24 2011 @@ -35,6 +35,17 @@ */ T extends Annotation T getAnnotation(ClassT annotationClass); + /** + * Returns all the annotations present on this element. + */ + Annotation[] getAnnotations(); + + /** + * Returns the annotations declared directly on this element; does not include + * any inherited annotations. + */ + Annotation[] getDeclaredAnnotations(); + /** * Returns codetrue/code if this item has an annotation of the specified * type. === --- /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java Thu Dec 9 10:54:59 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java Wed Feb 9 13:08:24 2011 @@ -21,7 +21,10 @@ import java.lang.annotation.Annotation; import java.lang.annotation.Inherited; -import java.util.Collection; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -30,6 +33,18 @@ */ class Annotations implements HasAnnotations { + private static final ComparatorAnnotation ANNOTATION_COMPARATOR = new ComparatorAnnotation() { +/** + * An element can only be annotated with one annotation of a particular + * type. So we only need to sort by annotation type name, since there won't + * be any duplicates. + */ +public int compare(Annotation o1, Annotation o2) { + return o1.annotationType().getName().compareTo( + o2.annotationType().getName()); +} + }; + private static MapClass? extends Annotation, Annotation copyOfAnnotations( Annotations otherAnnotations) { MapClass? extends Annotation, Annotation declaredAnnotations = new HashMapClass? extends Annotation, Annotation(); @@ -90,12 +105,16 @@ public Annotation[] getAnnotations() { initializeAnnotations(); -CollectionAnnotation values = lazyAnnotations.values(); +ListAnnotation values = new ArrayListAnnotation( +lazyAnnotations.values()); +Collections.sort(values, ANNOTATION_COMPARATOR); return values.toArray(new Annotation[values.size()]); } public Annotation[] getDeclaredAnnotations() { -CollectionAnnotation values = declaredAnnotations.values(); +ListAnnotation values = new ArrayListAnnotation( +declaredAnnotations.values()); +Collections.sort(values, ANNOTATION_COMPARATOR); return values.toArray(new Annotation[values.size()]); } === --- /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JAbstractMethod.java Thu Dec 9 10:54:59 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JAbstractMethod.java Wed Feb 9 13:08:24 2011 @@ -76,6 +76,14 @@ public T extends Annotation T getAnnotation(ClassT annotationClass) { return annotations.getAnnotation(annotationClass); } + + public Annotation[] getAnnotations() { +return annotations.getAnnotations(); + } + + public Annotation[] getDeclaredAnnotations() { +return annotations.getDeclaredAnnotations(); + } /** * Gets the type in which this method or constructor was declared. @@ -232,20 +240,6 @@ void addThrows(JClassType type) { thrownTypes = Lists.add(thrownTypes, type); } - - /** - * NOTE: This method is for testing purposes only. - */ - Annotation[] getAnnotations() { -return annotations.getAnnotations(); - } - - /** - * NOTE: This method is for testing purposes only. - */ - Annotation[] getDeclaredAnnotations() { -return
[gwt-contrib] Re: Fix a NullPointerException in Editor framework when a null sub-Editor is encountered during trav... (issue1354802)
LGTM http://gwt-code-reviews.appspot.com/1354802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TypeOracle to allow access to the list of annotations on an element. (issue1352805)
http://gwt-code-reviews.appspot.com/1352805/diff/1/3 File dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java (right): http://gwt-code-reviews.appspot.com/1352805/diff/1/3#newcode110 dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java:110: Collections.sort(values, ANNOTATION_COMPARATOR); What's the reason for sorting the returned annotations? As you mention, no caller will assume any kind of sorting so it looks just like extra work? Without explicitly sorting, the values will come in a random order due to HashMap and default Object hashCode. If a caller then naively iterates over the returned array, producing code, the code being produced will be non-determinstic. This leads to 'jitter' in the compiled output for the same input, which we try very hard to avoid. http://gwt-code-reviews.appspot.com/1352805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TypeOracle to allow access to the list of annotations on an element. (issue1352805)
http://gwt-code-reviews.appspot.com/1352805/diff/1/3 File dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java (right): http://gwt-code-reviews.appspot.com/1352805/diff/1/3#newcode110 dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java:110: Collections.sort(values, ANNOTATION_COMPARATOR); If you are going to sort it, I would suggest documenting it in HasAnnotations so that a caller can at least do a binary search instead of a linear one. http://gwt-code-reviews.appspot.com/1352805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Follow on to svn r8671, which made the GWT code style allow whitespace (issue1346803)
I did the spot check that John suggested. Most files stay more or less in tact. The ones that do change look a lot more readable in the new style, IMHO. E.g., try using this style on RequestFactoryTest (Bob, you in particular might want to weigh in here). On Wed, Feb 9, 2011 at 12:36 PM, zun...@google.com wrote: LGTM http://gwt-code-reviews.appspot.com/1346803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] CollectorNull should not set stack traces when stack stripping is enabled. Throwable.getStackTra... (issue1355801)
Reviewers: bobv, rjrjr, Description: CollectorNull should not set stack traces when stack stripping is enabled. Throwable.getStackTrace() already handles the case of a null stack trace and constructs an empty array. Please review this at http://gwt-code-reviews.appspot.com/1355801/show Affected files: M dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java M dev/core/src/com/google/gwt/dev/jjs/impl/FragmentExtractor.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java A dev/core/src/com/google/gwt/dev/jjs/impl/SeedUtil.java M dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java M user/src/com/google/gwt/core/client/impl/StackTraceCreator.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: CollectorNull should not set stack traces when stack stripping is enabled. Throwable.getStackTra... (issue1355801)
http://gwt-code-reviews.appspot.com/1355801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9714 committed - Fix tab char
Revision: 9714 Author: cromwell...@google.com Date: Wed Feb 9 14:35:38 2011 Log: Fix tab char http://code.google.com/p/google-web-toolkit/source/detail?r=9714 Modified: /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java Wed Feb 9 13:31:48 2011 +++ /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java Wed Feb 9 14:35:38 2011 @@ -38,7 +38,7 @@ FieldManager fieldManager, MessagesWriter messagesWriter, HtmlElementFactory factory) throws UnableToCompleteException { super(baseClass, implClassName, templatePath, oracle, logger, fieldManager, - messagesWriter, DesignTimeUtilsStub.EMPTY, new UiBinderContext(), + messagesWriter, DesignTimeUtilsStub.EMPTY, new UiBinderContext(), factory); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9713 committed - Delegate Html element type lookups to a pluggable factory....
Revision: 9713 Author: gwt.mirror...@gmail.com Date: Wed Feb 9 16:43:56 2011 Log: Delegate Html element type lookups to a pluggable factory. Review at http://gwt-code-reviews.appspot.com/1352802 Review by: rj...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9713 Added: /trunk/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java /trunk/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Modified: /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/ElementParserTester.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java Wed Feb 9 16:43:56 2011 @@ -0,0 +1,43 @@ +/* + * Copyright 2011 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.rebind; + +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.TypeOracle; +import com.google.gwt.dom.client.TagName; + +/** + * Looks up implementation of DOM elements via @TagName interface in GWT DOM + * package. + */ +public class GwtDomHtmlElementFactory implements HtmlElementFactory { + + public JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle) { +JClassType elementClass = oracle.findType(com.google.gwt.dom.client.Element); +JClassType[] types = elementClass.getSubtypes(); +for (JClassType type : types) { + TagName annotation = type.getAnnotation(TagName.class); + if (annotation != null) { +for (String annotationTag : annotation.value()) { + if (annotationTag.equals(htmlTag)) { +return type; + } +} + } +} +return elementClass; + } +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Wed Feb 9 16:43:56 2011 @@ -0,0 +1,27 @@ +/* + * Copyright 2011 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.rebind; + +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.TypeOracle; + +/** + * Looks up html tag names and returns corresponding type used to represent + * its bindings. + */ +public interface HtmlElementFactory { + JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle); +} === --- /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Mon Jun 14 13:37:36 2010 +++ /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Wed Feb 9 13:31:48 2011 @@ -18,7 +18,9 @@ source path=client/ source path=resources/ - + !-- Pluggable factory for creating field types for HTML elements -- + define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ + set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ generate-with class=com.google.gwt.uibinder.rebind.UiBinderGenerator when-type-assignable class=com.google.gwt.uibinder.client.UiBinder/ /generate-with === --- /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Sat Sep 18 08:30:48 2010 +++ /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Wed Feb 9 13:31:48 2011 @@ -15,8 +15,10 @@ */ package com.google.gwt.uibinder.rebind; +import com.google.gwt.core.ext.ConfigurationProperty; import com.google.gwt.core.ext.Generator; import com.google.gwt.core.ext.GeneratorContext; +import com.google.gwt.core.ext.PropertyOracle; import
[gwt-contrib] [google-web-toolkit] r9715 committed - Rolling back r9709, which replaced remaining uses of the legacy 'compi...
Revision: 9715 Author: gwt.mirror...@gmail.com Date: Wed Feb 9 21:02:18 2011 Log: Rolling back r9709, which replaced remaining uses of the legacy 'compiler.emulatedStack' property with the corresponding 'compiler.stackMode'. Fixes issues: 5692 Review at http://gwt-code-reviews.appspot.com/1338804 Review by: atr...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9715 Modified: /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java === --- /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml Wed Feb 9 11:45:33 2011 +++ /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml Wed Feb 9 17:34:26 2011 @@ -32,7 +32,7 @@ set-property name=gwt.logging.simpleRemoteHandler value=DISABLED / !-- Uncomment if you are enabling server side deobfuscation of StackTraces - set-property name=compiler.stackMode value=emulated / + set-property name=compiler.emulatedStack value=true / set-configuration-property name=compiler.emulatedStack.recordLineNumbers value=true / set-configuration-property name=compiler.emulatedStack.recordFileNames value=true / -- === --- /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml Wed Feb 9 11:45:33 2011 +++ /trunk/user/src/com/google/gwt/benchmarks/Benchmarks.gwt.xml Wed Feb 9 17:34:26 2011 @@ -26,7 +26,7 @@ !-- We do not want stack traces. -- set-configuration-property name=compiler.emulatedStack.recordFileNames value=false / - set-property name=compiler.stackMode value=native / + set-property name=compiler.emulatedStack value=false / generate-with class=com.google.gwt.benchmarks.rebind.BenchmarkGenerator when-type-assignable class=com.google.gwt.benchmarks.client.Benchmark/ === --- /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml Wed Feb 9 11:45:33 2011 +++ /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml Wed Feb 9 17:34:26 2011 @@ -33,7 +33,7 @@ !-- We want to provide consistent stack traces across all browsers. -- set-configuration-property name=compiler.emulatedStack.recordFileNames value=true / - set-property name=compiler.stackMode value=emulated / + set-property name=compiler.emulatedStack value=true / !-- Override the regular symbolMaps linker to put the data somewhere we can find it -- define-linker name=symbolMaps class=com.google.gwt.junit.linker.JUnitSymbolMapsLinker / === --- /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java Wed Feb 9 11:45:33 2011 +++ /trunk/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java Wed Feb 9 17:34:26 2011 @@ -31,7 +31,7 @@ /** * Deobfuscates stack traces on the server side. This class requires that you * have turned on emulated stack traces, via - * codelt;set-property name=compiler.stackMode value=emulated /gt;/code + * codelt;set-property name=compiler.emulatedStack value=true /gt;/code * in your code.gwt.xml/code module file, and moved your symbol map files to * a location accessible by your server sever side code. You can use the GWT * compiler code-deploy/code command line argument to specify the location -- http://groups.google.com/group/Google-Web-Toolkit-Contributors