Program: 18358
Project: 18358
Buggy source:
/** 
 * {@inheritDoc}
 */
public Resource publish(String context,List<Object> instances) throws Exception {
  Host host=ServerUtil.getDefaultHost().getHost();
  StandardContext serverContext=(StandardContext)host.findChild("String_Node_Str" + context);
  if (serverContext == null) {
    serverContext=new StandardContext();
    serverContext.setPath("String_Node_Str" + context);
    File docBase=new File(SERVER_TEMP_DIR,context);
    if (!docBase.exists()) {
      docBase.mkdirs();
    }
    serverContext.setDocBase(docBase.getPath());
    serverContext.addLifecycleListener(new ContextConfig());
    final Loader loader=new WebCtxLoader(instances.get(0).getClass().getClassLoader());
    loader.setContainer(host);
    serverContext.setLoader(loader);
    serverContext.setInstanceManager(new LocalInstanceManager());
    Wrapper wrapper=serverContext.createWrapper();
    wrapper.setName(SERVLET_NAME);
    wrapper.setServletClass(SERVLET_CLASS);
    wrapper.setLoadOnStartup(1);
    serverContext.addChild(wrapper);
    serverContext.addServletMapping("String_Node_Str",SERVLET_NAME);
    serverContext.addApplicationListener(LISTENER_CLASS);
    host.addChild(serverContext);
    serverContext.create();
    serverContext.start();
  }
  Registry registry=(Registry)serverContext.getServletContext().getAttribute(Registry.class.getName());
  for (  Object instance : instances) {
    LOG.debug("String_Node_Str" + instance);
    registry.addSingletonResource(instance);
  }
  return new RESTEasyResource();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Resource publish(String context,List<Object> instances) throws Exception {
  Host host=ServerUtil.getDefaultHost().getHost();
  StandardContext serverContext=(StandardContext)host.findChild("String_Node_Str" + context);
  if (serverContext == null) {
    serverContext=new StandardContext();
    serverContext.setPath("String_Node_Str" + context);
    File docBase=new File(SERVER_TEMP_DIR,context);
    if (!docBase.exists()) {
      docBase.mkdirs();
    }
    serverContext.setDocBase(docBase.getPath());
    serverContext.addLifecycleListener(new ContextConfig());
    final Loader loader=new WebCtxLoader(instances.get(0).getClass().getClassLoader());
    loader.setContainer(host);
    serverContext.setLoader(loader);
    serverContext.setInstanceManager(new LocalInstanceManager());
    Wrapper wrapper=serverContext.createWrapper();
    wrapper.setName(SERVLET_NAME);
    wrapper.setServletClass(SERVLET_CLASS);
    wrapper.setLoadOnStartup(1);
    serverContext.addChild(wrapper);
    serverContext.addServletMapping("String_Node_Str",SERVLET_NAME);
    serverContext.addApplicationListener(LISTENER_CLASS);
    host.addChild(serverContext);
    serverContext.create();
    serverContext.start();
    LOG.info("String_Node_Str" + serverContext.getPath());
  }
  Registry registry=(Registry)serverContext.getServletContext().getAttribute(Registry.class.getName());
  List<Class<?>> classes=new ArrayList<Class<?>>();
  for (  Object instance : instances) {
    LOG.debug("String_Node_Str" + instance);
    registry.addSingletonResource(instance);
    classes.add(instance.getClass());
  }
  RESTEasyResource resource=new RESTEasyResource();
  resource.setClasses(classes);
  resource.setContext(serverContext);
  return resource;
}