nus-yam/ex-repair huggingface dataset:
Program: 47002
Project: 47002
Buggy source:
@Test public void testAssetsController404() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  Result result=Results.ok();
  renderable.render(contextRenerable,result);
  verify(contextRenerable).finalizeHeaders(resultCaptor.capture());
  assertTrue(resultCaptor.getValue().getStatusCode() == Result.SC_404_NOT_FOUND);
}

Fixed version (ground truth):
@Test public void testAssetsController404() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  Result result=Results.ok();
  renderable.render(contextRenerable,result);
  verify(contextRenerable).finalizeHeadersWithoutFlashAndSessionCookie(resultCaptor.capture());
  assertTrue(resultCaptor.getValue().getStatusCode() == Result.SC_404_NOT_FOUND);
}
Program: 47003
Project: 47003
Buggy source:
@Test public void testAssetsController304NotModified() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  Result result=Results.ok();
  result.status(Result.SC_304_NOT_MODIFIED);
  renderable.render(contextRenerable,result);
  verify(httpCacheToolkit).addEtag(Mockito.eq(contextRenerable),Mockito.eq(result),Mockito.anyLong());
  verify(contextRenerable).finalizeHeaders(resultCaptor.capture());
  assertEquals(Result.SC_304_NOT_MODIFIED,resultCaptor.getValue().getStatusCode());
}

Fixed version (ground truth):
@Test public void testAssetsController304NotModified() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  Result result=Results.ok();
  result.status(Result.SC_304_NOT_MODIFIED);
  renderable.render(contextRenerable,result);
  verify(httpCacheToolkit).addEtag(Mockito.eq(contextRenerable),Mockito.eq(result),Mockito.anyLong());
  verify(contextRenerable).finalizeHeadersWithoutFlashAndSessionCookie(resultCaptor.capture());
  assertEquals(Result.SC_304_NOT_MODIFIED,resultCaptor.getValue().getStatusCode());
}
Program: 47004
Project: 47004
Buggy source:
@Test public void testAssetsControllerNormalOperationModifiedNoCaching() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  Result result=Results.ok();
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  when(mimeTypes.getContentType(Mockito.eq(contextRenerable),Mockito.anyString())).thenReturn("String_Node_Str");
  when(contextRenerable.finalizeHeaders(Mockito.eq(result))).thenReturn(responseStreams);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  when(responseStreams.getOutputStream()).thenReturn(byteArrayOutputStream);
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  renderable.render(contextRenerable,result);
  verify(httpCacheToolkit).addEtag(Mockito.eq(contextRenerable),Mockito.eq(result),Mockito.anyLong());
  verify(contextRenerable).finalizeHeaders(resultCaptor.capture());
  assertEquals(Result.SC_200_OK,resultCaptor.getValue().getStatusCode());
  assertEquals("String_Node_Str",result.getContentType());
  assertEquals("String_Node_Str",byteArrayOutputStream.toString());
}

Fixed version (ground truth):
@Test public void testAssetsControllerNormalOperationModifiedNoCaching() throws Exception {
  AssetsController assetsController=new AssetsController(httpCacheToolkit,mimeTypes,ninjaProperties);
  Result result=Results.ok();
  when(contextRenerable.getRequestPath()).thenReturn("String_Node_Str");
  when(mimeTypes.getContentType(Mockito.eq(contextRenerable),Mockito.anyString())).thenReturn("String_Node_Str");
  when(contextRenerable.finalizeHeadersWithoutFlashAndSessionCookie(Mockito.eq(result))).thenReturn(responseStreams);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  when(responseStreams.getOutputStream()).thenReturn(byteArrayOutputStream);
  Result result2=assetsController.serve(null);
  Renderable renderable=(Renderable)result2.getRenderable();
  renderable.render(contextRenerable,result);
  verify(httpCacheToolkit).addEtag(Mockito.eq(contextRenerable),Mockito.eq(result),Mockito.anyLong());
  verify(contextRenerable).finalizeHeadersWithoutFlashAndSessionCookie(resultCaptor.capture());
  assertEquals(Result.SC_200_OK,resultCaptor.getValue().getStatusCode());
  assertEquals("String_Node_Str",result.getContentType());
  assertEquals("String_Node_Str",byteArrayOutputStream.toString());
}
Program: 47005
Project: 47005
Buggy source:
@Override public ResponseStreams finalizeHeaders(Result result){
  httpServletResponse.setStatus(result.getStatusCode());
  for (  Entry<String,String> header : result.getHeaders().entrySet()) {
    httpServletResponse.addHeader(header.getKey(),header.getValue());
  }
  flashCookie.save(this,result);
  sessionCookie.save(this,result);
  for (  ninja.Cookie cookie : result.getCookies()) {
    httpServletResponse.addCookie(CookieHelper.convertNinjaCookieToServletCookie(cookie));
  }
  if (result.getContentType() != null) {
    httpServletResponse.setContentType(result.getContentType());
  }
  if (result.getCharset() != null) {
    httpServletResponse.setCharacterEncoding(result.getCharset());
  }
 else {
    httpServletResponse.setCharacterEncoding(NinjaConstant.UTF_8);
  }
  ResponseStreamsServlet responseStreamsServlet=new ResponseStreamsServlet();
  responseStreamsServlet.init(httpServletResponse);
  return (ResponseStreams)responseStreamsServlet;
}

Fixed version (ground truth):
@Override public ResponseStreams finalizeHeaders(Result result){
  return finalizeHeaders(result,true);
}
Program: 47007
Project: 47007
Buggy source:
public Result htmlEscaping(Context context){
  String maliciousJavascript="String_Node_Str";
  Map<String,String> renderMap=Maps.newHashMap();
  renderMap.put("String_Node_Str",maliciousJavascript);
  return Results.html(renderMap);
}

