[gwt-contrib] Re: JavaAstConstructor uses UnifyAst. (issue1453810)

2011-06-10 Thread Eric Ayers
@Scott

If you patch this in and follow the arcane directions, you can get the
incremental compile support in blaze.

https://mondrian.corp.google.com/changelist/21809612

-Eric.

On Thu, Jun 9, 2011 at 5:46 PM, cromwell...@google.com wrote:


 Overall LGTM. I had to update CFA in my recent CL on class literal
 optimization to treat an invocation of Object.getClass() as rescuing the
 class literals of any instantiated types as well as to handle the new
 Immortal CodeGenTypes.

 We may have to revisit the UnifyAstVisitor, since it may need special
 handling for the Immortal types, as well as class literal references,
 since GenerateJavaAST no longer overrides getClass() for every time in
 my latest patch.



 http://gwt-code-reviews.**appspot.com/1453810/http://gwt-code-reviews.appspot.com/1453810/




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

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

[gwt-contrib] Re: ForeachStatement fix for GwtAstBuilder (issue1450814)

2011-06-10 Thread jbrosenberg

LGTM
(but I'd love a comment, and a detailed TODO for the test-case which
triggered this fix, so that if someone wants to create a unit test, the
scenario is clear).

Also, I'm curious, if GenerateJavaAST already has this hack, why didn't
GwtAstBuilder also have it initially?  Any point in going ahead with
adding the caching of the Field also to GenerateJavaAST here?  Or are we
deprecating GenerateJavaAST eventually anyway?


http://gwt-code-reviews.appspot.com/1450814/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1450814/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2776
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2776:
InternalCompilerException.preload();
How about a comment describing why this is needed here.

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

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


[gwt-contrib] Re: Updated rpc generator result caching for field serializers to use type signature instead of last... (issue1446818)

2011-06-10 Thread jbrosenberg


http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
File user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java#newcode388
user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java:388:
signature = ((JRealClassType) signatureType).getTypeStrongHash();
by the way, here's the original BSM review, where we discuss this (the
top level comments for the review):
http://gwt-code-reviews.appspot.com/1359802

In thinking back now, I'm not sure why BSM didn't care about annotation
changes?

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

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


[gwt-contrib] Re: This patch substantially reduces the overhead of Java types in the output by minimizing vtable s... (issue1447821)

2011-06-10 Thread jbrosenberg

I'm about a 3rd of the way through this, but here's some initial
comments.  I'll be able to spend more time on this evening


http://gwt-code-reviews.appspot.com/1447821/diff/3001/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/1447821/diff/3001/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java#newcode312
dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:312:
// prune all Object.getClass() overrides and replace with inline field
ref
It's a shame this can't be called earlier on, so that optimizers can
take advantage of the loss of polymorphism with getClass()...

http://gwt-code-reviews.appspot.com/1447821/diff/3001/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
File dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
(right):

http://gwt-code-reviews.appspot.com/1447821/diff/3001/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java#newcode937
dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:937: }
whitespace

http://gwt-code-reviews.appspot.com/1447821/diff/3001/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java#newcode995
dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:995:
This seems a bit expensive (iterating through all instantiated types).
It looks like it could be called many times per optimization pass?  For
instance, traverseFrom() is called multiple times in a loop, in
traverseEntryMethods().  Is there any impact on execution time, for
large projects?   It seems like it should only be called once per CFA
pass, no?   Also, traverseFrom is called in many places external to this
class, in tight loops iterating over multiple methods, etc.

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

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


[gwt-contrib] Re: ForeachStatement fix for GwtAstBuilder (issue1450814)

2011-06-10 Thread scottb

I just went ahead and added test coverage.  Meh.

No point in caching the field in GenerateJavaAST, it's going away soon.
I don't remember why I didn't copy the hack, I think I was trying to be
more clever about it to not have to use reflection, but it broke down in
this case.


http://gwt-code-reviews.appspot.com/1450814/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1450814/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2776
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2776:
InternalCompilerException.preload();
You mean the InternalCompilerException.preload() call?  The target
method has spot-on Javadoc already.

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

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


[gwt-contrib] [google-web-toolkit] r10313 committed - ForeachStatement fix for GwtAstBuilder....

2011-06-10 Thread codesite-noreply

Revision: 10313
Author:   sco...@google.com
Date: Fri Jun 10 05:39:40 2011
Log:  ForeachStatement fix for GwtAstBuilder.

Fixes a compile error that occurs with code like this:

interface SubIteratorE extends IteratorE {
}

class Foo implements IterableString {
@Override
public SubIteratorString iterator() {
return null;
}
}

We were trying to find 'SubIterator.next()' which isn't modeled in JDT.  It  
turns out JDT has the right answer in a private field.


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

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

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

===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Thu  
Jun  9 11:46:19 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Fri  
Jun 10 05:39:40 2011

@@ -199,6 +199,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
 import org.eclipse.jdt.internal.compiler.util.Util;

