Revision: 6871
Author: j...@google.com
Date: Thu Nov 12 06:59:32 2009
Log: This patch for a problem discussed on GWTC, fixes a problem in getting  
the real
argument names.

The path through resolveMethod that uses the descriptor works fine, but the  
one
that uses a generic signature does not pass the flag that was collected  
about
whether we have real argument names or not.

Patch by: jat
Review by: rice, bgu...@gmail.com



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

Modified:
  /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
   
/trunk/dev/core/src/com/google/gwt/dev/javac/asm/ResolveMethodSignature.java
  /trunk/dev/core/test/com/google/gwt/dev/javac/asm/ResolveGenericsTest.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java        
 
Tue Nov 10 20:42:30 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java        
 
Thu Nov 12 06:59:32 2009
@@ -937,14 +937,13 @@
      }

      String signature = methodData.getSignature();
-    Type[] argTypes = methodData.getArgTypes();
-    String[] argNames = methodData.getArgNames();
      if (signature != null) {
        // If we have a signature, use it for superclass and interfaces
        SignatureReader reader = new SignatureReader(signature);
        ResolveMethodSignature methodResolver = new ResolveMethodSignature(
            resolver, logger, method, typeParamLookup, hasReturnType,  
methodData,
-          argTypes, argNames);
+          methodData.getArgTypes(), methodData.getArgNames(),
+          methodData.hasActualArgNames());
        // TraceSignatureVisitor trace = new TraceSignatureVisitor(
        // methodData.getAccess());
        // reader.accept(trace);
=======================================
---  
/trunk/dev/core/src/com/google/gwt/dev/javac/asm/ResolveMethodSignature.java    
 
Thu Nov 12 06:32:35 2009
+++  
/trunk/dev/core/src/com/google/gwt/dev/javac/asm/ResolveMethodSignature.java    
 
Thu Nov 12 06:59:32 2009
@@ -47,6 +47,7 @@
    private final CollectMethodData methodData;
    private final Type[] argTypes;
    private final String[] argNames;
+  private final boolean argNamesAreReal;

    private JType[] returnType = new JType[1];
    private List<JType[]> params = new ArrayList<JType[]>();
@@ -54,10 +55,23 @@
    private JTypeParameter currentParam = null;
    private ArrayList<JType[]> bounds = null;

+  /**
+   * Resolve a method signature.
+   *
+   * @param resolver
+   * @param logger
+   * @param method
+   * @param typeParamLookup
+   * @param hasReturnType
+   * @param methodData
+   * @param argTypes
+   * @param argNames
+   * @param argNamesAreReal
+   */
    public ResolveMethodSignature(Resolver resolver, TreeLogger logger,
        JAbstractMethod method, TypeParameterLookup typeParamLookup,
        boolean hasReturnType, CollectMethodData methodData, Type[] argTypes,
-      String[] argNames) {
+      String[] argNames, boolean argNamesAreReal) {
      this.resolver = resolver;
      this.logger = logger;
      this.method = method;
@@ -66,6 +80,7 @@
      this.methodData = methodData;
      this.argTypes = argTypes;
      this.argNames = argNames;
+    this.argNamesAreReal = argNamesAreReal;
    }

    /**
@@ -103,7 +118,8 @@
            declaredAnnotations);

        // JParameter adds itself to the method
-      new JParameter(method, argType, argNames[i], declaredAnnotations);
+      new JParameter(method, argType, argNames[i], declaredAnnotations,
+          argNamesAreReal);
      }

      // Handle thrown exceptions
=======================================
---  
/trunk/dev/core/test/com/google/gwt/dev/javac/asm/ResolveGenericsTest.java      
 
Thu Nov 12 06:32:35 2009
+++  
/trunk/dev/core/test/com/google/gwt/dev/javac/asm/ResolveGenericsTest.java      
 
Thu Nov 12 06:59:32 2009
@@ -307,7 +307,8 @@
        argTypes[i] = Type.getType(paramTypes[i]);
      }
      ResolveMethodSignature methodResolver = new  
ResolveMethodSignature(resolver,
-        failTreeLogger, method, lookup, true, methodData, argTypes,  
argNames);
+        failTreeLogger, method, lookup, true, methodData, argTypes,  
argNames,
+        false);
      new SignatureReader(signature).accept(methodResolver);
      methodResolver.finish();
    }

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

Reply via email to