Program: 30455
Project: 30455
Buggy source:
/** 
 * MKCOL Method.
 */
protected void doMkcol(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (readOnly) {
    resp.sendError(WebdavStatus.SC_FORBIDDEN);
    return;
  }
  if (isLocked(req)) {
    resp.sendError(WebdavStatus.SC_LOCKED);
    return;
  }
  String path=getRelativePath(req);
  if (path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str") || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str")) {
    resp.sendError(WebdavStatus.SC_FORBIDDEN);
    return;
  }
  boolean exists=true;
  Object object=null;
  try {
    object=resources.lookup(path);
  }
 catch (  NamingException e) {
    exists=false;
  }
  if (exists) {
    StringBuilder methodsAllowed=determineMethodsAllowed(resources,req);
    resp.addHeader("String_Node_Str",methodsAllowed.toString());
    resp.sendError(WebdavStatus.SC_METHOD_NOT_ALLOWED);
    return;
  }
  if (req.getInputStream().available() > 0) {
    DocumentBuilder documentBuilder=getDocumentBuilder();
    try {
      Document document=documentBuilder.parse(new InputSource(req.getInputStream()));
      resp.sendError(WebdavStatus.SC_NOT_IMPLEMENTED);
      return;
    }
 catch (    SAXException saxe) {
      resp.sendError(WebdavStatus.SC_BAD_REQUEST);
      return;
    }
  }
  boolean result=true;
  try {
    resources.createSubcontext(path);
  }
 catch (  NamingException e) {
    result=false;
  }
  if (!result) {
    resp.sendError(WebdavStatus.SC_CONFLICT,WebdavStatus.getStatusText(WebdavStatus.SC_CONFLICT));
  }
 else {
    resp.setStatus(WebdavStatus.SC_CREATED);
    lockNullResources.remove(path);
  }
}

Fixed version (ground truth):
/** 
 * MKCOL Method.
 */
protected void doMkcol(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (readOnly) {
    resp.sendError(WebdavStatus.SC_FORBIDDEN);
    return;
  }
  if (isLocked(req)) {
    resp.sendError(WebdavStatus.SC_LOCKED);
    return;
  }
  String path=getRelativePath(req);
  if (path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str") || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str")) {
    resp.sendError(WebdavStatus.SC_FORBIDDEN);
    return;
  }
  boolean exists=true;
  try {
    resources.lookup(path);
  }
 catch (  NamingException e) {
    exists=false;
  }
  if (exists) {
    StringBuilder methodsAllowed=determineMethodsAllowed(resources,req);
    resp.addHeader("String_Node_Str",methodsAllowed.toString());
    resp.sendError(WebdavStatus.SC_METHOD_NOT_ALLOWED);
    return;
  }
  if (req.getInputStream().available() > 0) {
    DocumentBuilder documentBuilder=getDocumentBuilder();
    try {
      documentBuilder.parse(new InputSource(req.getInputStream()));
      resp.sendError(WebdavStatus.SC_NOT_IMPLEMENTED);
      return;
    }
 catch (    SAXException saxe) {
      resp.sendError(WebdavStatus.SC_BAD_REQUEST);
      return;
    }
  }
  boolean result=true;
  try {
    resources.createSubcontext(path);
  }
 catch (  NamingException e) {
    result=false;
  }
  if (!result) {
    resp.sendError(WebdavStatus.SC_CONFLICT,WebdavStatus.getStatusText(WebdavStatus.SC_CONFLICT));
  }
 else {
    resp.setStatus(WebdavStatus.SC_CREATED);
    lockNullResources.remove(path);
  }
}