+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -979,16 +980,7 @@
   // Perform any implicit reference type casts (due to generics).
   // Note this occurs before potential unboxing.
   if (elementVar.getType() != javaLangObject) {
-/*
- * Compute the collection element type by walking the  
iterator()

- * method, which may be parameterized.
- */
-ReferenceBinding collectionType = (ReferenceBinding)  
x.collection.resolvedType;

-MethodBinding iteratorMethod =
-collectionType.getExactMethod(ITERATOR, NO_TYPES,  
cudScope);
-ReferenceBinding iteratorType = (ReferenceBinding)  
iteratorMethod.returnType;

-MethodBinding nextMethod = iteratorType.getMethods(NEXT)[0];
-TypeBinding collectionElementType = nextMethod.returnType;
+TypeBinding collectionElementType = (TypeBinding)  
collectionElementTypeField.get(x);

 JType toType = typeMap.get(collectionElementType);
 assert (toType instanceof JReferenceType);
 elementDecl.initializer = maybeCast(toType,  
elementDecl.initializer);

@@ -2762,6 +2754,12 @@

   private static final char[] _STRING = _String.toCharArray();
   private static final String ARRAY_LENGTH_FIELD = length;
+
+  /**
+   * Reflective access to {@link ForeachStatement#collectionElementType}.
+   */
+  private static final Field collectionElementTypeField;
+
   private static final char[] CREATE_VALUE_OF_MAP  
= createValueOfMap.toCharArray();

   private static final char[] HAS_NEXT = hasNext.toCharArray();
   private static final char[] ITERATOR = iterator.toCharArray();
@@ -2775,6 +2773,13 @@

   static {
 InternalCompilerException.preload();
+try {
+  collectionElementTypeField =  
ForeachStatement.class.getDeclaredField(collectionElementType);

+  collectionElementTypeField.setAccessible(true);
+} catch (Exception e) {
+  throw new RuntimeException(
+  Unexpectedly unable to access  
ForeachStatement.collectionElementType via reflection, e);

+}
   }

   static String dotify(char[][] name) {
===
--- /trunk/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java	Mon Apr  
19 09:23:34 2010
+++ /trunk/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java	Fri Jun  
10 05:39:40 2011

@@ -17,6 +17,9 @@

 import com.google.gwt.junit.client.GWTTestCase;

+import java.util.Arrays;
+import java.util.Iterator;
+
 /**
  * This test is intended to exercise as many code paths and node types as
  * possible in the Java to JavaScript compiler. This test is not at all  
intended

@@ -412,9 +415,66 @@
 }

 private void testForeachStatement() {
+  // Array of primitive.
   for (int q : ia) {
 i = q;
   }
+  // Array of primitive with unboxing.
+  for (Integer q : ia) {
+i = q;
+  }
+  // Array of object.
+  for (String str : sa) {
+s = str;
+  }
+  // Iterable.
+  for (Object obj : Arrays.asList(new Object(), new Object())) {
+o = obj;
+  }
+  // Iterable with unboxing.
+  for (int q : Arrays.asList(1, 2, 3)) {
+i = q;
+  }
+  // Iterable with generic cast.
+  for (String str : Arrays.asList(sa)) {
+s = str;
+  }
+  // Iterable with array element.
+  for (String[] stra : Arrays.asList(sa, sa, sa)) {
+s = sa[0];
+  }
+  // Iterable Iterator subclass.
+  class SubIteratorT implements IteratorT {
+private final IteratorT it;
+
+public SubIterator(IteratorT it) {
+  this.it = it;
+}
+
+@Override
+public boolean hasNext() {
+  return it.hasNext();

[gwt-contrib] [google-web-toolkit] r10314 committed - Error reporting for UnifyAst....

2011-06-10 Thread codesite-noreply

Revision: 10314
Author:   sco...@google.com
Date: Fri Jun 10 05:54:05 2011
Log:  Error reporting for UnifyAst.

Report errors cleanly and don't blow up.
http://gwt-code-reviews.appspot.com/1451814/

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

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
  
/trunk/dev/core/test/com/google/gwt/dev/jjs/impl/AdditionalTypeProviderDelegateTest.java


===
--- /trunk/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java	Wed Oct  
28 10:56:52 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java	Fri Jun  
10 05:54:05 2011

@@ -17,6 +17,7 @@

 import com.google.gwt.core.ext.TreeLogger;
 import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.dev.javac.CompilationProblemReporter;
 import com.google.gwt.dev.shell.log.SwingLoggerPanel;
 import com.google.gwt.dev.util.log.PrintWriterTreeLogger;

@@ -88,7 +89,7 @@
 } catch (UnableToCompleteException e) {
   // Assume logged.
 } catch (Throwable e) {
-  logger.log(TreeLogger.ERROR, Unexpected, e);
+  CompilationProblemReporter.logAndTranslateException(logger, e);
 }
 return false;
   }
===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java	Thu Jun   
9 11:46:19 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java	Fri Jun  
10 05:54:05 2011

@@ -17,6 +17,7 @@

 import com.google.gwt.core.ext.TreeLogger;
 import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.dev.javac.CompilationProblemReporter;
 import com.google.gwt.dev.javac.CompilationUnit;
 import com.google.gwt.dev.javac.CompiledClass;
 import com.google.gwt.dev.jdt.RebindPermutationOracle;
@@ -70,6 +71,7 @@
 import com.google.gwt.dev.js.ast.JsProgram;
 import com.google.gwt.dev.js.ast.JsRootScope;
 import com.google.gwt.dev.util.JsniRef;
+import com.google.gwt.dev.util.Name;
 import com.google.gwt.dev.util.Name.BinaryName;
 import com.google.gwt.dev.util.Name.InternalName;
 import com.google.gwt.dev.util.collect.IdentityHashSet;
@@ -189,7 +191,7 @@

 @Override
 public void endVisit(JExpression x, Context ctx) {
-  assert !x.getType().isExternal();
+  assert !x.getType().isExternal() || errorsFound;
 }

 @Override
@@ -226,7 +228,10 @@
 public void endVisit(JMethodCall x, Context ctx) {
   // Already resolved during visit().
   JMethod target = x.getTarget();
-  assert !target.isExternal();
+  if (target.isExternal()) {
+assert errorsFound;
+return;
+  }
   if (magicMethodCalls.contains(target)) {
 JExpression result = handleMagicMethodCall(x);
 if (result == null) {
@@ -399,7 +404,9 @@

   JsniRef ref = JsniRef.parse(stringValue);
   if (ref != null) {
-searchForType(ref.className());
+if (Name.isBinaryName(ref.className())) {
+  searchForType(ref.className());
+}
 node = JsniRefLookup.findJsniRefTarget(ref, program, new  
JsniRefLookup.ErrorReporter() {

   public void reportError(String errMsg) {
 error(x, errMsg);
@@ -463,6 +470,7 @@

   private final MapString, CompiledClass classFileMap;
   private boolean errorsFound = false;
+  private final SetCompilationUnit failedUnits = new  
IdentityHashSetCompilationUnit();
   private final MapString, JField fieldMap = new HashMapString,  
JField();


   /**
@@ -518,7 +526,7 @@
 }
 assimilateUnit(cc.getUnit());
 type = program.getFromTypeMap(sourceTypeName);
-assert type != null;
+assert type != null || errorsFound;
   }
 }
   }
@@ -650,8 +658,16 @@
   }

   private void assimilateUnit(CompilationUnit unit) {
-// TODO: error checking.
+if (unit.isError()) {
+  if (failedUnits.add(unit)) {
+CompilationProblemReporter.reportErrors(logger, unit, false);
+errorsFound = true;
+  }
+  return;
+}
+// TODO(zundel): ask for a recompile if deserialization fails?
 ListJDeclaredType types = unit.getTypes();
+assert containsAllTypes(unit, types);
 for (JDeclaredType t : types) {
   program.addType(t);
 }
@@ -711,6 +727,19 @@
   }
 }
   }
+
+  private boolean containsAllTypes(CompilationUnit unit,  
ListJDeclaredType types) {

+SetString binaryTypeNames = new HashSetString();
+for (JDeclaredType type : types) {
+  binaryTypeNames.add(type.getName());
+}
+for (CompiledClass cc : unit.getCompiledClasses()) {
+  if  
(!binaryTypeNames.contains(InternalName.toBinaryName(cc.getInternalName(  
{

+return false;
+  }
+}
+return true;
+  }

   private void error(JNode x, String errorMessage) {
 errorsFound = true;
@@ -730,9 +759,13 @@
   }

   private void flowInto(JField field) {
-if 

[gwt-contrib] Re: Resolve PotentialElement children before inserting them into a container. (issue1454810)

2011-06-10 Thread rjrjr


http://gwt-code-reviews.appspot.com/1454810/diff/3001/user/src/com/google/gwt/user/client/DOM.java
File user/src/com/google/gwt/user/client/DOM.java (right):

http://gwt-code-reviews.appspot.com/1454810/diff/3001/user/src/com/google/gwt/user/client/DOM.java#newcode974
user/src/com/google/gwt/user/client/DOM.java:974: String value, int
index) {
Seems like the assert line should be added here too.

 assert !PotentialElement.isPotential(selectElem) : Cannot insert into
a PotentialElement;

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

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


[gwt-contrib] Re: UiBinder - register custom ElementParser (issue1454804)

2011-06-10 Thread Ray Ryan
As soon as we have done that, we can't make changes to UiBinderWriter and
all the other classes the parsers actually talk to, nor can we make sweeping
changes to the code they generate.

If the problem is retrofitting widgets you don't own, would a non-annotation
alternative to UiChild get the job done? Perhaps a config file, perhaps a
builder of some kind?

On Thu, Jun 9, 2011 at 8:16 PM, jus...@jhickman.com wrote:

 Unfortunately @UiChild doesn't handle the flexibility I need, especially
 in cases where you are wanting to write parsers for a 3rd party widget
 library and do not have the ability to modify the source to include
 annotations.

 Is there any way of convincing you to make it more extendable?  Even
 without providing an official mechanism for registering
 ElementParsers, doing small things such as the following would do
 wonders:

 * In UiBinderGenerator, extract the instantiation of the UiBinderWriter
 into a protected method so that  developers can subclass the
 UiBinderGenerator and construct their own subclass of UiBinderWriter

 * In UiBinderWriter, make addElementParser() protected rather than
 private.




 http://gwt-code-reviews.**appspot.com/1454804/http://gwt-code-reviews.appspot.com/1454804/


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

[gwt-contrib] Re: UiBinder - register custom ElementParser (issue1454804)

2011-06-10 Thread Thomas Broyer
On Fri, Jun 10, 2011 at 7:22 PM, Ray Ryan rj...@google.com wrote:
 As soon as we have done that, we can't make changes to UiBinderWriter and
 all the other classes the parsers actually talk to, nor can we make sweeping
 changes to the code they generate.
 If the problem is retrofitting widgets you don't own, would a non-annotation
 alternative to UiChild get the job done? Perhaps a config file, perhaps a
 builder of some kind?

Particularly as you should be able to make an IsWidget class with
@UiChild methods as a lightweight wrapper around the widget, kind of a
builder (similar to PotentialElement but at a Widget level).

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


[gwt-contrib] Add ServerFailure.getRequestContext(). (issue1451815)

2011-06-10 Thread bobv

Reviewers: rjrjr, jasonhall,

Description:
Add ServerFailure.getRequestContext().
Provide getters for Request - RequestContext - RequestFactory -
RequestTransport.
Add fakes for modified interfaces.
Patch by: bobv
Review by: rjrjr
Suggested by: jasonhall


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

Affected files:
  M user/src/com/google/web/bindery/requestfactory/shared/Request.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/RequestContext.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/RequestFactory.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/RequestTransport.java

  M user/src/com/google/web/bindery/requestfactory/shared/ServerFailure.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequest.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
  A  
user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequest.java
  M  
user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestContext.java
  A  
user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestFactory.java
  A  
user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestTransport.java
  M  
user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java



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


[gwt-contrib] Re: UiBinder - register custom ElementParser (issue1454804)

2011-06-10 Thread Ray Ryan
Exactly. And I was thinking we could introduce something like BuildsWidgetW
extends IsWidget extends IsWidget. UiBinder could learn to honor the
setters and such of the underlying widget as well as the BuildsWidget.

On Fri, Jun 10, 2011 at 10:41 AM, Thomas Broyer t.bro...@gmail.com wrote:

 On Fri, Jun 10, 2011 at 7:22 PM, Ray Ryan rj...@google.com wrote:
  As soon as we have done that, we can't make changes to UiBinderWriter and
  all the other classes the parsers actually talk to, nor can we make
 sweeping
  changes to the code they generate.
  If the problem is retrofitting widgets you don't own, would a
 non-annotation
  alternative to UiChild get the job done? Perhaps a config file, perhaps a
  builder of some kind?

 Particularly as you should be able to make an IsWidget class with
 @UiChild methods as a lightweight wrapper around the widget, kind of a
 builder (similar to PotentialElement but at a Widget level).


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

[gwt-contrib] Re: Resolve PotentialElement children before inserting them into a container. (issue1454810)

2011-06-10 Thread Ray Ryan
LGTM

On Fri, Jun 10, 2011 at 10:29 AM, jul...@google.com wrote:

 Uploaded patch with assertion in DOM.insertListItem as patch set 3.



 http://gwt-code-reviews.**appspot.com/1454810/diff/3001/**
 user/src/com/google/gwt/user/**client/DOM.javahttp://gwt-code-reviews.appspot.com/1454810/diff/3001/user/src/com/google/gwt/user/client/DOM.java
 File user/src/com/google/gwt/user/**client/DOM.java (right):

 http://gwt-code-reviews.**appspot.com/1454810/diff/3001/**
 user/src/com/google/gwt/user/**client/DOM.java#newcode974http://gwt-code-reviews.appspot.com/1454810/diff/3001/user/src/com/google/gwt/user/client/DOM.java#newcode974
 user/src/com/google/gwt/user/**client/DOM.java:974: String value, int
 index) {
 On 2011/06/10 17:12:23, rjrjr wrote:

 Seems like the assert line should be added here too.


   assert !PotentialElement.isPotential(**selectElem) : Cannot insert

 into a

 PotentialElement;


 Done.


 http://gwt-code-reviews.**appspot.com/1454810/http://gwt-code-reviews.appspot.com/1454810/


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

[gwt-contrib] Re: Adds setTagName to PotentialElement, so that PotentialElement instances can be passed to the as(... (issue1451810)

2011-06-10 Thread rjrjr

On 2011/06/08 17:42:53, rdcastro wrote:

LGTM

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

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


[gwt-contrib] Re: Suport polymorphic return values in RequestFactory. (issue1453811)

2011-06-10 Thread rjrjr

LGTM

Wow. That was a lot less work than I expected.

Patch description is oddly restrictive, polymorphic return values. You
also support polymorphic arguments, right?



http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java
File
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java#newcode251
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java:251:
poison(Unable to find extra type %s in TypeOracle,
clazz.getCanonicalName());
TypeOracle is an implementation detail, odd to see it called out in a
user facing error message. How about Unknown class %s in @ExtraTypes?

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java#newcode289
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java:289:
builder.setSuperProxyTyes(superTypes);
Tyes

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java
File
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java#newcode62
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java:62:
* method declared to return Integer.
Are such cases this subtle a fail in real life? Seems like this could be
maddening to debug.

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java
File
user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java#newcode19
user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java:19:
* Creates TestFooPolymorphicRequest.
Does this test serve any purpose any more? If so, could you spell out
what it is?

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

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


[gwt-contrib] Re: Add ServerFailure.getRequestContext(). (issue1451815)

2011-06-10 Thread rjrjr

LGTM

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

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


[gwt-contrib] Re: Add ServerFailure.getRequestContext(). (issue1451815)

2011-06-10 Thread rjrjr


http://gwt-code-reviews.appspot.com/1451815/diff/1/user/src/com/google/web/bindery/requestfactory/shared/Request.java
File user/src/com/google/web/bindery/requestfactory/shared/Request.java
(right):

http://gwt-code-reviews.appspot.com/1451815/diff/1/user/src/com/google/web/bindery/requestfactory/shared/Request.java#newcode19
user/src/com/google/web/bindery/requestfactory/shared/Request.java:19: *
Implemented by the request objects created by this factory.
lame

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

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


[gwt-contrib] inline imgs with safeuri

2011-06-10 Thread Stephen Haberman
Hi,

I'm using trunk and noticed that inline img srcs are broken. E.g. in a
ui.xml file with:

img src={resources.theImage.getUrl}/

Leads to JavaScript like:

sb.impl.string += ' src=';
$append_3(sb, htmlEscape(
  isSafeUri('data:image/...')
  ? 'data:image/...'
  : '#'));

However, isSafeUri doesn't treat the data: scheme as safe, so the src
attribute ends up being #.

Switching the img to a gwt:Image restores the functionality, because
the js just does f_Image.state.setUrl(f_Image, 'data:image/...') and
no safe uri checking is done.

I also tried changing it to src={...theImage.getSafeUri}, thinking
that might avoid the isSafeUri check, but uibinder failed saying SafeUri
can't be used as a String.

I'm not an expert on SafeUri, so am unsure whether data: just needs to
be added to the isSafeUri check or if something else should be done.

Thanks,
Stephen

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


[gwt-contrib] [google-web-toolkit] r10315 committed - Resolve PotentialElement children before inserting them into a contain...

2011-06-10 Thread codesite-noreply

Revision: 10315
Author:   jul...@google.com
Date: Fri Jun 10 09:32:40 2011
Log:  Resolve PotentialElement children before inserting them into a  
container.


Before this patch, if someone tried to insertChild or insertBefore a
renderable child into a renderable container, a DOM exception was thrown, as
the element could not be found in the document. This patch follows the same
pattern as appendChild: it first tries to resolve the child being inserted  
to

get the real element.

While in the neighborhood, fixed some Javadoc tags related to
PotentialElement.

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

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

Modified:
 /trunk/user/src/com/google/gwt/user/client/DOM.java

===
--- /trunk/user/src/com/google/gwt/user/client/DOM.java	Mon Jun  6 04:09:34  
2011
+++ /trunk/user/src/com/google/gwt/user/client/DOM.java	Fri Jun 10 09:32:40  
2011

@@ -53,11 +53,14 @@

   /**
* Appends one element to another's list of children.
-   * If the child element is a {@link PotentialElement}, it is first  
resolved

-   * {@see PotentialElement#resolve(Element)}.
+   * p
+   * If the child element is a {@link  
com.google.gwt.user.client.ui.PotentialElement}, it is first

+   * resolved.
+   * /p
*
* @param parent the parent element
* @param child its new child
+   * @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element)
*/
   public static void appendChild(Element parent, Element child) {
 assert !PotentialElement.isPotential(parent) : Cannot append to a  
PotentialElement;

@@ -914,27 +917,45 @@
   /**
* Inserts an element as a child of the given parent element, before  
another

* child of that parent.
+   * p
+   * If the child element is a {@link  
com.google.gwt.user.client.ui.PotentialElement}, it is first

+   * resolved.
+   * /p
*
* @param parent the parent element
* @param child the child element to add to codeparent/code
* @param before an existing child element of codeparent/code before  
which

*  codechild/code will be inserted
+   * @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element)
*/
   public static void insertBefore(Element parent, Element child, Element  
before) {

-parent.insertBefore(child, before);
+assert !PotentialElement.isPotential(parent) : Cannot insert into a  
PotentialElement;

+
+// If child isn't a PotentialElement, resolve() returns
+// the Element itself.
+parent.insertBefore(PotentialElement.resolve(child).Element cast(),  
before);

   }

   /**
* Inserts an element as a child of the given parent element.
+   * p
+   * If the child element is a {@link  
com.google.gwt.user.client.ui.PotentialElement}, it is first

+   * resolved.
+   * /p
*
* @param parent the parent element
* @param child the child element to add to codeparent/code
* @param index the index before which the child will be inserted (any  
value
*  greater than the number of existing children will cause the  
child

*  to be appended)
+   * @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element)
*/
   public static void insertChild(Element parent, Element child, int index)  
{

-impl.insertChild(parent, child, index);
+assert !PotentialElement.isPotential(parent) : Cannot insert into a  
PotentialElement;

+
+// If child isn't a PotentialElement, resolve() returns
+// the Element itself.
+impl.insertChild(parent, PotentialElement.resolve(child).Element  
cast(), index);

   }

   /**
@@ -951,6 +972,8 @@
*/
   public static void insertListItem(Element selectElem, String item,
   String value, int index) {
+assert !PotentialElement.isPotential(selectElem) : Cannot insert into  
a PotentialElement;

+
 SelectElement select = selectElem.SelectElement cast();
 OptionElement option = Document.get().createOptionElement();
 option.setText(item);

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


[gwt-contrib] Re: Add ServerFailure.getRequestContext(). (issue1451815)

2011-06-10 Thread bobv

Fixed lame comment and committed at r10316.

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

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


[gwt-contrib] [google-web-toolkit] r10316 committed - Add ServerFailure.getRequestContext()....

2011-06-10 Thread codesite-noreply

Revision: 10316
Author:   b...@google.com
Date: Fri Jun 10 10:21:52 2011
Log:  Add ServerFailure.getRequestContext().
Provide getters for Request - RequestContext - RequestFactory -
RequestTransport.
Add fakes for modified interfaces.
Issue 6469.
Review at http://gwt-code-reviews.appspot.com/1451815/
Patch by: bobv
Review by: rjrjr
Suggested by: jasonhall

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

Added:
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequest.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestFactory.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestTransport.java

Modified:
 /trunk/user/src/com/google/web/bindery/requestfactory/shared/Request.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/RequestContext.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/RequestFactory.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/RequestTransport.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/ServerFailure.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequest.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestContext.java
  
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java


===
--- /dev/null
+++  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequest.java	 
Fri Jun 10 10:21:52 2011

@@ -0,0 +1,67 @@
+/*
+ * 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.web.bindery.requestfactory.shared.testing;
+
+import com.google.web.bindery.requestfactory.shared.Receiver;
+import com.google.web.bindery.requestfactory.shared.Request;
+import com.google.web.bindery.requestfactory.shared.RequestContext;
+
+/**
+ * A no-op implementation of Request that can be used as a base type for  
writing

+ * unit tests.
+ *
+ * @param T The return type of objects in the corresponding response.
+ */
+public class FakeRequestT implements RequestT {
+
+  /**
+   * No-op.
+   */
+  @Override
+  public void fire() {
+  }
+
+  /**
+   * No-op.
+   */
+  @Override
+  public void fire(Receiver? super T receiver) {
+  }
+
+  /**
+   * Returns {@code null}.
+   */
+  @Override
+  public RequestContext getRequestContext() {
+return null;
+  }
+
+  /**
+   * Returns {@code null}.
+   */
+  @Override
+  public RequestContext to(Receiver? super T receiver) {
+return null;
+  }
+
+  /**
+   * Returns {@code this}.
+   */
+  @Override
+  public RequestT with(String... propertyRefs) {
+return this;
+  }
+}
===
--- /dev/null
+++  
/trunk/user/src/com/google/web/bindery/requestfactory/shared/testing/FakeRequestFactory.java	 
Fri Jun 10 10:21:52 2011

@@ -0,0 +1,118 @@
+/*
+ * 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.web.bindery.requestfactory.shared.testing;
+
+import com.google.web.bindery.event.shared.EventBus;
+import com.google.web.bindery.requestfactory.shared.EntityProxy;
+import com.google.web.bindery.requestfactory.shared.EntityProxyId;
+import com.google.web.bindery.requestfactory.shared.ProxySerializer;
+import com.google.web.bindery.requestfactory.shared.ProxyStore;
+import com.google.web.bindery.requestfactory.shared.Request;
+import com.google.web.bindery.requestfactory.shared.RequestFactory;
+import com.google.web.bindery.requestfactory.shared.RequestTransport;
+
+/**
+ * A no-op implementation of {@link RequestFactory} that can be used for
+ * building mocks.
+ */
+public class FakeRequestFactory implements RequestFactory {
+
+  private EventBus eventBus;
+  

[gwt-contrib] Fixes a problem where inheriting LoggingDisabled (like RequestFactory does) clobbers the value o... (issue1451816)

2011-06-10 Thread rjrjr

Reviewers: unnurg,

Description:
Fixes a problem where inheriting LoggingDisabled (like RequestFactory
does) clobbers the value of gwt.logging.enabled for downstream modules.
Without this change RequestFactory apps were forced to set
gwt.logging.enabled themselves, instead of just inheriting
Logging.gwt.xml


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

Affected files:
  M  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/mobilewebapp/MobileWebApp.gwt.xml

  M user/src/com/google/gwt/logging/Logging.gwt.xml
  M user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml


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


[gwt-contrib] Re: Fixes a problem where inheriting LoggingDisabled (like RequestFactory does) clobbers the value o... (issue1451816)

2011-06-10 Thread unnurg

On 2011/06/10 21:08:17, rjrjr wrote:

LGTM

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

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


[gwt-contrib] [google-web-toolkit] r10318 committed - Created wiki page through web user interface.

2011-06-10 Thread codesite-noreply

Revision: 10318
Author:   b...@google.com
Date: Fri Jun 10 14:24:57 2011
Log:  Created wiki page through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=10318

Added:
 /wiki/RequestFactory_2_4.wiki

===
--- /dev/null
+++ /wiki/RequestFactory_2_4.wiki   Fri Jun 10 14:24:57 2011
@@ -0,0 +1,75 @@
+#summary A summary of RequestFactory changes in GWT 2.4
+
+= !RequestFactory changes in GWT 2.4 =
+
+[http://code.google.com/p/google-web-toolkit/issues/list?can=2q=Milestone%3D2_4+requestfactorycolspec=ID+Type+Status+Owner+Milestone+Summary+Starscells=tiles  
Issue  
tracker search]

+
+wiki:toc /
+
+== Overview ==
+  * (Issue 5367) RequestFactory now supports polymorphic return values.
+  * (Issue 5394) Make type and operation tokens more compact
+* Method overloads are now supported in RequestContexts.
+  * (Issue 5901) RequestFactory now uses the  
`javax.validation.ConstraintViolation` interface

+  * (Issue 6035) Proxy interfaces can be composed
+  * (Issue 6139) Memory leak in JRE-clean implementation fixed
+  * (Issue 6234) RequestContext interfaces can be composed
+  * (Issue 6253) All RequestFactory and AutoBean interfaces have moved to  
the `com.google.web.bindery' namespace
+  * (Issue 6393) `RequestFactoryServlet.getThreadLocalServletContext()`  
provides access to the current HTTP request's `ServletContext`
+  * (Issue 6469) Provide getters for `ServerFailure - Request -  
RequestContext - RequestFactory - RequestTransport`

+
+== Polymorphism support ==
+
+A proxy type will be available on the client:
+  * Referenced from a RequestContext as a Request parameter or return type.
+  * Referenced from a referenced proxy.
+  * Supertypes of referenced proxies that are proxies (i.e. assignable to  
EntityProxy or ValueProxy and has an @ProxyFor(Name) annotation).
+  * Referenced via an @ExtraTypes annotation placed on the RequestFactory,  
RequestContext, or a referenced proxy.
+* Adding an @ExtraTypes annotation on the RequestFactory or  
RequestContext allows you to add subtypes to some else's proxy types.

+
+Type-mapping rules:
+  * All properties defined in a proxy type or inherited from  
super-interfaces must be available on the domain type.

+* This allows a proxy interface to extend a mix-in interface.
+  * All proxies must map to a single domain type via a @ProxyFor(Name)  
annotation.
+  * The @ProxyFor of the proxy instance is used to determine which  
concrete type on the server to instantiate.
+  * Any supertypes of a proxy interface that are assignable to EntityProxy  
or ValueProxy and have an @ProxyFor(Name) annotation must be valid proxies.
+* Given BProxy extends AProxy: if only BProxy is referenced (e.g. via  
@ExtraTypes), it is still permissable to create an AProxy.
+  * Type relationships between proxy interfaces do not require any  
particular type relationship between the mapped domain types.
+* Given BProxy extends AProxy: it is allowable for BEntity not to be a  
subclass of AEntity.
+* This allows for duck-type-mapping of domain objects to proxy  
interfaces.
+  * To return a domain object via a proxy interface, the declared proxy  
return type must map to a domain type assignable to the returned domain  
object.
+  * The specific returned proxy type will be the most-derived type  
assignable to the declared proxy type that also maps to the returned domain  
type or one of its supertypes.

+
+== !RequestFactorySource and Annotation Processing ==
+
+Users who depend on RequestFactorySource must now compile their proxy
+interfaces with the RequestFactory annotation processor.  This tool is
+bundled in the requestfactory-client.jar or available separately in
+requestfactory-apt.jar.  For Java 6 users, javac will automatically
+detect the annotation processor.  Eclipse users will need to enable
+annotation processing via Project properties -- Java Compiler --
+Annotation Processing and add requestfactory-apt.jar to the list of
+jars in Java Compiler -- Annotation Processing -- Factory Path.
+
+Users can confirm that the annotation processor is installed by
+looking for a META-INF/requestFactory/typeTokens file to be generated
+in the compiler's output directory.  This file must be packaged into
+the jar file that contains the compiled proxy classes.
+
+Additionally, the -Averbose=true flag can be passed to javac (or
+specified in the Annotation Processing configuration UI) to enable
+diagnostic output for the annotation processor.
+
+== !ServiceLayer changes ==
+
+Several of the ServiceLayer.resolveX() method signatures have changed
+in this release.  These changes were made in order to allow the use of
+obfuscated type and operation tokens to reduce payload and generated
+JS size and to allow the use of overloaded method names in
+RequestContext subtypes.  Users who have written their own
+ServiceLayerDecorator subclasses that override any of the resolveX()
+methods will need 

[gwt-contrib] Re: Suport polymorphic return values in RequestFactory. (issue1453811)

2011-06-10 Thread bobv

Both polymorphic return and parameter values are supported.  Turns out
that polymorphic parameters already worked.

Committed at r10317.


http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java
File
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java#newcode251
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java:251:
poison(Unable to find extra type %s in TypeOracle,
clazz.getCanonicalName());
On 2011/06/10 19:20:41, rjrjr wrote:

TypeOracle is an implementation detail, odd to see it called out in a

user

facing error message. How about Unknown class %s in @ExtraTypes?


Done.

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java#newcode289
user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/RequestFactoryModel.java:289:
builder.setSuperProxyTyes(superTypes);
On 2011/06/10 19:20:41, rjrjr wrote:

Tyes


Done.

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java
File
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java#newcode62
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java:62:
* method declared to return Integer.
On 2011/06/10 19:20:41, rjrjr wrote:

Are such cases this subtle a fail in real life? Seems like this could

be

maddening to debug.


Expanded the comment to explain why this normally won't happen.

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java
File
user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java
(right):

http://gwt-code-reviews.appspot.com/1453811/diff/1/user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java#newcode19
user/test/com/google/web/bindery/requestfactory/shared/TestRequestFactory.java:19:
* Creates TestFooPolymorphicRequest.
On 2011/06/10 19:20:41, rjrjr wrote:

Does this test serve any purpose any more? If so, could you spell out

what it

is?


Done.

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

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


[gwt-contrib] [google-web-toolkit] r10319 committed - Edited wiki page RequestFactory_2_4 through web user interface.

2011-06-10 Thread codesite-noreply

Revision: 10319
Author:   b...@google.com
Date: Fri Jun 10 14:37:27 2011
Log:  Edited wiki page RequestFactory_2_4 through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=10319

Modified:
 /wiki/RequestFactory_2_4.wiki

===
--- /wiki/RequestFactory_2_4.wiki   Fri Jun 10 14:24:57 2011
+++ /wiki/RequestFactory_2_4.wiki   Fri Jun 10 14:37:27 2011
@@ -2,7 +2,7 @@

 = !RequestFactory changes in GWT 2.4 =

-[http://code.google.com/p/google-web-toolkit/issues/list?can=2q=Milestone%3D2_4+requestfactorycolspec=ID+Type+Status+Owner+Milestone+Summary+Starscells=tiles  
Issue  
tracker search]
+[http://code.google.com/p/google-web-toolkit/issues/list?can=1q=requestfactory%20Milestone=2_4sort=idcolspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars%20Releasenote  
Issue  
tracker search]


 wiki:toc /

@@ -20,56 +20,34 @@

 == Polymorphism support ==

-A proxy type will be available on the client:
-  * Referenced from a RequestContext as a Request parameter or return type.
+A proxy type will be available on the client if it is:
+  * Referenced from a `RequestContext` as a `Request` parameter or return  
type.

   * Referenced from a referenced proxy.
-  * Supertypes of referenced proxies that are proxies (i.e. assignable to  
EntityProxy or ValueProxy and has an @ProxyFor(Name) annotation).
-  * Referenced via an @ExtraTypes annotation placed on the RequestFactory,  
RequestContext, or a referenced proxy.
-* Adding an @ExtraTypes annotation on the RequestFactory or  
RequestContext allows you to add subtypes to some else's proxy types.
+  * A supertype of a referenced proxy that is also a proxy (i.e.  
assignable to `EntityProxy` or `ValueProxy` and has an `@ProxyFor(Name)`  
annotation).
+  * Referenced via an `@ExtraTypes` annotation placed on the  
RequestFactory, `RequestContext`, or a referenced proxy.
+* Adding an `@ExtraTypes` annotation on the RequestFactory or  
`RequestContext` allows you to add subtypes to some else's proxy types.


 Type-mapping rules:
   * All properties defined in a proxy type or inherited from  
super-interfaces must be available on the domain type.

 * This allows a proxy interface to extend a mix-in interface.
-  * All proxies must map to a single domain type via a @ProxyFor(Name)  
annotation.
-  * The @ProxyFor of the proxy instance is used to determine which  
concrete type on the server to instantiate.
-  * Any supertypes of a proxy interface that are assignable to EntityProxy  
or ValueProxy and have an @ProxyFor(Name) annotation must be valid proxies.
-* Given BProxy extends AProxy: if only BProxy is referenced (e.g. via  
@ExtraTypes), it is still permissable to create an AProxy.
+  * All proxies must map to a single domain type via a `@ProxyFor(Name)`  
annotation.
+  * The `@ProxyFor` of the proxy instance is used to determine which  
concrete type on the server to instantiate.
+  * Any supertypes of a proxy interface that are assignable to  
`EntityProxy` or `ValueProxy` and have an `@ProxyFor(Name)` annotation must  
be valid proxies.
+* Given `BProxy extends AProxy`: if only `BProxy` is referenced (e.g.  
via `@ExtraTypes`), it is still permissible to create an `AProxy`.
   * Type relationships between proxy interfaces do not require any  
particular type relationship between the mapped domain types.
-* Given BProxy extends AProxy: it is allowable for BEntity not to be a  
subclass of AEntity.
+* Given `BProxy extends AProxy`: it is allowable for `BEntity` not to  
be a subclass of `AEntity`.
 * This allows for duck-type-mapping of domain objects to proxy  
interfaces.
   * To return a domain object via a proxy interface, the declared proxy  
return type must map to a domain type assignable to the returned domain  
object.
   * The specific returned proxy type will be the most-derived type  
assignable to the declared proxy type that also maps to the returned domain  
type or one of its supertypes.


 == !RequestFactorySource and Annotation Processing ==

-Users who depend on RequestFactorySource must now compile their proxy
-interfaces with the RequestFactory annotation processor.  This tool is
-bundled in the requestfactory-client.jar or available separately in
-requestfactory-apt.jar.  For Java 6 users, javac will automatically
-detect the annotation processor.  Eclipse users will need to enable
-annotation processing via Project properties -- Java Compiler --
-Annotation Processing and add requestfactory-apt.jar to the list of
-jars in Java Compiler -- Annotation Processing -- Factory Path.
-
-Users can confirm that the annotation processor is installed by
-looking for a META-INF/requestFactory/typeTokens file to be generated
-in the compiler's output directory.  This file must be packaged into
-the jar file that contains the compiled proxy classes.
-
-Additionally, the -Averbose=true flag can be passed to javac (or
-specified in the Annotation 

[gwt-contrib] [google-web-toolkit] r10320 committed - Fixes a problem where inheriting LoggingDisabled (like RequestFactory ...

2011-06-10 Thread codesite-noreply

Revision: 10320
Author:   rj...@google.com
Date: Fri Jun 10 11:47:48 2011
Log:  Fixes a problem where inheriting LoggingDisabled (like  
RequestFactory does) clobbers the value of gwt.logging.enabled for  
downstream modules.
Without this change RequestFactory apps were forced to set  
gwt.logging.enabled themselves, instead of just inheriting Logging.gwt.xml


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

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

Modified:
  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/mobilewebapp/MobileWebApp.gwt.xml

 /trunk/user/src/com/google/gwt/logging/Logging.gwt.xml
 /trunk/user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml

===
---  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/mobilewebapp/MobileWebApp.gwt.xml	 
Wed Jun  1 09:26:16 2011
+++  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/mobilewebapp/MobileWebApp.gwt.xml	 
Fri Jun 10 11:47:48 2011

@@ -8,6 +8,12 @@
   inherits name='com.google.gwt.editor.Editor'/
   inherits name='com.google.gwt.sample.mobilewebapp.FormFactor'/
   inherits name='com.google.web.bindery.requestfactory.RequestFactory'/
+
+  !-- Use GWT's java.util.logging emulation --
+  inherits name=com.google.gwt.logging.Logging/
+  !-- Turn off the popup log handler, which is on by default to make sure
+   people are very aware that they are including the logging code --
+  set-property name=gwt.logging.popupHandler value=DISABLED /

   inherits name='com.google.gwt.sample.gaerequest.GaeRequest'/
   inherits name='com.google.gwt.sample.core.Core'/
===
--- /trunk/user/src/com/google/gwt/logging/Logging.gwt.xml	Wed Jun  8  
16:44:32 2011
+++ /trunk/user/src/com/google/gwt/logging/Logging.gwt.xml	Fri Jun 10  
11:47:48 2011

@@ -13,125 +13,6 @@
 !-- limitations under the  
License. --


 module
-  inherits name=com.google.gwt.json.JSON/
-  inherits name=com.google.gwt.user.User /
-  inherits name=com.google.gwt.logging.LogImpl/
-  source path=client /
-  source path=shared /
-
-  replace-with  
class=com.google.gwt.logging.client.LogConfiguration.LogConfigurationImplRegular
-when-type-is  
class=com.google.gwt.logging.client.LogConfiguration.LogConfigurationImplNull/

-when-property-is name=gwt.logging.enabled value=TRUE /
-  /replace-with
-
-
-  !-- Set up and handle the gwt.logging.logLevel property --
-  define-property name=gwt.logging.logLevel values=ALL, FINEST, FINER,  
FINE, CONFIG, INFO, WARNING, SEVERE /

-  replace-with class=com.google.gwt.logging.client.DefaultLevel.All
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=ALL /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Finest
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=FINEST /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Finer
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=FINER /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Fine
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=FINE /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Config
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=CONFIG /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Info
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=INFO /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Warning
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=WARNING /
-  /replace-with
-  replace-with class=com.google.gwt.logging.client.DefaultLevel.Severe
-when-type-is class=com.google.gwt.logging.client.DefaultLevel /
-when-property-is name=gwt.logging.logLevel value=SEVERE /
-  /replace-with
-
-
-  !-- Set up and handle the gwt.logging.xxxHandler properties --
-  define-property name=gwt.logging.consoleHandler values=ENABLED,  
DISABLED /

-  replace-with class=com.google.gwt.logging.client.NullLogHandler
-when-type-is class=com.google.gwt.logging.client.ConsoleLogHandler  
/

-any
-  when-property-is name=gwt.logging.enabled value=FALSE /
-  when-property-is name=gwt.logging.consoleHandler value=DISABLED  
/

-/any
-  /replace-with
-  define-property name=gwt.logging.developmentModeHandler  
values=ENABLED, DISABLED /

-  replace-with 

[gwt-contrib] Re: Fixes a problem where inheriting LoggingDisabled (like RequestFactory does) clobbers the value o... (issue1451816)

2011-06-10 Thread rjrjr

r10320

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

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


[gwt-contrib] Clean up RequestFactoryInterfaceValidator and Deobfuscator to simplify (issue1455803)

2011-06-10 Thread bobv

Reviewers: rjrjr,

Description:
Clean up RequestFactoryInterfaceValidator and Deobfuscator to simplify
ResolverServiceLayer.
This allows the validator to be jettisoned in favor of a lighter-weight
object.
Patch by: bobv
Review by: rjrjr


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

Affected files:
  M user/src/com/google/web/bindery/requestfactory/server/Deobfuscator.java
  M user/src/com/google/web/bindery/requestfactory/server/OperationData.java
  M  
user/src/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidator.java
  M  
user/src/com/google/web/bindery/requestfactory/server/ResolverServiceLayer.java
  M  
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidatorTest.java
  M  
user/test/com/google/web/bindery/requestfactory/server/RequestFactoryPolymorphicJreTest.java



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


[gwt-contrib] Re: Clean up RequestFactoryInterfaceValidator and Deobfuscator to simplify (issue1455803)

2011-06-10 Thread rjrjr

LGTM

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

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


[gwt-contrib] Re: inline imgs with safeuri

2011-06-10 Thread Thomas Broyer
See http://code.google.com/p/google-web-toolkit/issues/detail?id=6145

There's some additional work needed in UiBinder to better support SafeUri 
(generate a SafeUri argument in the generated SafeHtmlTemplates, instead of 
a String argument; and similarly for SafeStyles).

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