Fixed version (ground truth):
public Result htmlEscaping(Context context){
  String maliciousJavascript="String_Node_Str";
  Map<String,String> renderMap=Maps.newHashMap();
  renderMap.put("String_Node_Str",maliciousJavascript);
  return Results.html().render(renderMap);
}
Program: 47008
Project: 47008
Buggy source:
public Result validation(Validation validation,@Param("String_Node_Str") @Required String email){
  if (validation.hasViolations()) {
    return Results.json(validation.getFieldViolations("String_Node_Str"));
  }
 else {
    return Results.json(email);
  }
}

Fixed version (ground truth):
public Result validation(Validation validation,@Param("String_Node_Str") @Required String email){
  if (validation.hasViolations()) {
    return Results.json().render(validation.getFieldViolations("String_Node_Str"));
  }
 else {
    return Results.json().render(email);
  }
}
Program: 47009
Project: 47009
Buggy source:
public Result asyncEcho(final Context ctx){
  executorService.schedule(new Runnable(){
    @Override public void run(){
      ctx.returnResultAsync(Results.json(ctx.getParameter("String_Node_Str")));
    }
  }
,Long.parseLong(ctx.getParameter("String_Node_Str")),TimeUnit.MILLISECONDS);
  return Results.async();
}

Fixed version (ground truth):
public Result asyncEcho(final Context ctx){
  executorService.schedule(new Runnable(){
    @Override public void run(){
      ctx.returnResultAsync(Results.json().render(ctx.getParameter("String_Node_Str")));
    }
  }
,Long.parseLong(ctx.getParameter("String_Node_Str")),TimeUnit.MILLISECONDS);
  return Results.async();
}
Program: 47010
Project: 47010
Buggy source:
@Override public void run(){
  ctx.returnResultAsync(Results.json(ctx.getParameter("String_Node_Str")));
}

Fixed version (ground truth):
@Override public void run(){
  ctx.returnResultAsync(Results.json().render(ctx.getParameter("String_Node_Str")));
}
Program: 47011
Project: 47011
Buggy source:
public Result getPerson(){
  Person person=new Person();
  person.name="String_Node_Str";
  return Results.json(person);
}

Fixed version (ground truth):
public Result getPerson(){
  Person person=new Person();
  person.name="String_Node_Str";
  return Results.json().render(person);
}
Program: 47012
Project: 47012
Buggy source:
public Result postPerson(Person person){
  return Results.json(person);
}

Fixed version (ground truth):
public Result postPerson(Person person){
  return Results.json().render(person);
}
Program: 47013
Project: 47013
Buggy source:
public Result getCount(Context ctx){
  return Results.json(count.get());
}

