[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread Eric Ayers
@Bob, Could we just generate a strong name seeded from the fully
parameterized type name  instead to solve both issues?

If this is going to have a good chance of affecting generators other
than the Editor Framework, I think we should make the file creation
non-fatal.

On Fri, Apr 1, 2011 at 8:00 PM,   wrote:
> http://gwt-code-reviews.appspot.com/1357804/
>



-- 
Eric Z. Ayers
Google Web Toolkit, Atlanta, GA USA

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Issue 6193: Fix memory-leak in WeakMapping when the value holds a reference on the key (issue1401802)

2011-04-01 Thread t . broyer

Reviewers: rjrjr, bobv,

Description:
Issue 6193: Fix memory-leak in WeakMapping when the value holds a
reference on the key

http://code.google.com/p/google-web-toolkit/issues/detail?id=6193

Fix memory-leak in WeakMapping when the value holds a reference on the
key, which prevents the entry from being garbage collected.

We've run with this fix for a whole week and had no (reported) issue.

Please review this at http://gwt-code-reviews.appspot.com/1401802/

Affected files:
  M user/src/com/google/gwt/core/client/impl/WeakMapping.java


Index: user/src/com/google/gwt/core/client/impl/WeakMapping.java
diff --git a/user/src/com/google/gwt/core/client/impl/WeakMapping.java  
b/user/src/com/google/gwt/core/client/impl/WeakMapping.java
index  
435816c0a15f8b879a432f909770a187babf3fda..37f21d752fade7f456cbdc15bb97afdb49b75644  
100644

--- a/user/src/com/google/gwt/core/client/impl/WeakMapping.java
+++ b/user/src/com/google/gwt/core/client/impl/WeakMapping.java
@@ -93,7 +93,8 @@ public class WeakMapping {
* identity. Weak references are used to allow otherwise unreferenced  
Objects

* to be garbage collected.
*/
-  private static Map> map = new  
HashMap>();
+  private static MapWeakReference>> map =
+new HashMapWeakReference>>();


   /**
* A ReferenceQueue used to clean up the map as its keys are
@@ -113,7 +114,7 @@ public class WeakMapping {
 cleanup();

 Object ref = new IdentityWeakReference(instance, queue);
-Map m = map.get(ref);
+Map> m = map.get(ref);
 if (m == null) {
   return null;
 }
@@ -143,12 +144,12 @@ public class WeakMapping {
 }

 IdentityWeakReference ref = new IdentityWeakReference(instance, queue);
-Map m = map.get(ref);
+Map> m = map.get(ref);
 if (m == null) {
-  m = new HashMap();
+  m = new HashMap>();
   map.put(ref, m);
 }
-m.put(key, value);
+m.put(key, new WeakReference(value));
   }

   /**


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Issues 6206 and 6216: CellWidget's getValue is never updated by the Cell (issue1400802)

2011-04-01 Thread t . broyer

Reviewers: jlabanca, sbrubaker,

Description:
Issues 6206 and 6216: CellWidget's getValue is never updated by the Cell

Issue 6206: CellWidget should be IsEditor>
http://code.google.com/p/google-web-toolkit/issues/detail?id=6206
I made it a IsEditor> instead (backed by a
TakesValueEditor as an implementation detail). I'm not aware of any rule
about the parameterization to use for IsEditor<> so I picked one
(TakesValueEditor is an adapter to easily turn a TakesValue into a
LeadValueEditor, so it probably should only be an implementation detail)

Issue 6216: CellWidget's getValue is never updated by the Cell
http://code.google.com/p/google-web-toolkit/issues/detail?id=6216

Please review this at http://gwt-code-reviews.appspot.com/1400802/

Affected files:
  M user/src/com/google/gwt/user/cellview/CellView.gwt.xml
  M user/src/com/google/gwt/user/cellview/client/CellWidget.java
  M user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java


Index: user/src/com/google/gwt/user/cellview/CellView.gwt.xml
diff --git a/user/src/com/google/gwt/user/cellview/CellView.gwt.xml  
b/user/src/com/google/gwt/user/cellview/CellView.gwt.xml
index  
ec6bcf2fe5767aea8b83cc167b2a227ab7a20874..3c8d066206872054e028c509653c1ff6d90eb766  
100644

--- a/user/src/com/google/gwt/user/cellview/CellView.gwt.xml
+++ b/user/src/com/google/gwt/user/cellview/CellView.gwt.xml
@@ -16,6 +16,7 @@
 


+   



Index: user/src/com/google/gwt/user/cellview/client/CellWidget.java
diff --git a/user/src/com/google/gwt/user/cellview/client/CellWidget.java  
b/user/src/com/google/gwt/user/cellview/client/CellWidget.java
index  
2a1ab4d46eccd62765175c02212d6d0a040db8b4..270f79aa74ae4e78c1f79f77cadfed75ada19f2c  
100644

--- a/user/src/com/google/gwt/user/cellview/client/CellWidget.java
+++ b/user/src/com/google/gwt/user/cellview/client/CellWidget.java
@@ -21,6 +21,9 @@ import com.google.gwt.cell.client.ValueUpdater;
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.editor.client.IsEditor;
+import com.google.gwt.editor.client.LeafValueEditor;
+import com.google.gwt.editor.client.adapters.TakesValueEditor;
 import com.google.gwt.event.logical.shared.ValueChangeEvent;
 import com.google.gwt.event.logical.shared.ValueChangeHandler;
 import com.google.gwt.event.shared.HandlerRegistration;
@@ -37,7 +40,8 @@ import com.google.gwt.view.client.ProvidesKey;
  *
  * @param  the type that the Cell represents
  */
-public class CellWidget extends Widget implements HasKeyProvider,  
HasValue {
+public class CellWidget extends Widget implements HasKeyProvider,  
HasValue,

+IsEditor> {

   /**
* Create the default element used to wrap the Cell. The default element  
is a
@@ -57,6 +61,11 @@ public class CellWidget extends Widget implements  
HasKeyProvider, HasValue

   private final Cell cell;

   /**
+   * For use with the editor framework.
+   */
+  private LeafValueEditor editor;
+
+  /**
* The key provider for the value.
*/
   private final ProvidesKey keyProvider;
@@ -71,7 +80,8 @@ public class CellWidget extends Widget implements  
HasKeyProvider, HasValue

*/
   private final ValueUpdater valueUpdater = new ValueUpdater() {
 public void update(C value) {
-  ValueChangeEvent.fire(CellWidget.this, value);
+  // no need to redraw, the Cell took care of it
+  setValue(value, true, false);
 }
   };

@@ -140,6 +150,14 @@ public class CellWidget extends Widget implements  
HasKeyProvider, HasValue

 return addHandler(handler, ValueChangeEvent.getType());
   }

+  @Override
+  public LeafValueEditor asEditor() {
+if (editor == null) {
+  editor = TakesValueEditor.of(this);
+}
+return editor;
+  }
+
   /**
* Get the {@link Cell} wrapped by this widget.
*
Index: user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java
diff --git  
a/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java  
b/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java
index  
8a848e67dfbfe4148cbd5acf1944e6d5bca20810..5b400f856cb53af221861d11ab6e0b073c235738  
100644

--- a/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java
+++ b/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java
@@ -117,6 +117,7 @@ public class CellWidgetTest extends GWTTestCase {
 cw.onBrowserEvent(event);
 cell.assertLastEventKey("test");
 cell.assertLastEventValue("test");
+assertEquals("newValue", cw.getValue());
   }

   public void testOnBrowserEventWithKeyProvider() {
@@ -135,6 +136,7 @@ public class CellWidgetTest extends GWTTestCase {
 cw.onBrowserEvent(event);
 cell.assertLastEventKey("t");
 cell.assertLastEventValue("test");
+assertEquals("newValue", cw.getValue());
   }

   public void testOnBrowserEventWithValueChangeHandler() {
@@ -152,6 +154,7 @@ public class CellWidgetTest extends GWTTestCase {
 cell.assertLastEventK

[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)

2011-04-01 Thread scottb

LGTM w/ nits.  No need to re-review.


http://gwt-code-reviews.appspot.com/1385810/diff/18035/dev/core/src/com/google/gwt/dev/javac/Dependencies.java
File dev/core/src/com/google/gwt/dev/javac/Dependencies.java (right):

http://gwt-code-reviews.appspot.com/1385810/diff/18035/dev/core/src/com/google/gwt/dev/javac/Dependencies.java#newcode89
dev/core/src/com/google/gwt/dev/javac/Dependencies.java:89: public
List getApiRefs() {
nit: can be default-access like everything else

http://gwt-code-reviews.appspot.com/1385810/diff/18035/dev/core/test/com/google/gwt/dev/javac/TypeOracleTestingUtils.java
File dev/core/test/com/google/gwt/dev/javac/TypeOracleTestingUtils.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/18035/dev/core/test/com/google/gwt/dev/javac/TypeOracleTestingUtils.java#newcode98
dev/core/test/com/google/gwt/dev/javac/TypeOracleTestingUtils.java:98:
return result;
nit: re-inline the local (amounts to a revert)

http://gwt-code-reviews.appspot.com/1385810/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Handle more literal types for anntation values, including Enums. (issue1401801)

2011-04-01 Thread nchalko

Reviewers: rchandia,

Description:
Handle more literal types for anntation values, including Enums.


Please review this at http://gwt-code-reviews.appspot.com/1401801/

Affected files:
  M  
user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java

  M user/test/com/google/gwt/validation/ConstraintsGwtSuite.java
  M user/test/com/google/gwt/validation/ValidationTest.gwt.xml
  A user/test/com/google/gwt/validation/client/TestValidatorFactory.java
  M  
user/test/com/google/gwt/validation/client/ValidationClientGwtTestCase.java
  A  
user/test/com/google/gwt/validation/client/constraints/PatternValidatorGwtTest.java
  M  
user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread t . broyer

http://gwt-code-reviews.appspot.com/1357804/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread t . broyer

On 2011/04/01 21:31:53, zundel wrote:

My question on this is, why does the Editor create such long

filenames?

Have a look at
http://code.google.com/p/google-web-toolkit/issues/detail?id=6016 which
calls for even longer names (that's how the patch at
http://gwt-code-reviews.appspot.com/1352806 fixes the issue for us at
least, a.k.a. The Simplest Thing That Could Possibly Work™).

http://gwt-code-reviews.appspot.com/1357804/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Adds support for the URL_ATTRIBUTE_ENTIRE parse context to HtmlTemplateParser. (issue1396803)

2011-04-01 Thread t . broyer

Sorry, it took me some time but I went read the StreamHtmlParser code to
better understand how it works, and how it's used here in the generator.

I thus found that there's a special-case for "meta refresh" that this
patch doesn't handle (see comments below), and that the ATTR_TYPE.URI is
based on HTML4 attributes only [1], while HTML5 added a few more:
 - formaction
 - icon ()
 - manifest ()
 - poster ()
Given that we're interested in security here, I thought I'd bring this
issue. You might want to talk to the team behind JSilver (as they're all
Googlers too) so they update the code, and/or patch the version of the
StreamHtmlParser used in GWT, and/or handle it in the generator (instead
of, or in addition to, testing isUrlStart, add a test for
HTML5_URI_ATTRIBUTES.contains(streamHtmlParser.getAttribute()).

LGTM otherwise.

[1]
http://code.google.com/p/jsilver/source/browse/trunk/src/com/google/streamhtmlparser/util/HtmlUtils.java?r=10#137


http://gwt-code-reviews.appspot.com/1396803/diff/1/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java
File user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java
(right):

http://gwt-code-reviews.appspot.com/1396803/diff/1/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java#newcode282
user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java:282:
Preconditions.checkState(lookBehind == '"' || lookBehind == '\'',
This will fail if someone includes  in a
template, while isUrlStart will be true. This is the single case where
isUrlStart() should be used instead of getValueIndex()==0 (the other
special case is if insertText() was called in a ATTR_TYPE.URI, but we
never call insertText()).

Replacing the above isUrlStart() with getAttributeType()==ATTR_TYPE.URI
&& getValueIndex()==0 would make the  example above fall into the
HtmlContext.Type.ATTRIBUTE_VALUE case where the URL wouldn't be treated
as a URL and sanitized, so it's not acceptable.

The only solution seems to be to keep the isUrlStart() test but look at
the char preceeding the attribute value in the template for the quote
char. Something like:
 template.charAt(parsePosition - streamHtmlParser.getValueIndex() - 1);
In most cases, getValueIndex() would be 0 so it will be equivalent to
lookBehind, and in the  case it would still work OK to "find" the
end of the attribute value (in the  case, the URL should end the
attribute value, so it's OK to then compare with the 'lookAhead' char).

Other solution: explicitly test for the  case
("meta".equals(getTag()) && "content".equals(getAttribute())) and throw
an UnableToCompleteException().

http://gwt-code-reviews.appspot.com/1396803/diff/1/user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java
File
user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java
(right):

http://gwt-code-reviews.appspot.com/1396803/diff/1/user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java#newcode122
user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java:122:
"{1}");
Add a test for the  case?

http://gwt-code-reviews.appspot.com/1396803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)

2011-04-01 Thread zundel


http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java
File
dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode194
dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:194:
private static void addUnitsToVisit(Map
unitMap, String typeName,
On 2011/04/01 16:44:52, scottb wrote:

'addUnitToVisit' since it only adds 1 unit?


Done.

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
File dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java#newcode278
dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java:278:
return buildFrom(logger, resources, null, true);
On 2011/04/01 16:44:52, scottb wrote:

Adding the boolean here probably wouldn't be nearly as much churn as
ModuleDef.getCompilationState(), but if not, default suppression

surprised me

since it's the opposite of ModuleDef's default.


flipped the default to false, tests will turn on error reporting by
default (I think most sent errors to a NULL tree logger anyway.)

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java#newcode854
dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:854:
new String(cud.getMainTypeName()), false);
I didn't fully understand what maybeDumpSource was doing.  I introduced
an interface to read back source so that the
error reporting can delay reading source until its needed.

http://gwt-code-reviews.appspot.com/1385810/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r9932 committed - Fix ICE in GenerateJavaAST...

2011-04-01 Thread codesite-noreply

Revision: 9932
Author:   sco...@google.com
Date: Fri Apr  1 12:57:25 2011
Log:  Fix ICE in GenerateJavaAST

An empty for statement can generate an ICE.

for (Integer xyzzy : new ArrayList())
; // TODO

http://gwt-code-reviews.appspot.com/1400801/

Review by: zun...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9932

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
 /trunk/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java	 
Thu Mar  3 14:34:14 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java	 
Fri Apr  1 12:57:25 2011

@@ -1639,7 +1639,9 @@
 body = (JBlock) action;
   } else {
 body = new JBlock(info);
-body.addStmt(action);
+if (action != null) {
+  body.addStmt(action);
+}
   }

   JLocal elementVar = (JLocal) typeMap.get(x.elementVariable.binding);
===
--- /trunk/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java	Thu Dec  
16 11:33:51 2010
+++ /trunk/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java	Fri Apr   
1 12:57:25 2011

@@ -20,6 +20,7 @@

 import junit.framework.Assert;

+import java.util.ArrayList;
 import java.util.EventListener;

 /**
@@ -723,6 +724,12 @@

 for (; b;);

+for (int i = 0; i < 10; ++i);
+
+for (int i : new int[10]);
+
+for (Integer i : new ArrayList());
+
 for (;;)
   break;

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix ICE in GenerateJavaAST (issue1400801)

2011-04-01 Thread zundel

LGTM

http://gwt-code-reviews.appspot.com/1400801/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread t . broyer

On 2011/04/01 21:31:53, zundel wrote:

My question on this is, why does the Editor create such long

filenames?  Could

we address that in the Editor generator?  If you turn on -gen, you

want to see

files and even after this patch, you won't have a way to get them.


I agree that a proper fix is ultimately needed, but in the mean time
this patch prevents the build from failing completely:
 - You might rutn -gen on to explore other files that Editor-generated
ones
 - More importantly for us: the gwt-maven-plugin turns -gen on and
offers no way to turn it off! (only solution: to exec-maven-plugin or
maven-antrun-plugin for compilation; that's acceptable for us because we
only use the plugin to run the GWT Compiler –we don't have a single
GWTTestCase... well, not yet!– but it's not everyone's case)

http://gwt-code-reviews.appspot.com/1357804/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RR: Promoting RequestFactory to a higher package

2011-04-01 Thread Thomas Broyer
Note that AutoBeanUtils uses WeakMapping which lives in 
com.google.gwt.core.client (yes, this is a "client" class used in "shared", 
and thus server code; WeakMapping is also directly referenced through 
"server" code, namely in ProxyAutoBean)

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Fix ICE in GenerateJavaAST (issue1400801)

2011-04-01 Thread scottb

Reviewers: jbrosenberg,

Description:
An empty for statement can generate an ICE.

for (Integer xyzzy : new ArrayList())
  ; // TODO


Please review this at http://gwt-code-reviews.appspot.com/1400801/

Affected files:
  M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java


Index: dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
index  
b0f4fbb834ed27a6146ebb7977b2ef1654bb58e2..91ce358a8ebdc04a3022d97e636a650bc4405e07  
100644

--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
@@ -1639,7 +1639,9 @@ public class GenerateJavaAST {
 body = (JBlock) action;
   } else {
 body = new JBlock(info);
-body.addStmt(action);
+if (action != null) {
+  body.addStmt(action);
+}
   }

   JLocal elementVar = (JLocal) typeMap.get(x.elementVariable.binding);


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r9931 committed - cherry picking r9894 for GWT 2.3m1

2011-04-01 Thread codesite-noreply

Revision: 9931
Author:   fabio...@google.com
Date: Fri Apr  1 11:46:10 2011
Log:  cherry picking r9894 for GWT 2.3m1

http://code.google.com/p/google-web-toolkit/source/detail?r=9931

Modified:
  
/releases/2.3/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java


===
---  
/releases/2.3/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java	 
Mon Jun  7 12:20:31 2010
+++  
/releases/2.3/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java	 
Fri Apr  1 11:46:10 2011

@@ -91,12 +91,14 @@
 var elem =  
th...@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem;

 var body = elem.contentWindow.document.body;

-var handler = $entry(function() {
+var handler = $entry(function(evt) {
   if (elem.__listener) {
 if  
(@com.google.gwt.user.client.impl.DOMImpl::isMyListener(Ljava/lang/Object;)(elem.__listener))  
{
   // Weird: this code has the context of the script frame, but we  
need the

   // event from the edit iframe's window.
-  var evt = elem.contentWindow.event;
+  // this code is shared with all IE implementations (see  
RichText.gwt.xml)
+  // the event can be passed in as argument (IE9) or from the  
content window (IE8/7/6)

+  evt = evt || elem.contentWindow.event;

@com.google.gwt.user.client.DOM::dispatchEvent(Lcom/google/gwt/user/client/Event;Lcom/google/gwt/user/client/Element;Lcom/google/gwt/user/client/EventListener;)(evt,  
elem, elem.__listener);

 }
   }

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread zundel

My question on this is, why does the Editor create such long filenames?
Could we address that in the Editor generator?  If you turn on -gen, you
want to see files and even after this patch, you won't have a way to get
them.

On 2011/04/01 15:35:12, jbrosenberg wrote:

+zundel



Adding in Eric also...



Jason



On Fri, Apr 1, 2011 at 11:11 AM, BobV  wrote:
> [+scottb, jbrosenberg]
>
> Jason or Scott, can you take a look at this?  You have been

working in

> this area more recently than I.
>
>> Please review this at http://gwt-code-reviews.appspot.com/1357804/
>
> --
> Bob Vawter
> Google Web Toolkit Team
>




http://gwt-code-reviews.appspot.com/1357804/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r9929 committed - Cherry picking r1382801 into releases/2.3

2011-04-01 Thread codesite-noreply

Revision: 9929
Author:   scheg...@google.com
Date: Fri Apr  1 11:16:55 2011
Log:  Cherry picking r1382801 into releases/2.3

http://code.google.com/p/google-web-toolkit/source/detail?r=9929

Added:
  
/releases/2.3/dev/core/test/com/google/gwt/dev/resource/impl/ResourceTests.java

 /releases/2.3/dev/core/test/com/google/gwt/dev/util/StringsTest.java
 /releases/2.3/user/src/org
 /releases/2.3/user/src/org/hibernate
 /releases/2.3/user/src/org/hibernate/validator
  
/releases/2.3/user/src/org/hibernate/validator/ValidationMessages_mn_MN.properties

Modified:
  
/releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/DefaultFilters.java
  
/releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java
  
/releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
  
/releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java

 /releases/2.3/dev/core/src/com/google/gwt/dev/util/Strings.java
  
/releases/2.3/dev/core/test/com/google/gwt/dev/resource/impl/DefaultFiltersTest.java

 /releases/2.3/eclipse/samples/Hello/Hello-compModule.launch

===
--- /dev/null
+++  
/releases/2.3/dev/core/test/com/google/gwt/dev/resource/impl/ResourceTests.java	 
Fri Apr  1 11:16:55 2011

@@ -0,0 +1,40 @@
+/*
+ * 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.dev.resource.impl;
+
+import com.google.gwt.dev.resource.Resource;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Suite of {@link Resource} related tests.
+ */
+public class ResourceTests {
+  public static Test suite() {
+TestSuite suite = new TestSuite("Resource tests");
+suite.addTestSuite(ClassPathEntryTest.class);
+suite.addTestSuite(DefaultFiltersTest.class);
+suite.addTestSuite(FileResourceTest.class);
+suite.addTestSuite(PathPrefixSetTest.class);
+suite.addTestSuite(ResourceOracleImplRealClasspathTest.class);
+suite.addTestSuite(ResourceOracleImplTest.class);
+return suite;
+  }
+
+  private ResourceTests() {
+  }
+}
===
--- /dev/null
+++ /releases/2.3/dev/core/test/com/google/gwt/dev/util/StringsTest.java	 
Fri Apr  1 11:16:55 2011

@@ -0,0 +1,34 @@
+/*
+ * 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.dev.util;
+
+import junit.framework.TestCase;
+
+import java.util.Arrays;
+
+/**
+ * Tests for {@link Strings}.
+ */
+public class StringsTest extends TestCase {
+  /**
+   * Test for {@link Strings#splitPath(String)}.
+   */
+  public void test_splitPath() throws Exception {
+assertTrue(Arrays.equals(new String[]{"a"}, Strings.splitPath("a")));
+assertTrue(Arrays.equals(new String[]{"a", "bb", "ccc"},  
Strings.splitPath("a/bb/ccc")));
+assertTrue(Arrays.equals(new String[]{"", "a", "bb"},  
Strings.splitPath("/a/bb/")));

+  }
+}
===
--- /dev/null
+++  
/releases/2.3/user/src/org/hibernate/validator/ValidationMessages_mn_MN.properties	 
Fri Apr  1 11:16:55 2011

@@ -0,0 +1,18 @@
+javax.validation.constraints.AssertFalse.message=\u0425\u0443\u0434\u0430\u043B  
\u0431\u0430\u0439\u0445  
\u0451\u0441\u0442\u043E\u0439
+javax.validation.constraints.AssertTrue.message=\u04AE\u043D\u044D\u043D  
\u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
+javax.validation.constraints.DecimalMax.message={value}-\u0430\u0430\u0441  
\u0431\u0430\u0433\u0430 \u0431\u0443\u044E\u0443  
\u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445  
\u0451\u0441\u0442\u043E\u0439
+javax.validation.constraints.DecimalMin.message={value}-\u0430\u0430\u0441  
\u0438\u0445 \u0431\u0443\u044E\u0443 \u0442\u044D\u043D\u0446\u04AF\u04AF  
\u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
+javax.validation.constraints.Digits.message=\u0422\u043E\u043E\u043D  
\u0445\u044F\u043

[gwt-contrib] Re: Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)

2011-04-01 Thread fabbott

LGTM, now without nits.

http://gwt-code-reviews.appspot.com/1399803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)

2011-04-01 Thread rjrjr


http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java
File
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java
(right):

http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode22
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:22:
* messages this emulation is meant to avoid.
On 2011/04/01 19:02:04, fabbott wrote:

I'd probably lose the comments as noise.


Done.

http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode34
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:34:
* error messages, or out right compile failures in -strict mode.
Done, plus listed the missing method signatures.

On 2011/04/01 19:02:04, fabbott wrote:

Probably add a blurb here about the missing methods:



...
There are a few methods useful to TestRunners which we can't
emulate for GWT; fortunately, we don't have to.  But we do
want to include methods that a TestSuite might sensibly call
on itself.  They don't have to do more than compile, though.


http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode42
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:42:
//  public static Constructor getTestConstructor(Class theClass)
throws NoSuchMethodException {
Just dropped them, detail is in the javadoc.

http://gwt-code-reviews.appspot.com/1399803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)

2011-04-01 Thread rjrjr

http://gwt-code-reviews.appspot.com/1399803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Made UiBinder class lookup more generous. (issue1386803)

2011-04-01 Thread sbrubaker

LGTM once the comments below are addressed.


http://gwt-code-reviews.appspot.com/1386803/diff/3007/user/test/com/google/gwt/uibinder/test/client/ClassLookupTest.ui.xml
File
user/test/com/google/gwt/uibinder/test/client/ClassLookupTest.ui.xml
(right):

http://gwt-code-reviews.appspot.com/1386803/diff/3007/user/test/com/google/gwt/uibinder/test/client/ClassLookupTest.ui.xml#newcode12
user/test/com/google/gwt/uibinder/test/client/ClassLookupTest.ui.xml:12:

Please add the following to WidgetBasedUi.ui.xml:

In the ui:UiBinder tag
xmlns:gwt2='urn:import:com.google.gwt.user.client'
xmlns:gwt3='urn:import:com'

Update the end of the XML to use the new functionality:

  

  

You should then be able to remove ClassLookupTest.ui.xml.

http://gwt-code-reviews.appspot.com/1386803/diff/3007/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
File user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
(right):

http://gwt-code-reviews.appspot.com/1386803/diff/3007/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java#newcode636
user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java:636: }
Shouldn't need to modify UiBinderTest.java if you move your ui
declaration into WidgetBasedUi.ui.xml.  The existing test coverage will
test the new functionality, so after you make that update please test
via the GWT SQ and you'll be good to go.

http://gwt-code-reviews.appspot.com/1386803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r9928 committed - Plug memory leak in ResettableEventBus, fix for...

2011-04-01 Thread codesite-noreply

Revision: 9928
Author:   akito.noz...@gmail.com
Date: Fri Apr  1 10:39:59 2011
Log:  Plug memory leak in ResettableEventBus, fix for
http://code.google.com/p/google-web-toolkit/issues/detail?id=5700

Review by rjrjr at http://gwt-code-reviews.appspot.com/1388804/

Review by: jlaba...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9928

Modified:
 /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java
 /trunk/user/test/com/google/gwt/event/shared/ResettableEventBusTest.java

===
--- /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java	Fri  
Sep 10 17:56:09 2010
+++ /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java	Fri  
Apr  1 10:39:59 2011

@@ -18,6 +18,7 @@
 import com.google.gwt.event.shared.GwtEvent.Type;

 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Set;

 /**
@@ -25,6 +26,7 @@
  * easily all be cleared at once.
  */
 public class ResettableEventBus extends EventBus {
+
   private final EventBus wrapped;
   private final Set registrations = new  
HashSet();


@@ -33,20 +35,16 @@
   }

   @Override
-  public  HandlerRegistration addHandler(Type  
type,

-  H handler) {
+  public  HandlerRegistration addHandler(Type  
type, H handler) {

 HandlerRegistration rtn = wrapped.addHandler(type, handler);
-registrations.add(rtn);
-return rtn;
+return doRegisterHandler(rtn);
   }

   @Override
-  public  HandlerRegistration addHandlerToSource(
-  GwtEvent.Type type, Object source, H handler) {
-HandlerRegistration rtn = wrapped.addHandlerToSource(type, source,
-handler);
-registrations.add(rtn);
-return rtn;
+  public  HandlerRegistration  
addHandlerToSource(GwtEvent.Type type,

+  Object source, H handler) {
+HandlerRegistration rtn = wrapped.addHandlerToSource(type, source,  
handler);

+return doRegisterHandler(rtn);
   }

   @Override
@@ -63,9 +61,38 @@
* Remove all handlers that have been added through this wrapper.
*/
   public void removeHandlers() {
-for (HandlerRegistration r : registrations) {
+Iterator it = registrations.iterator();
+while (it.hasNext()) {
+  HandlerRegistration r = it.next();
+
+  /*
+   * must remove before we call removeHandler. Might have come from  
nested

+   * ResettableEventBus
+   */
+  it.remove();
+
   r.removeHandler();
 }
-registrations.clear();
+  }
+
+  // Visible for testing
+  int getRegistrationSize() {
+return registrations.size();
+  }
+
+  private HandlerRegistration doRegisterHandler(final HandlerRegistration  
registration) {

+registrations.add(registration);
+return new HandlerRegistration() {
+  public void removeHandler() {
+doUnregisterHandler(registration);
+  }
+};
+  }
+
+  private void doUnregisterHandler(HandlerRegistration registration) {
+if (registrations.contains(registration)) {
+  registration.removeHandler();
+  registrations.remove(registration);
+}
   }
 }
===
---  
/trunk/user/test/com/google/gwt/event/shared/ResettableEventBusTest.java	 
Tue Mar 29 12:31:22 2011
+++  
/trunk/user/test/com/google/gwt/event/shared/ResettableEventBusTest.java	 
Fri Apr  1 10:39:59 2011

@@ -50,7 +50,7 @@
 assertFired(mouse1, mouse2, mouse3);

 reset();
-
+
 subject.removeHandlers();
 assertEquals(0, wrapped.getCount(type));

@@ -58,30 +58,30 @@
 });
 assertNotFired(mouse1, mouse2, mouse3);
   }
-
+
   public void testNestedResetInnerFirst() {
 CountingEventBus wrapped = new CountingEventBus();
 ResettableEventBus wideScope = new ResettableEventBus(wrapped);
 ResettableEventBus narrowScope = new ResettableEventBus(wideScope);
-
+
 Type type = MouseDownEvent.getType();
-
+
 wideScope.addHandler(type, mouse1);
 narrowScope.addHandler(type, mouse2);
-
+
 wrapped.fireEvent(new MouseDownEvent() {
 });
 assertFired(mouse1, mouse2);
-
+
 reset();

 /*
- * When I remove handlers from the narrow resettable, it should have  
no effect

- * on handlers registered with the wider instance.
+ * When I remove handlers from the narrow resettable, it should have no
+ * effect on handlers registered with the wider instance.
  */
-
+
 narrowScope.removeHandlers();
-
+
 wrapped.fireEvent(new MouseDownEvent() {
 });
 assertFired(mouse1);
@@ -92,28 +92,90 @@
 CountingEventBus wrapped = new CountingEventBus();
 ResettableEventBus wideScope = new ResettableEventBus(wrapped);
 ResettableEventBus narrowScope = new ResettableEventBus(wideScope);
-
+
 Type type = MouseDownEvent.getType();
-
+
 wideScope.addHandler(type, mouse1);
 narrowScope.addHandler(type, mouse2);
-
+
 wrapped.fireEvent(new MouseDownEvent() {
 });
 assertFired(mouse1, mouse2);
-
+
 reset();
-
+
 /*
- * When I remove handlers from the fi

[gwt-contrib] [google-web-toolkit] r9927 committed - Image Resource Test for UiBinderTest...

2011-04-01 Thread codesite-noreply

Revision: 9927
Author:   sbruba...@google.com
Date: Fri Apr  1 10:25:12 2011
Log:  Image Resource Test for UiBinderTest

Review at http://gwt-code-reviews.appspot.com/1380804

Review by: rj...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9927

Modified:
 /trunk/user/test/com/google/gwt/uibinder/test/client/FakeBundle.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml

===
--- /trunk/user/test/com/google/gwt/uibinder/test/client/FakeBundle.java	 
Wed Nov 11 22:08:47 2009
+++ /trunk/user/test/com/google/gwt/uibinder/test/client/FakeBundle.java	 
Fri Apr  1 10:25:12 2011

@@ -50,4 +50,8 @@
   public ArbitraryPojo pojo() {
 return new ArbitraryPojo();
   }
-}
+
+  public String aUrl() {
+return "http://www.google.com/images/logo_sm.gif";;
+  }
+}
===
--- /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java	 
Fri Jan  7 08:26:38 2011
+++ /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java	 
Fri Apr  1 10:25:12 2011

@@ -623,6 +623,10 @@
 final String innerHtml2 = innerHtml.replace("\"", "");
 assertInOrder(innerHtml2, "align=left", "a stackpanel");
   }
+
+  public void testUrlResource() {
+assertEquals(new FakeBundle().aUrl(), widgetUi.myImage.getSrc());
+  }

   /**
* Assert that the expect strings are found in body, and in the order  
given.

===
--- /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java	 
Thu Mar 10 09:08:32 2011
+++ /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java	 
Fri Apr  1 10:25:12 2011

@@ -19,6 +19,7 @@
 import com.google.gwt.dom.client.DListElement;
 import com.google.gwt.dom.client.DivElement;
 import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.ImageElement;
 import com.google.gwt.dom.client.OListElement;
 import com.google.gwt.dom.client.ParagraphElement;
 import com.google.gwt.dom.client.SpanElement;
@@ -195,6 +196,7 @@
   @UiField(provided = true) @SuppressWarnings("unchecked")
   Renderer doubleRenderer = DoubleRenderer.instance();
   @UiField ValueLabel myValueLabel;
+  @UiField ImageElement myImage;

   public WidgetBasedUi() {
 external.style().ensureInjected();
===
---  
/trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml	 
Thu Mar 10 09:08:32 2011
+++  
/trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml	 
Fri Apr  1 10:25:12 2011

@@ -669,6 +669,8 @@

   

+  
+

   
 

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread jlabanca


http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/activity/shared/Activity.java
File user/src/com/google/gwt/activity/shared/Activity.java (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/activity/shared/Activity.java#newcode19
user/src/com/google/gwt/activity/shared/Activity.java:19: import
com.google.gwt.user.client.ui.IsWidget;
This looks like an unused import (only used in JavaDoc).  Might be
better to inline the full path in the JavaDoc to avoid the warning.

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/event/Event.gwt.xml
File user/src/com/google/gwt/event/Event.gwt.xml (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/event/Event.gwt.xml#newcode2
user/src/com/google/gwt/event/Event.gwt.xml:2: 
Remove tabs from all lines or revert.

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/event/EventBase.gwt.xml
File user/src/com/google/gwt/event/EventBase.gwt.xml (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/gwt/event/EventBase.gwt.xml#newcode5
user/src/com/google/gwt/event/EventBase.gwt.xml:5: 
remove tabs from all lines.

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/Event.gwt.xml
File user/src/com/google/web/bindery/event/Event.gwt.xml (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/Event.gwt.xml#newcode17
user/src/com/google/web/bindery/event/Event.gwt.xml:17: 
The client path is not actually present.  Can we remove it?  Is it here
for future support?

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/Event.gwt.xml#newcode18
user/src/com/google/web/bindery/event/Event.gwt.xml:18: 
extra spaces or tabs

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/Event.java
File user/src/com/google/web/bindery/event/shared/Event.java (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/Event.java#newcode2
user/src/com/google/web/bindery/event/shared/Event.java:2: * Copyright
2009 Google Inc.
2011

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/EventBus.java
File user/src/com/google/web/bindery/event/shared/EventBus.java (right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/EventBus.java#newcode2
user/src/com/google/web/bindery/event/shared/EventBus.java:2: *
Copyright 2010 Google Inc.
2011

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java
File
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java
(right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java#newcode2
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java:2:
* Copyright 2008 Google Inc.
2011

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java#newcode20
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java:20:
* {@link EventBus#addHandler}, used to deregister.
Close parathesis from (e.g):

(e.g. via {@linkEventBus#addHandler})

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java#newcode22
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java:22:
* A tip: to make a handler deregister itself, the following works:
Phrasing.  How about the following:

NOTE: The following code creates a handler that deregisters itself the
first time it handles an event.

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java#newcode35
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java:35:
* Deregisters a handler.
The API should call out how to handle multiple calls or calls to
handlers that are already removed.

Deregisters the handler associated with this registration object if the
handler is still attached to the event source.  If the handler is no
longer attached to the event source, this is a no-op.

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
File
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
(right):

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode2
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:2:
* Copyright 2010 Google Inc.
2011

http://gwt-code-reviews.appspot.com/1394803/diff/1/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode27
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:27:
pu

[gwt-contrib] [google-web-toolkit] r9926 committed - Fix checkstyle error...

2011-04-01 Thread codesite-noreply

Revision: 9926
Author:   skybr...@google.com
Date: Fri Apr  1 09:08:51 2011
Log:  Fix checkstyle error

Review by: p...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9926

Modified:
  
/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java


===
---  
/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java	 
Thu Mar 31 18:07:02 2011
+++  
/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java	 
Fri Apr  1 09:08:51 2011

@@ -226,6 +226,13 @@
 contentPanel.ensureDebugId("contentPanel");
 setContent(null);
   }
+
+  /**
+   * Returns the currently displayed content. (Used by tests.)
+   */
+  public ContentWidget getContent() {
+return content;
+  }

   /**
* Get the main menu used to select examples.
@@ -308,13 +315,6 @@
 // Show the widget.
 showExample();
   }
-
-  /**
-   * Returns the currently displayed content. (Used by tests.)
-   */
-  public ContentWidget getContent() {
-return content;
-  }

   /**
* Initialize the {@link ListBox} used for locale selection.

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread Andrés Testi
> You're reading "web" to mean "HTML." I'm reading it as "app that talks to a
> web service, regardless of what it's written in."

I really like the GWT event model and want to use it in Guice
applications to raise bussiness rules, dispatch entity lifecycle
events, etc.. I think this events API is useful for more than "web
service" projects.
Regards.

- Andrés

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)

2011-04-01 Thread fabbott

LGTM with nits about which comments are helpful.


http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java
File
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java
(right):

http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode22
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:22:
* messages this emulation is meant to avoid.
I'd probably lose the comments as noise.

http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode34
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:34:
* error messages, or out right compile failures in -strict mode.
Probably add a blurb here about the missing methods:

...
There are a few methods useful to TestRunners which we can't
emulate for GWT; fortunately, we don't have to.  But we do
want to include methods that a TestSuite might sensibly call
on itself.  They don't have to do more than compile, though.

http://gwt-code-reviews.appspot.com/1399803/diff/1/user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java#newcode42
user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java:42:
//  public static Constructor getTestConstructor(Class theClass)
throws NoSuchMethodException {
keep these, but lose the bodies, and add a header bar saying why they're
commented out:

// getTestConstructor uses reflective classes; we can't emulate it.
// public static Constructor getTestConstructor(...)

http://gwt-code-reviews.appspot.com/1399803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)

2011-04-01 Thread Ray Ryan
ping

On Thu, Mar 31, 2011 at 1:41 PM,  wrote:

> Reviewers: fabbott,
>
> Description:
> Adds a no-op emulation of TestSuite, to prevent error spam (or outright
> failure under -strict mode) in web mode tests that accidentally pick
> the things up in their class path.
>
>
> Please review this at http://gwt-code-reviews.appspot.com/1399803/
>
> Affected files:
>  A
> user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java
>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread John LaBanca
On Fri, Apr 1, 2011 at 2:13 PM, Ray Ryan  wrote:

>
>
> On Fri, Apr 1, 2011 at 10:38 AM, John LaBanca  wrote:
>
>> I don't think Andrés was asking why they weren't in the gwt package.  He's
>> sking why they are in the com.google.web package if they are usable outside
>> of the web domain.  It seems like we are moving from a very limited package
>> scope to a slightly less limited package scope.
>>
>> I'm sure you've debated this plenty, but since I'm doing the code review,
>> I have to question the package name com.google.web.bindery.
>> com - okay, off to a good start
>> .google - I like it
>> .web - I agree with Andrés here.  Wouldn't a use case be to run this code
>> on the server, or even in an Android app?
>>
>
> You're reading "web" to mean "HTML." I'm reading it as "app that talks to a
> web service, regardless of what it's written in."
>
>
>>  It seems like "web" could be dropped, saving 4 bytes in a lot of files.
>>
>
> Not an option, I tried. Creating a new sub-package of com.google is not
> something we can do unilaterally.
>
>
>> .bindery - What's bindery?  It sounds like its related to UiBinder, but
>> UiBinder is truly cliient one.  Is it the name of the new project?
>>
>
> From the README file that I clearly need to add:
>
> bindery is a minimal open source web app framework for GWT
> with experimental support for JRE clients. It is based around an
> app-wide event bus and and an RPC system especially useful for CRUD style
> apps.
>
>
> The consistent theme of the code in this package is that it allows
> "binding" decoupled systems in a type safe way with a minimum of
> boilerplate. Thus bindery.
>
>
> And yes, it took a very long time to come up with that name.
>
I don't like it.  No good reason, it just doesn't have a nice ring to it.
 You guys should start over and come up with a better name, preferably a
palindrome.  Maybe com.google.web.rjrjr?


>
>> If you drop "web", we end up with:
>> com.google.gwt - Libraries used to create GWT applications.
>> com.google.bindary - Useful Google Java libraries, but google provides
>> other libraries, so what is bindary's mission?
>>
>> Thanks,
>> John LaBanca
>> jlaba...@google.com
>>
>>
>> On Fri, Apr 1, 2011 at 12:46 PM, Ray Ryan  wrote:
>>
>>> We want to be able to experiment with non-GWT clients of web services,
>>> particularly via RequestFactory. But I have to put emphasis on the word
>>> "experiment." Non-GWT won't be a supported path soon, if ever.
>>>
>>> On Thu, Mar 31, 2011 at 8:06 AM, Andrés Testi 
>>> wrote:
>>>
 Why bindery package is nested in a web package? Are these APIs not
 available for non web applications?
 Regards.

 - Andrés

 On 31 mar, 01:19, rj...@google.com wrote:
 > Ready for review. John, can you keep me honest on the treatment of
 > com.google.gwt.event.shared, and the choices made in the new event
 > package?
 >
 > Bob, does this fit what you have in mind for the bindery organization?
 >
 > Note that I've updated Activity and Place to use the new classes, but
 > not RequestFactory. I won't submit this until Dan has his big patch in
 > place, and I'll make the RF changes before I do.
 >
 > http://gwt-code-reviews.appspot.com/1394803/

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

>>>
>>>  --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>>
>>
>>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread Ray Ryan
On Fri, Apr 1, 2011 at 10:38 AM, John LaBanca  wrote:

> I don't think Andrés was asking why they weren't in the gwt package.  He's
> sking why they are in the com.google.web package if they are usable outside
> of the web domain.  It seems like we are moving from a very limited package
> scope to a slightly less limited package scope.
>
> I'm sure you've debated this plenty, but since I'm doing the code review, I
> have to question the package name com.google.web.bindery.
> com - okay, off to a good start
> .google - I like it
> .web - I agree with Andrés here.  Wouldn't a use case be to run this code
> on the server, or even in an Android app?
>

You're reading "web" to mean "HTML." I'm reading it as "app that talks to a
web service, regardless of what it's written in."


>  It seems like "web" could be dropped, saving 4 bytes in a lot of files.
>

Not an option, I tried. Creating a new sub-package of com.google is not
something we can do unilaterally.


> .bindery - What's bindery?  It sounds like its related to UiBinder, but
> UiBinder is truly cliient one.  Is it the name of the new project?
>

>From the README file that I clearly need to add:

bindery is a minimal open source web app framework for GWT with experimental
support for JRE clients. It is based around an app-wide event bus and and an
RPC system especially useful for CRUD style apps.


The consistent theme of the code in this package is that it allows "binding"
decoupled systems in a type safe way with a minimum of boilerplate. Thus
bindery.


And yes, it took a very long time to come up with that name.


> If you drop "web", we end up with:
> com.google.gwt - Libraries used to create GWT applications.
> com.google.bindary - Useful Google Java libraries, but google provides
> other libraries, so what is bindary's mission?
>
> Thanks,
> John LaBanca
> jlaba...@google.com
>
>
> On Fri, Apr 1, 2011 at 12:46 PM, Ray Ryan  wrote:
>
>> We want to be able to experiment with non-GWT clients of web services,
>> particularly via RequestFactory. But I have to put emphasis on the word
>> "experiment." Non-GWT won't be a supported path soon, if ever.
>>
>> On Thu, Mar 31, 2011 at 8:06 AM, Andrés Testi 
>> wrote:
>>
>>> Why bindery package is nested in a web package? Are these APIs not
>>> available for non web applications?
>>> Regards.
>>>
>>> - Andrés
>>>
>>> On 31 mar, 01:19, rj...@google.com wrote:
>>> > Ready for review. John, can you keep me honest on the treatment of
>>> > com.google.gwt.event.shared, and the choices made in the new event
>>> > package?
>>> >
>>> > Bob, does this fit what you have in mind for the bindery organization?
>>> >
>>> > Note that I've updated Activity and Place to use the new classes, but
>>> > not RequestFactory. I won't submit this until Dan has his big patch in
>>> > place, and I'll make the RF changes before I do.
>>> >
>>> > http://gwt-code-reviews.appspot.com/1394803/
>>>
>>> --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>>
>>
>>  --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread Ray Ryan
On Fri, Apr 1, 2011 at 11:16 AM, John LaBanca  wrote:

> On Fri, Apr 1, 2011 at 2:13 PM, Ray Ryan  wrote:
>
>>
>>
>> On Fri, Apr 1, 2011 at 10:38 AM, John LaBanca wrote:
>>
>>> I don't think Andrés was asking why they weren't in the gwt package.
>>>  He's sking why they are in the com.google.web package if they are usable
>>> outside of the web domain.  It seems like we are moving from a very limited
>>> package scope to a slightly less limited package scope.
>>>
>>> I'm sure you've debated this plenty, but since I'm doing the code review,
>>> I have to question the package name com.google.web.bindery.
>>> com - okay, off to a good start
>>> .google - I like it
>>> .web - I agree with Andrés here.  Wouldn't a use case be to run this code
>>> on the server, or even in an Android app?
>>>
>>
>> You're reading "web" to mean "HTML." I'm reading it as "app that talks to
>> a web service, regardless of what it's written in."
>>
>>
>>>  It seems like "web" could be dropped, saving 4 bytes in a lot of files.
>>>
>>
>> Not an option, I tried. Creating a new sub-package of com.google is not
>> something we can do unilaterally.
>>
>>
>>> .bindery - What's bindery?  It sounds like its related to UiBinder, but
>>> UiBinder is truly cliient one.  Is it the name of the new project?
>>>
>>
>> From the README file that I clearly need to add:
>>
>> bindery is a minimal open source web app framework for GWT
>> with experimental support for JRE clients. It is based around an
>> app-wide event bus and and an RPC system especially useful for CRUD style
>> apps.
>>
>>
>> The consistent theme of the code in this package is that it allows
>> "binding" decoupled systems in a type safe way with a minimum of
>> boilerplate. Thus bindery.
>>
>>
>> And yes, it took a very long time to come up with that name.
>>
> I don't like it.  No good reason, it just doesn't have a nice ring to it.
>  I will give you an alternative in fifteen minutes.
>

That's a very generous offer.

>
>
>>
>>> If you drop "web", we end up with:
>>> com.google.gwt - Libraries used to create GWT applications.
>>> com.google.bindary - Useful Google Java libraries, but google provides
>>> other libraries, so what is bindary's mission?
>>>
>>> Thanks,
>>> John LaBanca
>>> jlaba...@google.com
>>>
>>>
>>> On Fri, Apr 1, 2011 at 12:46 PM, Ray Ryan  wrote:
>>>
 We want to be able to experiment with non-GWT clients of web services,
 particularly via RequestFactory. But I have to put emphasis on the word
 "experiment." Non-GWT won't be a supported path soon, if ever.

 On Thu, Mar 31, 2011 at 8:06 AM, Andrés Testi >>> > wrote:

> Why bindery package is nested in a web package? Are these APIs not
> available for non web applications?
> Regards.
>
> - Andrés
>
> On 31 mar, 01:19, rj...@google.com wrote:
> > Ready for review. John, can you keep me honest on the treatment of
> > com.google.gwt.event.shared, and the choices made in the new event
> > package?
> >
> > Bob, does this fit what you have in mind for the bindery
> organization?
> >
> > Note that I've updated Activity and Place to use the new classes, but
> > not RequestFactory. I won't submit this until Dan has his big patch
> in
> > place, and I'll make the RF changes before I do.
> >
> > http://gwt-code-reviews.appspot.com/1394803/
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

>>>
>>>
>>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread John LaBanca
I don't think Andrés was asking why they weren't in the gwt package.  He's
sking why they are in the com.google.web package if they are usable outside
of the web domain.  It seems like we are moving from a very limited package
scope to a slightly less limited package scope.

I'm sure you've debated this plenty, but since I'm doing the code review, I
have to question the package name com.google.web.bindery.
com - okay, off to a good start
.google - I like it
.web - I agree with Andrés here.  Wouldn't a use case be to run this code on
the server, or even in an Android app?  It seems like "web" could be
dropped, saving 4 bytes in a lot of files.
.bindery - What's bindery?  It sounds like its related to UiBinder, but
UiBinder is truly cliient one.  Is it the name of the new project?

If you drop "web", we end up with:
com.google.gwt - Libraries used to create GWT applications.
com.google.bindary - Useful Google Java libraries, but google provides other
libraries, so what is bindary's mission?

Thanks,
John LaBanca
jlaba...@google.com


On Fri, Apr 1, 2011 at 12:46 PM, Ray Ryan  wrote:

> We want to be able to experiment with non-GWT clients of web services,
> particularly via RequestFactory. But I have to put emphasis on the word
> "experiment." Non-GWT won't be a supported path soon, if ever.
>
> On Thu, Mar 31, 2011 at 8:06 AM, Andrés Testi wrote:
>
>> Why bindery package is nested in a web package? Are these APIs not
>> available for non web applications?
>> Regards.
>>
>> - Andrés
>>
>> On 31 mar, 01:19, rj...@google.com wrote:
>> > Ready for review. John, can you keep me honest on the treatment of
>> > com.google.gwt.event.shared, and the choices made in the new event
>> > package?
>> >
>> > Bob, does this fit what you have in mind for the bindery organization?
>> >
>> > Note that I've updated Activity and Place to use the new classes, but
>> > not RequestFactory. I won't submit this until Dan has his big patch in
>> > place, and I'll make the RF changes before I do.
>> >
>> > http://gwt-code-reviews.appspot.com/1394803/
>>
>> --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>
>  --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread Stephen Haberman

> We want to be able to experiment with non-GWT clients of web services,
> particularly via RequestFactory. But I have to put emphasis on the word
> "experiment." Non-GWT won't be a supported path soon, if ever.

Is it worth moving packages at the current time then? You could tease
out a non-GWT jar with build tricks and go from there.

- Stephen

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)

2011-04-01 Thread Ray Ryan
We want to be able to experiment with non-GWT clients of web services,
particularly via RequestFactory. But I have to put emphasis on the word
"experiment." Non-GWT won't be a supported path soon, if ever.

On Thu, Mar 31, 2011 at 8:06 AM, Andrés Testi wrote:

> Why bindery package is nested in a web package? Are these APIs not
> available for non web applications?
> Regards.
>
> - Andrés
>
> On 31 mar, 01:19, rj...@google.com wrote:
> > Ready for review. John, can you keep me honest on the treatment of
> > com.google.gwt.event.shared, and the choices made in the new event
> > package?
> >
> > Bob, does this fit what you have in mind for the bindery organization?
> >
> > Note that I've updated Activity and Place to use the new classes, but
> > not RequestFactory. I won't submit this until Dan has his big patch in
> > place, and I'll make the RF changes before I do.
> >
> > http://gwt-code-reviews.appspot.com/1394803/
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)

2011-04-01 Thread scottb


http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java
File
dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode194
dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:194:
private static void addUnitsToVisit(Map
unitMap, String typeName,
'addUnitToVisit' since it only adds 1 unit?

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
File dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java#newcode278
dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java:278:
return buildFrom(logger, resources, null, true);
Adding the boolean here probably wouldn't be nearly as much churn as
ModuleDef.getCompilationState(), but if not, default suppression
surprised me since it's the opposite of ModuleDef's default.

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
(right):

http://gwt-code-reviews.appspot.com/1385810/diff/4002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java#newcode854
dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:854:
new String(cud.getMainTypeName()), false);
I can't get my head around this.  If there's a valid file on the file
system you can read (Util.readFileAsString), those are the exact cases
that *won't* dump to disk.  The dump to disk is for generated units,
which by definition you can't read the source off disk.  What am I
missing?

http://gwt-code-reviews.appspot.com/1385810/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)

2011-04-01 Thread zundel

I replaced patch set 4 by having the default fetching of
CompilationState log errors like it always has.  In terms of number of
call sites, suppressing errors is in the minority, thus less code churn.

http://gwt-code-reviews.appspot.com/1385810/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread Jason Rosenberg
+zundel

Adding in Eric also...

Jason

On Fri, Apr 1, 2011 at 11:11 AM, BobV  wrote:
> [+scottb, jbrosenberg]
>
> Jason or Scott, can you take a look at this?  You have been working in
> this area more recently than I.
>
>> Please review this at http://gwt-code-reviews.appspot.com/1357804/
>
> --
> Bob Vawter
> Google Web Toolkit Team
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r9925 committed - Adding table rendering tests to micro benchmarks. Table rendering test...

2011-04-01 Thread codesite-noreply

Revision: 9925
Author:   jlaba...@google.com
Date: Fri Apr  1 04:44:18 2011
Log:  Adding table rendering tests to micro benchmarks. Table rendering  
tests are multiple orders of magnitude slower than the existing basic  
tests, so I seperated them into a seperate mirco benchmark.  I modified  
WidgetCreation so it could be used for both instead of copying udles of  
code.  You can see the app running at http://jlabanca-testing.appspot.com/.


I also made some changes to improve test accuracy.  I found that the tests  
get slower as elements are attached to the DOM and as the test runs, so  
instead of running all iterations of a single test, we run all tests one  
iteration at a time.  We also alternate the order of the tests, so the last  
test added isn't always the last test to run.  Finally, we remove each  
rendered widget after we add it and record the time, as the existence of a  
widget could affect the timing of the next test. This seems to lead to more  
reasonable numbers in practice.


Review at http://gwt-code-reviews.appspot.com/1394802

Review by: rj...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9925

Added:
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDom.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDomWithEvents.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTablePrecreatedInnerHtml.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.ui.xml

Modified:
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Util.java
  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java


===
--- /dev/null
+++  
/trunk/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDom.java	 
Fri Apr  1 04:44:18 2011

@@ -0,0 +1,79 @@
+/*
+ * 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.reference.microbenchmark.client;
+
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.TableCellElement;
+import com.google.gwt.dom.client.TableElement;
+import com.google.gwt.dom.client.TableRowElement;
+import com.google.gwt.dom.client.TableSectionElement;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Run by {@link WidgetCreation}, see {@link  
TestCreateTableDom.Maker#name} for

+ * details.
+ */
+public class TestCreateTableDom extends Widget {
+  public static class Maker extends WidgetCreation.Maker {
+Maker() {
+  super(Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT
+  + " table via DOM api calls, no widgets");
+}
+
+@Override
+public Widget make() {
+  return new TestCreateTableDom();
+}
+  }
+
+  TestCreateTableDom() {
+// This table should match the structure defined in  
Util#createTableHtml().

+TableElement table = Document.get().createTableElement();
+TableSectionElement tbody = Document.get().createTBodyElement();
+table.appendChild(tbody);
+for (int row = 0; row < Util.TABLE_ROW_COUNT; row++) {
+  TableRowElement tr = Document.get().createTRElement();
+  tbody.appendChild(tr);
+  if (row % 2 == 0) {
+tr.addClassName("evenRow");
+  } else {
+tr.addClassName("oddRow");
+  }
+  for (int column = 0; column < Util.TABLE_COLUMN_COUNT; column++) {
+TableCellElement td = Document.get().createTDElement();
+td.setAlign("center");
+td.setVAlign("middle");
+td.appendChild(createCellContents(row, column));
+  }
+}
+setElement(table);
+  }
+
+  /**
+   * Create the contents of a cell.
+   *
+   * @param row the row index
+   * @param column the column index
+   * @return the cell contents as an element
+   */
+  Element createCellContents(int row, int column) {
+DivElement div = Document.get().createDivElement();
+div.setInnerHTML("Cell " + row

[gwt-contrib] Re: Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread BobV
[+scottb, jbrosenberg]

Jason or Scott, can you take a look at this?  You have been working in
this area more recently than I.

> Please review this at http://gwt-code-reviews.appspot.com/1357804/

-- 
Bob Vawter
Google Web Toolkit Team

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Log error instead of throwing when a generated unit cannot be transferred to a file. (issue1357804)

2011-04-01 Thread t . broyer

Reviewers: bobv,

Message:
We've been running with this patch for 6 weeks or so and it's highly
misleading to have it logged as an error with a full stack-trace.
I'll update the patch to log a warning instead (or maybe only an info?)
and only include the exception's getLocalizedMessage (or toString) in
the message, without passing the exception to the logger so we don't
have the stack trace printed out (which doesn't help anyway).

Here's a sample output from our Jenkins CI server (thus, the [INFO]
prefix comes from Maven) so you get an idea of how much it "pollutes"
the output (we have a dozen of these):
[INFO] Invoking generator
com.google.gwt.requestfactory.rebind.RequestFactoryEditorDriverGenerator
[INFO][ERROR] Error writing out generated unit at
''
[INFO] java.io.FileNotFoundException:  (File
name too long)
[INFO]  at java.io.FileOutputStream.open(Native Method)
[INFO]  at java.io.FileOutputStream.(FileOutputStream.java:179)
[INFO]  at java.io.FileOutputStream.(FileOutputStream.java:131)
[INFO]  at
com.google.gwt.dev.javac.StandardGeneratorContext$GeneratedUnitWithFile.commit(StandardGeneratorContext.java:176)
[INFO]  at
com.google.gwt.dev.javac.StandardGeneratorContext.commit(StandardGeneratorContext.java:385)
[INFO]  at
com.google.gwt.user.rebind.ClassSourceFileComposer.commit(ClassSourceFileComposer.java:107)
[INFO]  at
com.google.gwt.editor.rebind.AbstractEditorDriverGenerator.getEditorDelegate(AbstractEditorDriverGenerator.java:201)
[INFO]  at
com.google.gwt.editor.rebind.AbstractEditorDriverGenerator.getEditorDelegate(AbstractEditorDriverGenerator.java:159)
[INFO]  at
com.google.gwt.editor.rebind.AbstractEditorDriverGenerator.getEditorDelegate(AbstractEditorDriverGenerator.java:159)
[INFO]  at
com.google.gwt.editor.rebind.AbstractEditorDriverGenerator.writeCreateDelegate(AbstractEditorDriverGenerator.java:311)
[INFO]  at
com.google.gwt.editor.rebind.AbstractEditorDriverGenerator.generate(AbstractEditorDriverGenerator.java:80)
[INFO]  at
com.google.gwt.requestfactory.rebind.RequestFactoryEditorDriverGenerator.generate(RequestFactoryEditorDriverGenerator.java:42)
[INFO]  at
com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
[INFO]  at
com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
[INFO]  at
com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:681)
[INFO]  at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
[INFO]  at
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
[INFO]  at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259)
[INFO]  at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:248)
[INFO]  at
com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
[INFO]  at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
[INFO]  at
com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:251)
[INFO]  at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
[INFO]  at
com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:170)
[INFO]  at
com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:285)
[INFO]  at
com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
[INFO]  at
com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:587)
[INFO]  at
com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
[INFO]  at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
[INFO]  at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:525)
[INFO]  at
com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:215)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:187)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
[INFO]  at
com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
[INFO]  at
com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:166)

Description:
See http://code.google.com/p/google-web-toolkit/issues/detail?id=6015

Log error instead of throwing when a generated unit cannot be
transferred to a file, so that filenames exceeding file system limits