[gwt-contrib] Re: Makes the @GwtTransient mechanism work for any annotation with that (issue1544803)

2011-09-13 Thread cromwellian

LGTM


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

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


[gwt-contrib] Re: Makes the @GwtTransient mechanism work for any annotation with that (issue1544803)

2011-09-13 Thread rjrjr

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

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


[gwt-contrib] [google-web-toolkit] r10644 committed - When -XdisableClassMetadata is used, Class.getName() can return Class$...

2011-09-13 Thread codesite-noreply

Revision: 10644
Author:   cromwell...@google.com
Date: Tue Sep 13 11:22:30 2011
Log:  When -XdisableClassMetadata is used, Class.getName() can return  
Class$SseedNumber as a class name. However, there are other modes where  
it can return Class$obfuscated function name. In some rare cases, these  
two could collide of if an obfuscated name of a class ended up as something  
like 'S123'. This patch changes the WebModeClientOracle to treat Class$S123  
differently than 'S123' when deobfuscating class names.


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

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

Modified:
 /trunk/user/src/com/google/gwt/rpc/server/WebModeClientOracle.java

===
--- /trunk/user/src/com/google/gwt/rpc/server/WebModeClientOracle.java	Thu  
Jul 28 15:01:32 2011
+++ /trunk/user/src/com/google/gwt/rpc/server/WebModeClientOracle.java	Tue  
Sep 13 11:22:30 2011

@@ -383,12 +383,14 @@
   @Override
   public String getTypeName(String seedName) {
 // TODO: Decide how to handle the no-metadata case
+ClassData data = null;
 if (seedName.startsWith(Class$)) {
   seedName = seedName.substring(6);
-}
-ClassData data = seedNamesToClassData.get(seedName);
+  data = seedIdsToClassData.get(seedName);
+}
+
 if (data == null) {
-  data = seedIdsToClassData.get(seedName);
+  data = seedNamesToClassData.get(seedName);
 }
 return data == null ? null : data.typeName;
   }

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


[gwt-contrib] [google-web-toolkit] r10645 committed - Makes the @GwtTransient mechanism work for any annotation with that...

2011-09-13 Thread codesite-noreply

Revision: 10645
Author:   rj...@google.com
Date: Tue Sep 13 11:23:09 2011
Log:  Makes the @GwtTransient mechanism work for any annotation with  
that

simple name.

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

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

Added:
 /trunk/user/test/com/google/gwt/user/rebind/rpc/GwtTransient.java
Modified:
 /trunk/user/src/com/google/gwt/user/client/rpc/GwtTransient.java
  
/trunk/user/src/com/google/gwt/user/rebind/rpc/SerializableTypeOracleBuilder.java
  
/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java
  
/trunk/user/test/com/google/gwt/user/rebind/rpc/SerializableTypeOracleBuilderTest.java


===
--- /dev/null
+++ /trunk/user/test/com/google/gwt/user/rebind/rpc/GwtTransient.java	Tue  
Sep 13 11:23:09 2011

@@ -0,0 +1,24 @@
+/*
+ * 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.user.rebind.rpc;
+
+/**
+ * Used to test that any annotation named @GwtTransient gets the job done.  
Need
+ * to define both a real class (TypeOracleMediator uses reflection) and a  
Java

+ * source resource (for TypeOracle itself).
+ */
+public @interface GwtTransient {
+}
===
--- /trunk/user/src/com/google/gwt/user/client/rpc/GwtTransient.java	Mon  
May 18 11:47:32 2009
+++ /trunk/user/src/com/google/gwt/user/client/rpc/GwtTransient.java	Tue  
Sep 13 11:23:09 2011

@@ -27,6 +27,10 @@
  * codetransient/code keyword should be used in preference to this
  * annotation. However, for types used with multiple serialization  
systems, it

  * can be useful.
+ * p
+ * Note that GWT will actually accept any annotation named GwtTransient  
for this
+ * purpose. This is done to allow libraries to support GWT serialization  
without