Fixed version (ground truth):
public Result getCount(Context ctx){
  return Results.json().render(count.get());
}
Program: 47014
Project: 47014
Buggy source:
private void renderWithTemplateEngine(Context context,Result result){
  TemplateEngine templateEngine=templateEngineManager.getTemplateEngineForContentType(result.getContentType());
  if (templateEngine != null) {
    templateEngine.invoke(context,result);
  }
 else {
    if (result.getRenderable() instanceof String) {
      try {
        if (result.getContentType() == null) {
          result.contentType(Result.TEXT_PLAIN);
        }
        ResponseStreams responseStreams=context.finalizeHeaders(result);
        responseStreams.getWriter().write((String)result.getRenderable());
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
 else     if (result.getRenderable() instanceof byte[]) {
      try {
        if (result.getContentType() == null) {
          result.contentType(Result.APPLICATION_OCTET_STREAM);
        }
        ResponseStreams responseStreams=context.finalizeHeaders(result);
        responseStreams.getOutputStream().write((byte[])result.getRenderable());
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + result.getContentType());
    }
  }
}

Fixed version (ground truth):
private void renderWithTemplateEngine(Context context,Result result){
  TemplateEngine templateEngine=templateEngineManager.getTemplateEngineForContentType(result.getContentType());
  if (templateEngine != null) {
    templateEngine.invoke(context,result);
  }
 else {
    if (result.getRenderable() instanceof String) {
      try {
        if (result.getContentType() == null) {
          result.contentType(Result.TEXT_PLAIN);
        }
        ResponseStreams responseStreams=context.finalizeHeaders(result);
        responseStreams.getWriter().write((String)result.getRenderable());
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
 else     if (result.getRenderable() instanceof byte[]) {
      try {
        if (result.getContentType() == null) {
          result.contentType(Result.APPLICATION_OCTET_STREAM);
        }
        ResponseStreams responseStreams=context.finalizeHeaders(result);
        responseStreams.getOutputStream().write((byte[])result.getRenderable());
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
 else {
      context.finalizeHeaders(result);
      throw new IllegalArgumentException("String_Node_Str" + result.getContentType());
    }
  }
}
Program: 47015
Project: 47015
Buggy source:
public void handleResult(Result result,Context context){
  if (result == null || result instanceof AsyncResult) {
    return;
  }
  Object object=result.getRenderable();
  String contentType=result.getContentType();
  if (object == null && contentType == null) {
    context.finalizeHeaders(result);
  }
 else   if (object instanceof Renderable) {
    handleRenderable((Renderable)object,context,result);
  }
 else {
    if (result.getContentType() == null) {
      result.contentType(context.getAcceptContentType());
    }
    if (!result.getHeaders().containsKey(Result.CACHE_CONTROL)) {
      result.doNotCacheContent();
    }
    renderWithTemplateEngine(context,result);
  }
}

Fixed version (ground truth):
public void handleResult(Result result,Context context){
  if (result == null || result instanceof AsyncResult) {
    return;
  }
  Object object=result.getRenderable();
  if (object instanceof Renderable) {
    handleRenderable((Renderable)object,context,result);
  }
 else {
    if (result.getContentType() == null) {
      result.contentType(context.getAcceptContentType());
    }
    if (!result.getHeaders().containsKey(Result.CACHE_CONTROL)) {
      result.doNotCacheContent();
    }
    renderWithTemplateEngine(context,result);
  }
}
Program: 47016
Project: 47016
Buggy source:
private void handleRenderable(Renderable renderable,Context context,Result result){
  try {
    renderable.render(context,result);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void handleRenderable(Renderable renderable,Context context,Result result){
  try {
    renderable.render(context,result);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 47017
Project: 47017
Buggy source:
@Inject public ResultHandler(TemplateEngineManager templateEngineManager){
  this.templateEngineManager=templateEngineManager;
}

Fixed version (ground truth):
@Inject public ResultHandler(Logger logger,TemplateEngineManager templateEngineManager){
  this.logger=logger;
  this.templateEngineManager=templateEngineManager;
}
Program: 47018
Project: 47018
Buggy source:
@Before public void init() throws Exception {
  resultHandler=new ResultHandler(templateEngineManager);
  when(responseStreams.getOutputStream()).thenReturn(outputStream);
  when(responseStreams.getWriter()).thenReturn(writer);
  when(context.finalizeHeaders(any(Result.class))).thenReturn(responseStreams);
  when(templateEngineManager.getTemplateEngineForContentType(Result.APPLICATON_JSON)).thenReturn(templateEngine);
}

Fixed version (ground truth):
@Before public void init() throws Exception {
  resultHandler=new ResultHandler(logger,templateEngineManager);
  when(responseStreams.getOutputStream()).thenReturn(outputStream);
  when(responseStreams.getWriter()).thenReturn(writer);
  when(context.finalizeHeaders(any(Result.class))).thenReturn(responseStreams);
  when(templateEngineManager.getTemplateEngineForContentType(Result.APPLICATON_JSON)).thenReturn(templateEngine);
  when(templateEngineManager.getTemplateEngineForContentType("String_Node_Str")).thenReturn(templateEngineHtml);
}
Program: 47019
Project: 47019
Buggy source:
public NinjaTestServer(){
  this.port=findAvailablePort(1000,10000);
  serverUri=createServerUri();
  server=new Server();
  try {
    Connector con=new SelectChannelConnector();
    con.setPort(port);
    server.addConnector(con);
    Context context=new Context(server,"String_Node_Str");
    NinjaPropertiesImpl ninjaProperties=new NinjaPropertiesImpl();
    ninjaProperties.setProperty(NinjaConstant.serverName,serverUri.toString());
    NinjaBootstap ninjaBootstap=new NinjaBootstap(ninjaProperties);
    ninjaBootstap.boot();
    context.addServlet(NinjaServletDispatcher.class,"String_Node_Str");
    context.addFilter(new FilterHolder(new GuiceFilter()),"String_Node_Str",Handler.ALL);
    server.start();
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
public NinjaTestServer(){
  this.port=findAvailablePort(1000,10000);
  serverUri=createServerUri();
  server=new Server();
  try {
    Connector con=new SelectChannelConnector();
    con.setPort(port);
    server.addConnector(con);
    Context context=new Context(server,"String_Node_Str");
    System.setProperty(NinjaConstant.MODE_KEY_NAME,NinjaConstant.MODE_TEST);
    NinjaPropertiesImpl ninjaProperties=new NinjaPropertiesImpl();
    ninjaProperties.setProperty(NinjaConstant.serverName,serverUri.toString());
    NinjaBootstap ninjaBootstap=new NinjaBootstap(ninjaProperties);
    ninjaBootstap.boot();
    context.addServlet(NinjaServletDispatcher.class,"String_Node_Str");
    context.addFilter(new FilterHolder(new GuiceFilter()),"String_Node_Str",Handler.ALL);
    server.start();
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
}
Program: 47020
Project: 47020
Buggy source:
@Override public void contextInitialized(ServletContextEvent servletContextEvent){
  ninjaBootstap=new NinjaBootstap();
  ninjaBootstap.boot();
  super.contextInitialized(servletContextEvent);
}

Fixed version (ground truth):
@Override public void contextInitialized(ServletContextEvent servletContextEvent){
  super.contextInitialized(servletContextEvent);
}
Program: 47021
Project: 47021
Buggy source:
@Override protected Injector getInjector(){
  return ninjaBootstap.getInjector();
}

Fixed version (ground truth):
@Override protected Injector getInjector(){
  ninjaBootstap=new NinjaBootstap();
  ninjaBootstap.boot();
  return ninjaBootstap.getInjector();
}
Program: 47022
Project: 47022
Buggy source:
@Test public void testPostPerson() throws Exception {
  Person person=new Person();
  person.name="String_Node_Str";
  String response=ninjaTestBrowser.postJson(getServerAddress() + "String_Node_Str",person);
  Person result=new Gson().fromJson(response,Person.class);
  assertEquals("String_Node_Str",result.name);
}

Fixed version (ground truth):
@Test public void testPostPerson() throws Exception {
  Person person=new Person();
  person.name="String_Node_Str";
  String response=ninjaTestBrowser.postJson(getServerAddress() + "String_Node_Str",person);
  Person result=new Gson().fromJson(response,Person.class);
  assertEquals(person.name,result.name);
}
Program: 47023
Project: 47023
Buggy source:
public String postJson(String url,Object object){
  try {
    httpClient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,HttpVersion.HTTP_1_1);
    HttpPost post=new HttpPost(url);
    ByteArrayEntity entity=new ByteArrayEntity(new Gson().toJson(object).getBytes());
    entity.setContentType("String_Node_Str");
    post.setEntity(entity);
    post.releaseConnection();
    return EntityUtils.toString(httpClient.execute(post).getEntity(),"String_Node_Str");
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public String postJson(String url,Object object){
  try {
    httpClient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,HttpVersion.HTTP_1_1);
    HttpPost post=new HttpPost(url);
    StringEntity entity=new StringEntity(new ObjectMapper().writeValueAsString(object),"String_Node_Str");
    entity.setContentType("String_Node_Str");
    post.setEntity(entity);
    post.releaseConnection();
    return EntityUtils.toString(httpClient.execute(post).getEntity(),"String_Node_Str");
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 47024
Project: 47024
Buggy source:
public String uploadFile(String url,String paramName,File fileToUpload){
  String response=null;
  try {
    HttpClient client=new DefaultHttpClient();
    client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,HttpVersion.HTTP_1_1);
    HttpPost post=new HttpPost(url);
    MultipartEntity entity=new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
    entity.addPart(paramName,new FileBody(((File)fileToUpload),"String_Node_Str"));
    post.setEntity(entity);
    response=EntityUtils.toString(client.execute(post).getEntity(),"String_Node_Str");
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return response;
}

Fixed version (ground truth):
public String uploadFile(String url,String paramName,File fileToUpload){
  String response=null;
  try {
    httpClient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,HttpVersion.HTTP_1_1);
    HttpPost post=new HttpPost(url);
    MultipartEntity entity=new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
    entity.addPart(paramName,new FileBody(((File)fileToUpload),"String_Node_Str"));
    post.setEntity(entity);
    response=EntityUtils.toString(httpClient.execute(post).getEntity(),"String_Node_Str");
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return response;
}
Program: 47025
Project: 47025
Buggy source:
private void invokeResult(Result result,Context context){
  Object object=result.getRenderable();
  if (object instanceof Renderable) {
    Renderable renderable=(Renderable)object;
    renderable.render(context,result);
  }
 else {
    context.finalizeHeaders(result);
    TemplateEngine templateEngine=templateEngineManager.getTemplateEngineForContentType(result.getContentType());
    if (templateEngine == null) {
      if (result.getRenderable() instanceof String) {
        try {
          context.getWriter().write((String)result.getRenderable());
        }
 catch (        IOException e) {
          throw new RuntimeException(e);
        }
      }
 else       if (result.getRenderable() instanceof byte[]) {
        try {
          context.getOutputStream().write((byte[])result.getRenderable());
        }
 catch (        IOException e) {
          throw new RuntimeException(e);
        }
      }
      throw new IllegalArgumentException("String_Node_Str" + result.getContentType());
    }
    templateEngine.invoke(context,result.getRenderable());
  }
}

Fixed version (ground truth):
private void invokeResult(Result result,Context context){
  Object object=result.getRenderable();
  if (object instanceof Renderable) {
    Renderable renderable=(Renderable)object;
    renderable.render(context,result);
  }
 else {
    context.finalizeHeaders(result);
    if (result.getContentType() != null) {
      TemplateEngine templateEngine=templateEngineManager.getTemplateEngineForContentType(result.getContentType());
      if (templateEngine == null) {
        if (result.getRenderable() instanceof String) {
          try {
            context.getWriter().write((String)result.getRenderable());
          }
 catch (          IOException e) {
            throw new RuntimeException(e);
          }
        }
 else         if (result.getRenderable() instanceof byte[]) {
          try {
            context.getOutputStream().write((byte[])result.getRenderable());
          }
 catch (          IOException e) {
            throw new RuntimeException(e);
          }
        }
 else         if (result.getRenderable() != null) {
          throw new IllegalArgumentException("String_Node_Str" + result.getContentType());
        }
      }
 else {
        templateEngine.invoke(context,result.getRenderable());
      }
    }
  }
}
Program: 47026
Project: 47026
Buggy source:
/** 
 * Gets a raw uri like /{name}/id/* and returns /(.*)/id/
 * @return The regex
 */
private static String convertRawUriToRegex(String rawUri){
  return rawUri.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Gets a raw uri like /{name}/id/* and returns /(.*)/id/
 * @return The regex
 */
private static String convertRawUriToRegex(String rawUri){
  return "String_Node_Str" + rawUri.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
}
Program: 47027
Project: 47027
Buggy source:
void render(ContentTypes contentType);

Fixed version (ground truth):
void render(Object object);
Program: 47028
Project: 47028
Buggy source:
@Override public void render(ContentTypes contentType,Object object){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void render(Object object){
  setContentType(contentType);
  setStatusOnResponse(httpStatus);
  TemplateEngine templateEngine=templateEngineManager.getTemplateEngineForContentType(contentType);
  templateEngine.invoke(this,object);
}
Program: 47029
Project: 47029
Buggy source:
@Override public void filter(Context context){
  Cookie[] cookies=context.getHttpServletRequest().getCookies();
  if (cookies == null) {
    continueExecution=false;
  }
 else {
    for (int i=0; i < cookies.length; i++) {
      Cookie cookie=cookies[i];
      if (cookie.getName().equals("String_Node_Str")) {
        System.out.println("String_Node_Str");
      }
 else {
        context.status(HTTP_STATUS.forbidden403).template("String_Node_Str").renderHtml();
        continueExecution=false;
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void filter(Context context){
  Cookie[] cookies=context.getHttpServletRequest().getCookies();
  if (cookies == null) {
    continueExecution=false;
    context.status(HTTP_STATUS.forbidden403).template("String_Node_Str").renderHtml();
  }
 else {
    for (int i=0; i < cookies.length; i++) {
      Cookie cookie=cookies[i];
      if (cookie.getName().equals("String_Node_Str")) {
        System.out.println("String_Node_Str");
      }
 else {
        context.status(HTTP_STATUS.forbidden403).template("String_Node_Str").renderHtml();
        continueExecution=false;
        break;
      }
    }
  }
}
Program: 47030
Project: 47030
Buggy source:
@Override public void invoke(Context context,Object object){
  Map map;
  if (!(object instanceof Map)) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    map=(Map)object;
  }
  String templateName=context.getTemplateName();
  if (templateName == null) {
    Route route=router.getRouteFor(context.getHttpServletRequest().getRequestURI());
    templateName=String.format("String_Node_Str",route.getController().getSimpleName(),route.getControllerMethod());
  }
  Configuration cfg=new Configuration();
  try {
    cfg.setClassForTemplateLoading(this.getClass(),"String_Node_Str");
    Template freemarkerTemplate=cfg.getTemplate(templateName);
    Writer out=new OutputStreamWriter(context.getHttpServletResponse().getOutputStream());
    freemarkerTemplate.process(map,out);
    out.flush();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void invoke(Context context,Object object){
  Map map;
  if (!(object instanceof Map)) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    map=(Map)object;
  }
  String templateName=context.getTemplateName();
  if (templateName == null) {
    Route route=router.getRouteFor(context.getHttpServletRequest().getRequestURI());
    templateName=String.format("String_Node_Str",route.getController().getSimpleName(),route.getControllerMethod(),FILE_SUFFIX);
  }
  Configuration cfg=new Configuration();
  try {
    cfg.setClassForTemplateLoading(this.getClass(),"String_Node_Str");
    Template freemarkerTemplate=cfg.getTemplate(templateName);
    Writer out=new OutputStreamWriter(context.getHttpServletResponse().getOutputStream());
    freemarkerTemplate.process(map,out);
    out.flush();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 47031
Project: 47031
Buggy source:
@Test public void testSecureFilter(){
  when(context.getHttpServletRequest()).thenReturn(httpServletRequest);
  when(httpServletRequest.getCookies()).thenReturn(null);
  secureFilter.filter(context);
  assertFalse(secureFilter.continueExecution());
}

Fixed version (ground truth):
@Test public void testSecureFilter(){
  when(context.getHttpServletRequest()).thenReturn(httpServletRequest);
  when(context.status(Mockito.any(HTTP_STATUS.class))).thenReturn(context);
  when(context.template(Mockito.anyString())).thenReturn(context);
  when(httpServletRequest.getCookies()).thenReturn(null);
  secureFilter.filter(context);
  assertFalse(secureFilter.continueExecution());
}
Program: 47037
Project: 47037
Buggy source:
public String getDlnaContentFeatures(DLNAImageProfile profile){
  if (profile == null || media == null || media.getImageInfo() == null) {
    return null;
  }
  DLNAImageResElement resElement=new DLNAImageResElement(profile,media.getImageInfo(),false);
  String ciFlag;
  if (resElement.getCiFlag() == null || resElement.getCiFlag() == 0) {
    ciFlag="String_Node_Str";
  }
 else {
    ciFlag="String_Node_Str" + resElement.getCiFlag().toString();
  }
  return "String_Node_Str" + profile + ciFlag+ "String_Node_Str";
}

Fixed version (ground truth):
public String getDlnaContentFeatures(DLNAImageProfile profile,boolean thumbnailRequest){
  StringBuilder sb=new StringBuilder();
  if (profile != null) {
    sb.append("String_Node_Str").append(profile);
  }
  ImageInfo thumbnailImageInfo=this.thumbnailImageInfo != null ? this.thumbnailImageInfo : getMedia() != null && getMedia().getThumb() != null ? getMedia().getThumb().getImageInfo() : null;
  ImageInfo imageInfo=thumbnailRequest ? thumbnailImageInfo : media != null ? media.getImageInfo() : null;
  if (profile != null && !thumbnailRequest && thumbnailImageInfo != null && profile.useThumbnailSource(imageInfo,thumbnailImageInfo)) {
    imageInfo=thumbnailImageInfo;
  }
  if (profile != null && imageInfo != null) {
    HypotheticalResult hypotheticalResult=profile.calculateHypotheticalProperties(imageInfo);
    if (sb.length() > 0) {
      sb.append(';');
    }
    sb.append("String_Node_Str").append(hypotheticalResult.conversionNeeded ? "String_Node_Str" : "String_Node_Str");
  }
  if (sb.length() > 0) {
    sb.append(';');
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 47046
Project: 47046
Buggy source:
/** 
 * @param fileName the "file name" part of the HTTP request.
 * @return The "decoded" {@link ImageProfile} or{@link ImageProfile#JPEG_TN} if the parsing fails.
 */
public static DLNAImageProfile parseThumbRequest(String fileName){
  if (fileName.startsWith("String_Node_Str")) {
    fileName=fileName.substring(13);
    return parseImageRequest(fileName,DLNAImageProfile.JPEG_TN);
  }
 else {
    LOGGER.warn("String_Node_Str");
    return DLNAImageProfile.JPEG_TN;
  }
}

Fixed version (ground truth):
/** 
 * @param fileName the "file name" part of the HTTP request.
 * @return The "decoded" {@link ImageProfile} or{@link ImageProfile#JPEG_TN} if the parsing fails.
 */
public static DLNAImageProfile parseThumbRequest(String fileName){
  if (fileName.startsWith("String_Node_Str")) {
    fileName=fileName.substring(13);
    return parseImageRequest(fileName,DLNAImageProfile.JPEG_TN);
  }
  LOGGER.warn("String_Node_Str");
  return DLNAImageProfile.JPEG_TN;
}
Program: 47048
Project: 47048
Buggy source:
/** 
 * Retrieves the bit depth from an array of bit depths for all components. The last component's bit depth is allowed to be different from the rest, but the others must be equal or an   {@link InvalidStateException} isthrown.
 * @param bitDepthArray the array of bit depths for all components.
 * @return The bit depth value if it's constant for all but the lastcomponent.
 * @throws InvalidStateException If the bit depth values vary or{@code bitDepthArray} is null or empty.
 */
public static byte getBitDepthFromArray(byte[] bitDepthArray) throws InvalidStateException {
  if (bitDepthArray == null || bitDepthArray.length == 0) {
    throw new InvalidStateException("String_Node_Str");
  }
  try {
    return getConstantByteArrayValue(bitDepthArray);
  }
 catch (  InvalidStateException e) {
    if (bitDepthArray.length > 1) {
      byte[] tmpArray=new byte[bitDepthArray.length - 1];
      System.arraycopy(bitDepthArray,0,tmpArray,0,bitDepthArray.length - 1);
      return getConstantByteArrayValue(tmpArray);
    }
 else {
      throw e;
    }
  }
}

Fixed version (ground truth):
/** 
 * Retrieves the bit depth from an array of bit depths for all components. The last component's bit depth is allowed to be different from the rest, but the others must be equal or an   {@link InvalidStateException} isthrown.
 * @param bitDepthArray the array of bit depths for all components.
 * @return The bit depth value if it's constant for all but the lastcomponent.
 * @throws InvalidStateException If the bit depth values vary or{@code bitDepthArray} is null or empty.
 */
public static byte getBitDepthFromArray(byte[] bitDepthArray) throws InvalidStateException {
  if (bitDepthArray == null || bitDepthArray.length == 0) {
    throw new InvalidStateException("String_Node_Str");
  }
  try {
    return getConstantByteArrayValue(bitDepthArray);
  }
 catch (  InvalidStateException e) {
    if (bitDepthArray.length > 1) {
      byte[] tmpArray=new byte[bitDepthArray.length - 1];
      System.arraycopy(bitDepthArray,0,tmpArray,0,bitDepthArray.length - 1);
      return getConstantByteArrayValue(tmpArray);
    }
    throw e;
  }
}
Program: 47049
Project: 47049
Buggy source:
/** 
 * Registers a stop playing event with this   {@link SleepManager} and allowsthe system to sleep again if configured and necessary.
 */
public synchronized void stopPlaying(){
  if (playingCount == 0) {
    LOGGER.error("String_Node_Str");
    return;
  }
  playingCount--;
  if (playingCount == 0 && sleepPrevented && mode == PreventSleepMode.PLAYBACK) {
    allowSleep();
  }
}

Fixed version (ground truth):
/** 
 * Registers a stop playing event with this   {@link SleepManager} and allowsthe system to sleep again if configured and necessary.
 */
public synchronized void stopPlaying(){
  if (playingCount == 0) {
    LOGGER.error("String_Node_Str");
    return;
  }
  playingCount--;
  if (isPreventSleepSupported() && playingCount == 0 && sleepPrevented && mode == PreventSleepMode.PLAYBACK) {
    allowSleep();
  }
}
Program: 47050
Project: 47050
Buggy source:
/** 
 * Resets the system sleep timer if configured and necessary.
 */
public synchronized void postponeSleep(){
  if (mode == PreventSleepMode.PLAYBACK && !sleepPrevented) {
    resetSleepTimer();
  }
}

Fixed version (ground truth):
/** 
 * Resets the system sleep timer if configured and necessary.
 */
public synchronized void postponeSleep(){
  if (isPreventSleepSupported() && mode == PreventSleepMode.PLAYBACK && !sleepPrevented) {
    resetSleepTimer();
  }
}
Program: 47051
Project: 47051
Buggy source:
/** 
 * Registers a start playing event with this   {@link SleepManager} andprevents the system from sleeping if configured and necessary.
 */
public synchronized void startPlaying(){
  playingCount++;
  if (!sleepPrevented && mode == PreventSleepMode.PLAYBACK) {
    preventSleep();
  }
}

Fixed version (ground truth):
/** 
 * Registers a start playing event with this   {@link SleepManager} andprevents the system from sleeping if configured and necessary.
 */
public synchronized void startPlaying(){
  playingCount++;
  if (isPreventSleepSupported() && !sleepPrevented && mode == PreventSleepMode.PLAYBACK) {
    preventSleep();
  }
}
Program: 47052
Project: 47052
Buggy source:
@Override public boolean isValid(){
  if (getFormat() == null) {
    setFormat(FormatFactory.getAssociatedFormat("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isValid(){
  if (getFormat() == null) {
    setFormat(FormatFactory.getFormat(ISOVOB.class));
  }
  return true;
}
Program: 47053
Project: 47053
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean isCompatible(DLNAResource resource){
  if (PlayerUtil.isVideo(resource,Format.Identifier.ISO) || PlayerUtil.isVideo(resource,Format.Identifier.MKV) || PlayerUtil.isVideo(resource,Format.Identifier.MPG)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isCompatible(DLNAResource resource){
  if (PlayerUtil.isVideo(resource,Format.Identifier.ISOVOB) || PlayerUtil.isVideo(resource,Format.Identifier.MKV) || PlayerUtil.isVideo(resource,Format.Identifier.MPG)) {
    return true;
  }
  return false;
}
Program: 47055
Project: 47055
Buggy source:
@Override public boolean isCompatible(DLNAResource resource){
  if (PlayerUtil.isAudio(resource,Format.Identifier.AC3) || PlayerUtil.isAudio(resource,Format.Identifier.ADPCM) || PlayerUtil.isAudio(resource,Format.Identifier.ADTS)|| PlayerUtil.isAudio(resource,Format.Identifier.AIFF)|| PlayerUtil.isAudio(resource,Format.Identifier.APE)|| PlayerUtil.isAudio(resource,Format.Identifier.ATRAC)|| PlayerUtil.isAudio(resource,Format.Identifier.AU)|| PlayerUtil.isAudio(resource,Format.Identifier.DSD)|| PlayerUtil.isAudio(resource,Format.Identifier.DTS)|| PlayerUtil.isAudio(resource,Format.Identifier.EAC3)|| PlayerUtil.isAudio(resource,Format.Identifier.FLAC)|| PlayerUtil.isAudio(resource,Format.Identifier.M4A)|| PlayerUtil.isAudio(resource,Format.Identifier.MKA)|| PlayerUtil.isAudio(resource,Format.Identifier.MLP)|| PlayerUtil.isAudio(resource,Format.Identifier.MP3)|| PlayerUtil.isAudio(resource,Format.Identifier.MPA)|| PlayerUtil.isAudio(resource,Format.Identifier.OGG)|| PlayerUtil.isAudio(resource,Format.Identifier.RA)|| PlayerUtil.isAudio(resource,Format.Identifier.SHN)|| PlayerUtil.isAudio(resource,Format.Identifier.THREEGA)|| PlayerUtil.isAudio(resource,Format.Identifier.THREEG2A)|| PlayerUtil.isAudio(resource,Format.Identifier.THD)|| PlayerUtil.isAudio(resource,Format.Identifier.TTA)|| PlayerUtil.isAudio(resource,Format.Identifier.WAV)|| PlayerUtil.isAudio(resource,Format.Identifier.WMA)|| PlayerUtil.isAudio(resource,Format.Identifier.WV)|| PlayerUtil.isWebAudio(resource)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompatible(DLNAResource resource){
  if (PlayerUtil.isAudio(resource,Format.Identifier.AC3) || PlayerUtil.isAudio(resource,Format.Identifier.ADPCM) || PlayerUtil.isAudio(resource,Format.Identifier.ADTS)|| PlayerUtil.isAudio(resource,Format.Identifier.AIFF)|| PlayerUtil.isAudio(resource,Format.Identifier.APE)|| PlayerUtil.isAudio(resource,Format.Identifier.ATRAC)|| PlayerUtil.isAudio(resource,Format.Identifier.AU)|| PlayerUtil.isAudio(resource,Format.Identifier.DSD)|| PlayerUtil.isAudio(resource,Format.Identifier.DTS)|| PlayerUtil.isAudio(resource,Format.Identifier.EAC3)|| PlayerUtil.isAudio(resource,Format.Identifier.FLAC)|| PlayerUtil.isAudio(resource,Format.Identifier.M4A)|| PlayerUtil.isAudio(resource,Format.Identifier.MKA)|| PlayerUtil.isAudio(resource,Format.Identifier.MLP)|| PlayerUtil.isAudio(resource,Format.Identifier.MP3)|| PlayerUtil.isAudio(resource,Format.Identifier.MPA)|| PlayerUtil.isAudio(resource,Format.Identifier.MPC)|| PlayerUtil.isAudio(resource,Format.Identifier.OGG)|| PlayerUtil.isAudio(resource,Format.Identifier.RA)|| PlayerUtil.isAudio(resource,Format.Identifier.SHN)|| PlayerUtil.isAudio(resource,Format.Identifier.THREEGA)|| PlayerUtil.isAudio(resource,Format.Identifier.THREEG2A)|| PlayerUtil.isAudio(resource,Format.Identifier.THD)|| PlayerUtil.isAudio(resource,Format.Identifier.TTA)|| PlayerUtil.isAudio(resource,Format.Identifier.WAV)|| PlayerUtil.isAudio(resource,Format.Identifier.WMA)|| PlayerUtil.isAudio(resource,Format.Identifier.WV)|| PlayerUtil.isWebAudio(resource)) {
    return true;
  }
  return false;
}
Program: 47058
Project: 47058
Buggy source:
@Override public void run(){
  Archive rarFile=null;
  try {
    rarFile=new Archive(file);
    FileHeader header=null;
    for (    FileHeader fh : rarFile.getFileHeaders()) {
      if (fh.getFileNameString().equals(fileHeaderName)) {
        header=fh;
        break;
      }
    }
    if (header != null) {
      LOGGER.trace("String_Node_Str" + header.getFileNameString());
      rarFile.extractFile(header,out);
    }
  }
 catch (  RarException|IOException e) {
    LOGGER.debug("String_Node_Str" + e.getMessage());
  }
 finally {
    try {
      rarFile.close();
      out.close();
    }
 catch (    IOException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Archive rarFile=null;
  try {
    rarFile=new Archive(file);
    FileHeader header=null;
    for (    FileHeader fh : rarFile.getFileHeaders()) {
      if (fh.getFileNameString().equals(fileHeaderName)) {
        header=fh;
        break;
      }
    }
    if (header != null) {
      LOGGER.trace("String_Node_Str" + header.getFileNameString());
      rarFile.extractFile(header,out);
    }
  }
 catch (  RarException|IOException e) {
    LOGGER.debug("String_Node_Str" + e.getMessage());
  }
 finally {
    try {
      if (rarFile != null) {
        rarFile.close();
      }
      out.close();
    }
 catch (    IOException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
}
Program: 47059
Project: 47059
Buggy source:
@Override public void push(final OutputStream out) throws IOException {
  Runnable r=new Runnable(){
    @Override public void run(){
      Archive rarFile=null;
      try {
        rarFile=new Archive(file);
        FileHeader header=null;
        for (        FileHeader fh : rarFile.getFileHeaders()) {
          if (fh.getFileNameString().equals(fileHeaderName)) {
            header=fh;
            break;
          }
        }
        if (header != null) {
          LOGGER.trace("String_Node_Str" + header.getFileNameString());
          rarFile.extractFile(header,out);
        }
      }
 catch (      RarException|IOException e) {
        LOGGER.debug("String_Node_Str" + e.getMessage());
      }
 finally {
        try {
          rarFile.close();
          out.close();
        }
 catch (        IOException e) {
          LOGGER.debug("String_Node_Str",e);
        }
      }
    }
  }
;
  new Thread(r,"String_Node_Str").start();
}

Fixed version (ground truth):
@Override public void push(final OutputStream out) throws IOException {
  Runnable r=new Runnable(){
    @Override public void run(){
      Archive rarFile=null;
      try {
        rarFile=new Archive(file);
        FileHeader header=null;
        for (        FileHeader fh : rarFile.getFileHeaders()) {
          if (fh.getFileNameString().equals(fileHeaderName)) {
            header=fh;
            break;
          }
        }
        if (header != null) {
          LOGGER.trace("String_Node_Str" + header.getFileNameString());
          rarFile.extractFile(header,out);
        }
      }
 catch (      RarException|IOException e) {
        LOGGER.debug("String_Node_Str" + e.getMessage());
      }
 finally {
        try {
          if (rarFile != null) {
            rarFile.close();
          }
          out.close();
        }
 catch (        IOException e) {
          LOGGER.debug("String_Node_Str",e);
        }
      }
    }
  }
;
  new Thread(r,"String_Node_Str").start();
}
Program: 47060
Project: 47060
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String[] getSupportedExtensions(){
  return ISO_EXTENSIONS;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String[] getSupportedExtensions(){
  return new String[]{"String_Node_Str","String_Node_Str"};
}
Program: 47061
Project: 47061
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Identifier getIdentifier(){
  return Identifier.PLAYLIST;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Identifier getIdentifier(){
  return Identifier.PLAYLIST;
}
Program: 47062
Project: 47062
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String[] getSupportedExtensions(){
  return PLAYLIST_EXTENSIONS;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String[] getSupportedExtensions(){
  return new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}
Program: 47063
Project: 47063
Buggy source:
/** 
 * This sets all sizes that should be relative to the font size in the HTML document. This is to respect the OS font size setting used for example on high DPI monitors.
 * @param styleSheet the <code>StyleSheet</code> to modify
 */
public void buildStyleSheet(StyleSheet styleSheet){
  int baseSize=editorPane.getFont().getSize();
  String rule=String.format("String_Node_Str",Math.round(baseSize * 7 / 6),Math.round(baseSize * 5 / 6));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",baseSize * 2);
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round(baseSize * 1.5));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round(baseSize * 1.17));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",baseSize);
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round(baseSize * 10 / 6));
  styleSheet.addRule(rule);
}

Fixed version (ground truth):
/** 
 * This sets all sizes that should be relative to the font size in the HTML document. This is to respect the OS font size setting used for example on high DPI monitors.
 * @param styleSheet the <code>StyleSheet</code> to modify
 */
public void buildStyleSheet(StyleSheet styleSheet){
  int baseSize=editorPane.getFont().getSize();
  String rule=String.format("String_Node_Str",Math.round((double)baseSize * 7 / 6),Math.round((double)baseSize * 5 / 6));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",baseSize * 2);
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round(baseSize * 1.5));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round(baseSize * 1.17));
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",baseSize);
  styleSheet.addRule(rule);
  rule=String.format("String_Node_Str",Math.round((double)baseSize * 10 / 6));
  styleSheet.addRule(rule);
}
Program: 47065
Project: 47065
Buggy source:
private static void initAutoPlay(final Logical player){
  String auto=player.renderer.getAutoPlay();
  if (StringUtils.isEmpty(auto)) {
    return;
  }
  String[] strs=auto.split("String_Node_Str");
  for (  String s : strs) {
    String[] tmp=s.split("String_Node_Str",2);
    if (tmp.length != 2) {
      continue;
    }
    if (!player.renderer.getConfName().equalsIgnoreCase(tmp[0])) {
      continue;
    }
    final String folder=tmp[1];
    Runnable r=new Runnable(){
      @Override public void run(){
        while (PMS.get().getServer().getHost() == null) {
          try {
            Thread.sleep(1000);
          }
 catch (          Exception e) {
            return;
          }
        }
        RealFile f=new RealFile(new File(folder));
        f.discoverChildren();
        f.analyzeChildren(-1);
        player.addAll(-1,f.getChildren(),-1);
        try {
          Thread.sleep(1000);
        }
 catch (        Exception e) {
        }
        player.pressPlay(null,null);
      }
    }
;
    new Thread(r).start();
  }
}

Fixed version (ground truth):
private static void initAutoPlay(final Logical player){
  String auto=player.renderer.getAutoPlay();
  if (StringUtils.isEmpty(auto)) {
    return;
  }
  String[] strs=auto.split("String_Node_Str");
  for (  String s : strs) {
    String[] tmp=s.split("String_Node_Str",2);
    if (tmp.length != 2) {
      continue;
    }
    if (!player.renderer.getConfName().equalsIgnoreCase(tmp[0])) {
      continue;
    }
    final String folder=tmp[1];
    Runnable r=new Runnable(){
      @Override public void run(){
        while (PMS.get().getServer().getHost() == null) {
          try {
            Thread.sleep(1000);
          }
 catch (          InterruptedException e) {
            return;
          }
        }
        RealFile f=new RealFile(new File(folder));
        f.discoverChildren();
        f.analyzeChildren(-1);
        player.addAll(-1,f.getChildren(),-1);
        try {
          Thread.sleep(1000);
        }
 catch (        Exception e) {
        }
        player.pressPlay(null,null);
      }
    }
;
    new Thread(r).start();
  }
}