Author: b...@google.com Date: Thu Feb 26 17:27:47 2009 New Revision: 4888 Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
Log: Use a local variable to record the RPC request id number instead of using the global variable. This change is intended to help diagnose what looks like (but shouldn't actually be) a race condition in the stats reporting code. Patch by: bobv Review by: spoon (desk) Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java ============================================================================== --- trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java (original) +++ trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java Thu Feb 26 17:27:47 2009 @@ -79,10 +79,6 @@ return requestId++; } - protected static int getRequestId() { - return requestId; - } - /** * Return <code>true</code> if the encoded response contains a value * returned by the method invocation. Modified: trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java ============================================================================== --- trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java (original) +++ trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java Thu Feb 26 17:27:47 2009 @@ -401,7 +401,8 @@ String statsMethodExpr = getProxySimpleName() + "." + syncMethod.getName(); String tossName = nameFactory.createName("toss"); w.println("boolean " + tossName + " = isStatsAvailable() && stats(" - + "timeStat(\"" + statsMethodExpr + "\", getRequestId(), \"begin\"));"); + + "timeStat(\"" + statsMethodExpr + "\", " + requestIdName + + ", \"begin\"));"); w.print(ClientSerializationStreamWriter.class.getSimpleName()); w.print(" "); @@ -464,7 +465,8 @@ + ".toString();"); w.println(tossName + " = isStatsAvailable() && stats(" + "timeStat(\"" - + statsMethodExpr + "\", getRequestId(), \"requestSerialized\"));"); + + statsMethodExpr + "\", " + requestIdName + + ", \"requestSerialized\"));"); /* * Depending on the return type for the async method, return a @@ -487,7 +489,8 @@ JType returnType = syncMethod.getReturnType(); w.print("ResponseReader." + getResponseReaderFor(returnType).name()); w.println(", \"" + getProxySimpleName() + "." + syncMethod.getName() - + "\", getRequestId(), " + payloadName + ", " + callbackName + ");"); + + "\", " + requestIdName + ", " + payloadName + ", " + callbackName + + ");"); w.outdent(); w.println("}"); } --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---