+ * creating a direct dependency on the GWT distribution.
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
===
---  
/trunk/user/src/com/google/gwt/user/rebind/rpc/SerializableTypeOracleBuilder.java	 
Thu Aug  4 06:02:26 2011
+++  
/trunk/user/src/com/google/gwt/user/rebind/rpc/SerializableTypeOracleBuilder.java	 
Tue Sep 13 11:23:09 2011

@@ -451,6 +451,15 @@

 return (JRealClassType) type;
   }
+
+  static boolean hasGwtTransientAnnotation(JField field) {
+for (Annotation a : field.getAnnotations()) {
+  if  
(a.annotationType().getSimpleName().equals(GwtTransient.class.getSimpleName()))  
{

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

   /**
* @param type the type to query
@@ -607,7 +616,7 @@
   return false;
 }

-if (field.isAnnotationPresent(GwtTransient.class)) {
+if (hasGwtTransientAnnotation(field)) {
   return false;
 }

===
---  
/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java	 
Fri Aug 26 07:32:45 2011
+++  
/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java	 
Tue Sep 13 11:23:09 2011

@@ -25,6 +25,7 @@
 import com.google.gwt.user.server.rpc.ServerCustomFieldSerializer;

 import java.io.UnsupportedEncodingException;
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Modifier;
@@ -462,6 +463,18 @@
   public static void resolveTypes(Type methodType,  
DequeMapTypeVariable?, Type resolvedTypes) {
 SerializabilityUtil.resolveTypesWorker(methodType, resolvedTypes,  
true);

   }
+
+  /**
+   * Returns true if this field has an annotation named GwtTransient.
+   */
+  static boolean hasGwtTransientAnnotation(Field field) {
+for (Annotation a : field.getAnnotations()) {
+  if  
(a.annotationType().getSimpleName().equals(GwtTransient.class.getSimpleName()))  
{

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

   static boolean isNotStaticTransientOrFinal(Field field) {
 /*
@@ -470,7 +483,7 @@
  */
 int fieldModifiers = field.getModifiers();
 return !Modifier.isStatic(fieldModifiers)  
 !Modifier.isTransient(fieldModifiers)
- !field.isAnnotationPresent(GwtTransient.class)  
 !Modifier.isFinal(fieldModifiers);
+ !hasGwtTransientAnnotation(field)  
 !Modifier.isFinal(fieldModifiers);

   }

   /**
===
---  

[gwt-contrib] Update the checkstule path for validation sample (issue1547803)

2011-09-13 Thread nchalko

Reviewers: rjrjr,

Description:
Update the checkstule path for validation sample
Fix the @NotSupported count


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

Affected files:
  M samples/common.ant.xml
  M user/build.xml


Index: samples/common.ant.xml
===
--- samples/common.ant.xml  (revision 8405)
+++ samples/common.ant.xml  (working copy)
@@ -189,8 +189,8 @@
   target name=checkstyle description=Static analysis of source
 gwt.checkstyle outputdirectory=${sample.build}
   fileset dir=src 
-exclude name=org/**/super/org/**/*.java/
-exclude  
name=com/google/gwt/sample/validation*/**/ValidationMessages.java /

+exclude name=main/java/org/**/super/org/**/*.java/
+exclude  
name=main/java/com/google/gwt/sample/validation*/**/ValidationMessages.java  
/

   /fileset
 /gwt.checkstyle
   /target
Index: user/build.xml
===
--- user/build.xml  (revision 8405)
+++ user/build.xml  (working copy)
@@ -803,13 +803,14 @@
   countfilter match=@Failing  property=jsr303.marked.Failing  
init=0/
   countfilter match=@NonTckTest   
property=jsr303.marked.NonTckTest init=0/
   countfilter match=@NotSupported   
property=jsr303.marked.NotSupported init=0/
-  countfilter match=@TestNotCompatible   
property=jsr303.marked.NotSupported init=0/
+  countfilter match=@TestNotCompatible   
property=jsr303.marked.TestNotCompatible init=0/

 /filterchain
   /scan

   !-- force to zero if not set above --
   property name=jsr303.marked.Failing value=0/
   property name=jsr303.marked.NonTckTest value=0/
+  property name=jsr303.marked.NotSupported value=0/
   property name=jsr303.marked.TestNotCompatible value=0/

   echo message=Marked Failing = ${jsr303.marked.Failing} /


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