Program: 174781
Project: 174781
Buggy source:
/** 
 * Execute the webscript based on the request parameters
 */
public void execute(WebScriptRequest req,WebScriptResponse res) throws IOException {
  if (!(req instanceof WebScriptServletRequest)) {
    throw new WebScriptException("String_Node_Str");
  }
  HttpServletRequest httpReq=((WebScriptServletRequest)req).getHttpServletRequest();
  String extPath=req.getExtensionPath();
  String methodName=null;
  String store=null;
  String webapp=null;
  StringBuilder pathBuilder=null;
  StringTokenizer tokenizer=new StringTokenizer(extPath,"String_Node_Str");
  if (tokenizer.hasMoreTokens()) {
    methodName=tokenizer.nextToken();
    if (tokenizer.hasMoreTokens()) {
      String el=tokenizer.nextToken();
      if (TOKEN_STORE.equals(el)) {
        store=tokenizer.nextToken();
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
      if (TOKEN_WEBAPP.equals(el)) {
        webapp=tokenizer.nextToken();
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
      while (el != null) {
        if (pathBuilder == null) {
          pathBuilder=new StringBuilder(128);
        }
        pathBuilder.append('/');
        pathBuilder.append(el);
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
    }
  }
 else {
    throw new WebScriptException("String_Node_Str" + extPath);
  }
  if (store == null) {
    store=req.getParameter(REQUEST_PARAM_STORE);
    if (store == null) {
      store=this.defaultStore;
    }
    if (store == null) {
      throw new WebScriptException("String_Node_Str" + "String_Node_Str");
    }
  }
  if (webapp == null) {
    webapp=req.getParameter(REQUEST_PARAM_WEBAPP);
  }
  if (webapp != null) {
    pathBuilder.insert(0,"String_Node_Str" + webapp);
  }
  String path=pathBuilder.toString();
  long start=0;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + methodName.toUpperCase() + "String_Node_Str"+ store+ "String_Node_Str"+ path);
    start=System.nanoTime();
  }
  try {
    APIMethod method=APIMethod.valueOf(methodName.toUpperCase());
switch (method) {
case LASTMODIFIED:
      validatePath(path);
    lastModified(res,store,path);
  break;
case HAS:
validatePath(path);
hasDocument(res,store,path);
break;
case GET:
validatePath(path);
getDocument(res,store,path);
break;
case LIST:
listDocuments(res,store,path,false);
break;
case LISTALL:
listDocuments(res,store,path,true);
break;
case LISTPATTERN:
listDocuments(res,store,path,req.getParameter("String_Node_Str"));
break;
case CREATE:
validatePath(path);
createDocument(res,store,path,httpReq.getInputStream());
break;
case UPDATE:
validatePath(path);
updateDocument(res,store,path,httpReq.getInputStream());
break;
case DELETE:
validatePath(path);
deleteDocument(res,store,path);
break;
}
}
 catch (IllegalArgumentException enumErr) {
throw new WebScriptException("String_Node_Str" + methodName);
}
catch (IOException ioErr) {
throw new WebScriptException("String_Node_Str" + ioErr.getMessage());
}
if (logger.isDebugEnabled()) {
long end=System.nanoTime();
logger.debug("String_Node_Str" + (end - start) / 1000000f + "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Execute the webscript based on the request parameters
 */
public void execute(WebScriptRequest req,WebScriptResponse res) throws IOException {
  if (!(req instanceof WebScriptServletRequest)) {
    throw new WebScriptException("String_Node_Str");
  }
  HttpServletRequest httpReq=((WebScriptServletRequest)req).getHttpServletRequest();
  String extPath=req.getExtensionPath();
  String methodName=null;
  String store=null;
  String webapp=null;
  StringBuilder pathBuilder=null;
  StringTokenizer tokenizer=new StringTokenizer(extPath,"String_Node_Str");
  if (tokenizer.hasMoreTokens()) {
    methodName=tokenizer.nextToken();
    if (tokenizer.hasMoreTokens()) {
      String el=tokenizer.nextToken();
      if (TOKEN_STORE.equals(el)) {
        store=tokenizer.nextToken();
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
      if (TOKEN_WEBAPP.equals(el)) {
        webapp=tokenizer.nextToken();
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
      while (el != null) {
        if (pathBuilder == null) {
          pathBuilder=new StringBuilder(128);
        }
        pathBuilder.append('/');
        pathBuilder.append(el);
        el=(tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null);
      }
    }
  }
 else {
    throw new WebScriptException("String_Node_Str" + extPath);
  }
  if (store == null) {
    store=req.getParameter(REQUEST_PARAM_STORE);
    if (store == null) {
      store=this.defaultStore;
    }
    if (store == null) {
      throw new WebScriptException("String_Node_Str" + "String_Node_Str");
    }
  }
  if (webapp == null) {
    webapp=req.getParameter(REQUEST_PARAM_WEBAPP);
  }
  if (webapp != null) {
    pathBuilder.insert(0,"String_Node_Str" + webapp);
  }
  String path=pathBuilder.toString();
  long start=0;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + methodName.toUpperCase() + "String_Node_Str"+ store+ "String_Node_Str"+ path);
    start=System.nanoTime();
  }
  try {
    APIMethod method=APIMethod.valueOf(methodName.toUpperCase());
switch (method) {
case LASTMODIFIED:
      validatePath(path);
    lastModified(res,store,path);
  break;
case HAS:
validatePath(path);
hasDocument(res,store,path);
break;
case GET:
validatePath(path);
getDocument(res,store,path);
break;
case LIST:
listDocuments(res,store,path,false);
break;
case LISTALL:
listDocuments(res,store,path,true);
break;
case LISTPATTERN:
listDocuments(res,store,path,req.getParameter("String_Node_Str"));
break;
case CREATE:
validatePath(path);
if (logger.isDebugEnabled()) logger.debug("String_Node_Str" + httpReq.getContentLength());
createDocument(res,store,path,httpReq.getInputStream());
break;
case UPDATE:
validatePath(path);
if (logger.isDebugEnabled()) logger.debug("String_Node_Str" + httpReq.getContentLength());
updateDocument(res,store,path,httpReq.getInputStream());
break;
case DELETE:
validatePath(path);
deleteDocument(res,store,path);
break;
}
}
 catch (IllegalArgumentException enumErr) {
throw new WebScriptException("String_Node_Str" + methodName);
}
catch (IOException ioErr) {
throw new WebScriptException("String_Node_Str" + ioErr.getMessage());
}
if (logger.isDebugEnabled()) {
long end=System.nanoTime();
logger.debug("String_Node_Str" + (end - start) / 1000000f + "String_Node_Str");
}
}