Program: 174793
Project: 174793
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("String_Node_Str");
        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");
    }
  }
  if (webapp == null) {
    webapp=req.getParameter(REQUEST_PARAM_WEBAPP);
  }
  if (webapp != null) {
    pathBuilder.insert(0,"String_Node_Str" + webapp);
  }
  String path=pathBuilder.toString();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + methodName);
    logger.debug("String_Node_Str" + store);
    logger.debug("String_Node_Str" + path);
  }
  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());
}
}

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();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + methodName);
    logger.debug("String_Node_Str" + store);
    logger.debug("String_Node_Str" + path);
  }
  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());
}
}