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)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@4888 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
index cdcbc7b..acaa75f 100644
--- a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
+++ b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
@@ -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.
diff --git a/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java b/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
index 25fe79c..627f774 100644
--- a/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
+++ b/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
@@ -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("}");
}