rem: var callId = DWREngine._lastCallId++; 
add: var callId = DWREngine._nextCallId++; 
context: DWREngine._execute = function(path, scriptName, methodName, vararg_params) {  var singleShot = false;  if (DWREngine._batch == null) {    DWREngine.beginBatch();    singleShot = true;  }  // To make them easy to manipulate we copy the arguments into an args array  var args = [];  for (var i = 0; i < arguments.length - 3; i++) {    args[i] = arguments[i + 3];  }  // All the paths MUST be to the same servlet  if (DWREngine._batch.path == null) {    DWREngine._batch.path = path;  }  else {    if (DWREngine._batch.path != path) {      DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." });      return;    }  }  // From the other params, work out which is the function (or object with  // call meta-data) and which is the call parameters  var callData;  var lastArg = args[args.length - 1];  if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() };  else callData = args.pop();  // Get a unique ID for this call  var callId = DWREngine._lastCallId++;  // Copy globals into the batch if they are missing  if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler;  if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler;  if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler;  // Merge from the callData into the batch  var propname, data;  for (var i = 0; i < DWREngine._propnames.length; i++) {    propname = DWREngine._propnames[i];    if (callData[propname] != null) DWREngine._batch[propname] = callData[propname];  }  if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook);  if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook);  DWREngine._batch.callIds[callId] = {    exceptionHandler:callData.exceptionHandler,    callback:callData.callback  };  if (callData.headers) {    for (propname in callData.headers) {      data = callData[propname];      if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data;    }  }  // Copy to the map the things that need serializing  DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId();  DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId();  DWREngine._batch.map.page = window.location.pathname;  var prefix = "c" + DWREngine._batch.map.callCount + "-";  DWREngine._batch.map[prefix + "scriptName"] = scriptName;  DWREngine._batch.map[prefix + "methodName"] = methodName;  DWREngine._batch.map[prefix + "id"] = callId;  if (callData.parameters) {    for (propname in callData.parameters) {      data = callData[propname];      if (typeof data != "function") DWREngine._batch.map[propname] = "" + data;    }  }  for (i = 0; i < args.length; i++) {    DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i);  }  // Now we have finished remembering the call, we incr the call count  DWREngine._batch.map.callCount++;  if (singleShot) DWREngine.endBatch();};
meta: 266	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/266/7de576ce477a96152764438d826cfc156cdf2a6a/engine.js/buggy/java/org/directwebremoting/engine.js