Program: 45563
Project: 45563
Buggy source:
/** 
 * Adds an entry from the X11 Apps.
 */
private void handleAdd(HttpServletRequest request,HttpServletResponse response,ContentCollection xAppsCollection) throws ServletException, IOException, ContentRepositoryException, JAXBException {
  String appName=request.getParameter("String_Node_Str");
  String command=request.getParameter("String_Node_Str");
  if (command == null || command.equals("String_Node_Str") == true) {
    String msg="String_Node_Str";
    error(request,response,msg);
    return;
  }
  if (appName == null || appName.equals("String_Node_Str") == true) {
    String tokens[]=command.split("String_Node_Str");
    String firstToken=tokens[0];
    String paths[]=firstToken.split("String_Node_Str");
    appName=paths[paths.length - 1];
  }
  String nodeName=appName + "String_Node_Str";
  ContentNode appNode=xAppsCollection.getChild(nodeName);
  if (appNode != null) {
    String msg="String_Node_Str" + appName + "String_Node_Str";
    error(request,response,msg);
    return;
  }
  appNode=xAppsCollection.createChild(nodeName,Type.RESOURCE);
  ContentResource resource=(ContentResource)appNode;
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  Writer w=new OutputStreamWriter(os);
  XAppRegistryItem item=new XAppRegistryItem(appName,command);
  item.encode(w);
  byte b[]=os.toByteArray();
  resource.put(b);
  Object obj=getServletContext().getAttribute(XAPPS_CONN_ATTR);
  if (obj != null) {
    XAppsWebConfigConnection connection=(XAppsWebConfigConnection)obj;
    connection.addX11App(appName,command);
  }
}

Fixed version (ground truth):
/** 
 * Adds an entry from the X11 Apps.
 */
private void handleAdd(HttpServletRequest request,HttpServletResponse response,ContentCollection xAppsCollection) throws ServletException, IOException, ContentRepositoryException, JAXBException {
  String appName=request.getParameter("String_Node_Str");
  String command=request.getParameter("String_Node_Str");
  if (command == null || command.equals("String_Node_Str") == true) {
    String msg="String_Node_Str";
    error(request,response,msg);
    return;
  }
  if (appName == null || appName.equals("String_Node_Str") == true) {
    String tokens[]=command.split("String_Node_Str");
    String firstToken=tokens[0];
    String paths[]=firstToken.split("String_Node_Str");
    appName=paths[paths.length - 1];
  }
  String nodeName=appName + "String_Node_Str";
  ContentNode appNode=xAppsCollection.getChild(nodeName);
  if (appNode != null) {
    String msg="String_Node_Str" + appName + "String_Node_Str";
    error(request,response,msg);
    return;
  }
  appNode=xAppsCollection.createChild(nodeName,Type.RESOURCE);
  ContentResource resource=(ContentResource)appNode;
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  Writer w=new OutputStreamWriter(os);
  XAppRegistryItem item=new XAppRegistryItem(appName,command);
  item.encode(w);
  byte b[]=os.toByteArray();
  resource.put(b);
  Object obj=getServletContext().getAttribute(XAPPS_CONN_ATTR);
  if (obj != null) {
    XAppsWebConfigConnection connection=(XAppsWebConfigConnection)obj;
    connection.addX11App(appName,command);
  }
  try {
    handleBrowse(request,response,xAppsCollection);
  }
 catch (  java.lang.Exception cre) {
    throw new ServletException(cre);
  }
}