Revision: 7285
Author: [email protected]
Date: Wed Dec  9 11:18:47 2009
Log: Fixes failure of TypeOracleMediator to resolve primitive arrays.

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

Modified:
  /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
   
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/TypeOracleAnnotationSupportTest.java
   
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/test/PrimitivesAnnotatedClass.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java        
 
Thu Nov 12 08:22:02 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java        
 
Wed Dec  9 11:18:47 2009
@@ -597,6 +597,10 @@
              + value.getClass().getCanonicalName());
          return null;
        }
+      if (componentType.isPrimitive()) {
+        // primitive arrays are already resolved
+        return value;
+      }
        // resolve each element in the array
        int n = Array.getLength(value);
        Object newArray = Array.newInstance(componentType, n);
=======================================
---  
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/TypeOracleAnnotationSupportTest.java
       
Mon Nov  9 20:51:09 2009
+++  
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/TypeOracleAnnotationSupportTest.java
       
Wed Dec  9 11:18:47 2009
@@ -251,5 +251,11 @@

      short s = annotation.s();
      assertTrue(s > 0);
+
+    int[] ia = annotation.ia();
+    assertEquals(3, ia.length);
+    for (int it = 0; it < 3; ++it) {
+      assertEquals(it, ia[it]);
+    }
    }
  }
=======================================
---  
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/test/PrimitivesAnnotatedClass.java
         
Thu Feb  7 07:18:12 2008
+++  
/trunk/dev/core/test/com/google/gwt/core/ext/typeinfo/test/PrimitivesAnnotatedClass.java
         
Wed Dec  9 11:18:47 2009
@@ -21,7 +21,8 @@
   */
  @PrimitiveValuesAnnotation(b = PrimitivesAnnotatedClass.byteAsInt,
      c = (byte) 12, s = 'a', i = (short) 1452,
-    l = 12345, f = (byte) 15, d = 123412312L)
+    l = 12345, f = (byte) 15, d = 123412312L, ia = {
+    0, 1, 2})
  public class PrimitivesAnnotatedClass {
    static final int byteAsInt = 123;
  }

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

Reply via email to