nus-yam/ex-repair huggingface dataset:
Program: 90698
Project: 90698
Buggy source:
private static synchronized void initDisruptor(){
  if (disruptor != null) {
    LOGGER.trace("String_Node_Str",count);
    return;
  }
  LOGGER.trace("String_Node_Str",count);
  final int ringBufferSize=calculateRingBufferSize();
  final WaitStrategy waitStrategy=createWaitStrategy();
  executor=Executors.newSingleThreadExecutor(threadFactory);
  disruptor=new Disruptor<Log4jEventWrapper>(FACTORY,ringBufferSize,executor,ProducerType.MULTI,waitStrategy);
  final EventHandler<Log4jEventWrapper>[] handlers=new Log4jEventWrapperHandler[]{new Log4jEventWrapperHandler()};
  final ExceptionHandler errorHandler=getExceptionHandler();
  disruptor.handleExceptionsWith(errorHandler);
  disruptor.handleEventsWith(handlers);
  LOGGER.debug("String_Node_Str",disruptor.getRingBuffer().getBufferSize(),waitStrategy.getClass().getSimpleName(),errorHandler);
  disruptor.start();
}

Fixed version (ground truth):
private static synchronized void initDisruptor(){
  if (disruptor != null) {
    LOGGER.trace("String_Node_Str",count);
    return;
  }
  LOGGER.trace("String_Node_Str",count);
  final int ringBufferSize=calculateRingBufferSize();
  final WaitStrategy waitStrategy=createWaitStrategy();
  executor=Executors.newSingleThreadExecutor(threadFactory);
  initThreadLocalForExecutorThread();
  disruptor=new Disruptor<Log4jEventWrapper>(FACTORY,ringBufferSize,executor,ProducerType.MULTI,waitStrategy);
  final EventHandler<Log4jEventWrapper>[] handlers=new Log4jEventWrapperHandler[]{new Log4jEventWrapperHandler()};
  final ExceptionHandler errorHandler=getExceptionHandler();
  disruptor.handleExceptionsWith(errorHandler);
  disruptor.handleEventsWith(handlers);
  LOGGER.debug("String_Node_Str",disruptor.getRingBuffer().getBufferSize(),waitStrategy.getClass().getSimpleName(),errorHandler);
  disruptor.start();
}
Program: 90699
Project: 90699
Buggy source:
public void callAppendersFromAnotherThread(final LogEvent event){
  disruptor.getRingBuffer().publishEvent(translator,event,asyncLoggerConfig);
}

Fixed version (ground truth):
/** 
 * If possible, delegates the invocation to   {@code callAppenders} to anotherthread and returns  {@code true}. If this is not possible (if it detects that delegating to another thread would cause deadlock because the current call to Logger.log() originated from the appender thread and the ringbuffer is full) then this method does nothing and returns   {@code false}. It is the responsibility of the caller to process the event when this method returns   {@code false}.
 * @param event the event to delegate to another thread
 * @return {@code true} if delegation was successful, {@code false} if thecalling thread needs to process the event itself
 */
public boolean callAppendersFromAnotherThread(final LogEvent event){
  if (isAppenderThread.get() == Boolean.TRUE && disruptor.getRingBuffer().remainingCapacity() == 0) {
    return false;
  }
  disruptor.getRingBuffer().publishEvent(translator,event,asyncLoggerConfig);
  return true;
}
Program: 90700
Project: 90700
Buggy source:
@Test public void testCachedThreadNameStrategyReturnsCachedThreadName() throws Exception {
  final String original="String_Node_Str";
  Thread.currentThread().setName(original);
  AsyncLogger.Info info=new AsyncLogger.Info(null,original);
  assertEquals(original,AsyncLogger.ThreadNameStrategy.CACHED.getThreadName(info));
  final String name2="String_Node_Str";
  Thread.currentThread().setName(name2);
  assertEquals(original,AsyncLogger.ThreadNameStrategy.CACHED.getThreadName(info));
}

Fixed version (ground truth):
@Test public void testCachedThreadNameStrategyReturnsCachedThreadName() throws Exception {
  final String original="String_Node_Str";
  Thread.currentThread().setName(original);
  AsyncLogger.Info info=new AsyncLogger.Info(null,original,false);
  assertEquals(original,AsyncLogger.ThreadNameStrategy.CACHED.getThreadName(info));
  final String name2="String_Node_Str";
  Thread.currentThread().setName(name2);
  assertEquals(original,AsyncLogger.ThreadNameStrategy.CACHED.getThreadName(info));
}
Program: 90701
Project: 90701
Buggy source:
@Test public void testUncachedThreadNameStrategyReturnsCurrentThreadName() throws Exception {
  AsyncLogger.Info info=new AsyncLogger.Info(null,"String_Node_Str");
  final String name1="String_Node_Str";
  Thread.currentThread().setName(name1);
  assertEquals(name1,AsyncLogger.ThreadNameStrategy.UNCACHED.getThreadName(info));
  final String name2="String_Node_Str";
  Thread.currentThread().setName(name2);
  assertEquals(name2,AsyncLogger.ThreadNameStrategy.UNCACHED.getThreadName(info));
}

Fixed version (ground truth):
@Test public void testUncachedThreadNameStrategyReturnsCurrentThreadName() throws Exception {
  AsyncLogger.Info info=new AsyncLogger.Info(null,"String_Node_Str",false);
  final String name1="String_Node_Str";
  Thread.currentThread().setName(name1);
  assertEquals(name1,AsyncLogger.ThreadNameStrategy.UNCACHED.getThreadName(info));
  final String name2="String_Node_Str";
  Thread.currentThread().setName(name2);
  assertEquals(name2,AsyncLogger.ThreadNameStrategy.UNCACHED.getThreadName(info));
}
Program: 90702
Project: 90702
Buggy source:
@Override public void run(){
  while (!shutdown) {
    Serializable s;
    try {
      s=queue.take();
      if (s != null && s instanceof String && SHUTDOWN.equals(s.toString())) {
        shutdown=true;
        continue;
      }
    }
 catch (    final InterruptedException ex) {
      continue;
    }
    final Log4jLogEvent event=Log4jLogEvent.deserialize(s);
    event.setEndOfBatch(queue.isEmpty());
    boolean success=false;
    for (    final AppenderControl control : appenders) {
      try {
        control.callAppender(event);
        success=true;
      }
 catch (      final Exception ex) {
      }
    }
    if (!success && errorAppender != null) {
      try {
        errorAppender.callAppender(event);
      }
 catch (      final Exception ex) {
      }
    }
  }
  while (!queue.isEmpty()) {
    try {
      final Serializable s=queue.take();
      if (s instanceof Log4jLogEvent) {
        final Log4jLogEvent event=Log4jLogEvent.deserialize(s);
        event.setEndOfBatch(queue.isEmpty());
        for (        final AppenderControl control : appenders) {
          control.callAppender(event);
        }
      }
    }
 catch (    final InterruptedException ex) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  isAppenderThread.set(Boolean.TRUE);
  while (!shutdown) {
    Serializable s;
    try {
      s=queue.take();
      if (s != null && s instanceof String && SHUTDOWN.equals(s.toString())) {
        shutdown=true;
        continue;
      }
    }
 catch (    final InterruptedException ex) {
      continue;
    }
    final Log4jLogEvent event=Log4jLogEvent.deserialize(s);
    event.setEndOfBatch(queue.isEmpty());
    boolean success=callAppenders(event);
    if (!success && errorAppender != null) {
      try {
        errorAppender.callAppender(event);
      }
 catch (      final Exception ex) {
      }
    }
  }
  while (!queue.isEmpty()) {
    try {
      final Serializable s=queue.take();
      if (s instanceof Log4jLogEvent) {
        final Log4jLogEvent event=Log4jLogEvent.deserialize(s);
        event.setEndOfBatch(queue.isEmpty());
        callAppenders(event);
      }
    }
 catch (    final InterruptedException ex) {
    }
  }
}
Program: 90703
Project: 90703
Buggy source:
/** 
 * Actual writing occurs here. <p/>
 * @param event The LogEvent.
 */
@Override public void append(final LogEvent event){
  if (!isStarted()) {
    throw new IllegalStateException("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (event instanceof Log4jLogEvent) {
    boolean appendSuccessful=false;
    if (blocking) {
      try {
        queue.put(Log4jLogEvent.serialize((Log4jLogEvent)event,includeLocation));
        appendSuccessful=true;
      }
 catch (      final InterruptedException e) {
        LOGGER.warn("String_Node_Str",getName());
      }
    }
 else {
      appendSuccessful=queue.offer(Log4jLogEvent.serialize((Log4jLogEvent)event,includeLocation));
      if (!appendSuccessful) {
        error("String_Node_Str" + getName() + "String_Node_Str");
      }
    }
    if ((!appendSuccessful) && (errorAppender != null)) {
      errorAppender.callAppender(event);
    }
  }
}

Fixed version (ground truth):
/** 
 * Actual writing occurs here. <p/>
 * @param evt The LogEvent.
 */
@Override public void append(final LogEvent evt){
  if (!isStarted()) {
    throw new IllegalStateException("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (!(evt instanceof Log4jLogEvent)) {
    return;
  }
  Log4jLogEvent event=(Log4jLogEvent)evt;
  boolean appendSuccessful=false;
  if (blocking) {
    if (isAppenderThread.get() == Boolean.TRUE && queue.remainingCapacity() == 0) {
      event.setEndOfBatch(false);
      appendSuccessful=thread.callAppenders(event);
    }
 else {
      try {
        queue.put(Log4jLogEvent.serialize(event,includeLocation));
        appendSuccessful=true;
      }
 catch (      final InterruptedException e) {
        LOGGER.warn("String_Node_Str",getName());
      }
    }
  }
 else {
    appendSuccessful=queue.offer(Log4jLogEvent.serialize(event,includeLocation));
    if (!appendSuccessful) {
      error("String_Node_Str" + getName() + "String_Node_Str");
    }
  }
  if ((!appendSuccessful) && (errorAppender != null)) {
    errorAppender.callAppender(event);
  }
}
Program: 90704
Project: 90704
Buggy source:
/** 
 * Unregisters all MBeans associated with the specified logger context (including MBeans for   {@code LoggerConfig}s and   {@code Appender}s from the platform MBean server.
 * @param loggerContextName name of the logger context to unregister
 * @param mbs the MBean Server to unregister the instrumented objects from
 * @throws JMException if a problem occurs during de-registration
 */
public static void unregisterContext(String contextName,MBeanServer mbs){
  final String pattern=LoggerContextAdminMBean.PATTERN;
  final String search=String.format(pattern,contextName,"String_Node_Str");
  unregisterAllMatching(search,mbs);
}

Fixed version (ground truth):
/** 
 * Unregisters all MBeans associated with the specified logger context (including MBeans for   {@code LoggerConfig}s and   {@code Appender}s from the platform MBean server.
 * @param loggerContextName name of the logger context to unregister
 * @param mbs the MBean Server to unregister the instrumented objects from
 */
public static void unregisterContext(String contextName,MBeanServer mbs){
  final String pattern=LoggerContextAdminMBean.PATTERN;
  final String search=String.format(pattern,contextName,"String_Node_Str");
  unregisterAllMatching(search,mbs);
  unregisterLoggerConfigs(contextName,mbs);
  unregisterAppenders(contextName,mbs);
}
Program: 90705
Project: 90705
Buggy source:
/** 
 * Send the contents of the cyclic buffer as an e-mail message.
 * @param layout The layout for formatting the events.
 * @param appendEvent The event that triggered the send.
 */
public void sendEvents(final Layout<?> layout,final LogEvent appendEvent){
  if (message == null) {
    connect();
  }
  try {
    final LogEvent[] priorEvents=buffer.removeAll();
    if (priorEvents == null || priorEvents.length == 0) {
      return;
    }
    final byte[] rawBytes=formatContentToBytes(priorEvents,appendEvent,layout);
    final String contentType=layout.getContentType();
    final String encoding=getEncoding(rawBytes,contentType);
    final byte[] encodedBytes=encodeContentToBytes(rawBytes,encoding);
    final InternetHeaders headers=getHeaders(contentType,encoding);
    final MimeMultipart mp=getMimeMultipart(encodedBytes,headers);
    sendMultipartMessage(message,mp);
  }
 catch (  final MessagingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
catch (  final IOException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
catch (  final RuntimeException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Send the contents of the cyclic buffer as an e-mail message.
 * @param layout The layout for formatting the events.
 * @param appendEvent The event that triggered the send.
 */
public void sendEvents(final Layout<?> layout,final LogEvent appendEvent){
  if (message == null) {
    connect();
  }
  try {
    final LogEvent[] priorEvents=buffer.removeAll();
    final byte[] rawBytes=formatContentToBytes(priorEvents,appendEvent,layout);
    final String contentType=layout.getContentType();
    final String encoding=getEncoding(rawBytes,contentType);
    final byte[] encodedBytes=encodeContentToBytes(rawBytes,encoding);
    final InternetHeaders headers=getHeaders(contentType,encoding);
    final MimeMultipart mp=getMimeMultipart(encodedBytes,headers);
    sendMultipartMessage(message,mp);
  }
 catch (  final MessagingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
catch (  final IOException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
catch (  final RuntimeException e) {
    LOGGER.error("String_Node_Str",e);
    throw new LoggingException("String_Node_Str",e);
  }
}
Program: 90707
Project: 90707
Buggy source:
@Override public void flush(){
  buffer.flip();
  try {
    randomAccessFile.write(buffer.array(),0,buffer.limit());
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
  buffer.clear();
}

Fixed version (ground truth):
@Override public synchronized void flush(){
  buffer.flip();
  try {
    randomAccessFile.write(buffer.array(),0,buffer.limit());
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
  buffer.clear();
}
Program: 90708
Project: 90708
Buggy source:
@Override public void close(){
  flush();
  try {
    randomAccessFile.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}

Fixed version (ground truth):
@Override public synchronized void close(){
  flush();
  try {
    randomAccessFile.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}
Program: 90709
Project: 90709
Buggy source:
/** 
 * Flush any buffers.
 */
public void flush(){
  try {
    os.flush();
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
}

Fixed version (ground truth):
/** 
 * Flush any buffers.
 */
public synchronized void flush(){
  try {
    os.flush();
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
}
Program: 90710
Project: 90710
Buggy source:
protected void close(){
  final OutputStream stream=os;
  if (stream == System.out || stream == System.err) {
    return;
  }
  try {
    stream.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}

Fixed version (ground truth):
protected synchronized void close(){
  final OutputStream stream=os;
  if (stream == System.out || stream == System.err) {
    return;
  }
  try {
    stream.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}
Program: 90711
Project: 90711
Buggy source:
@Override public void flush(){
  buffer.flip();
  try {
    randomAccessFile.write(buffer.array(),0,buffer.limit());
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
  buffer.clear();
}

Fixed version (ground truth):
@Override public synchronized void flush(){
  buffer.flip();
  try {
    randomAccessFile.write(buffer.array(),0,buffer.limit());
  }
 catch (  final IOException ex) {
    final String msg="String_Node_Str" + getName();
    throw new AppenderRuntimeException(msg,ex);
  }
  buffer.clear();
}
Program: 90712
Project: 90712
Buggy source:
@Override public void close(){
  flush();
  try {
    randomAccessFile.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}

Fixed version (ground truth):
@Override public synchronized void close(){
  flush();
  try {
    randomAccessFile.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}
Program: 90713
Project: 90713
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public java.util.logging.Logger getParentLogger(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public java.util.logging.Logger getParentLogger(){
  throw new UnsupportedOperationException();
}
Program: 90715
Project: 90715
Buggy source:
protected void setOutputStream(final OutputStream os){
  this.os=os;
  if (header != null) {
    try {
      this.os.write(header,0,header.length);
    }
 catch (    final IOException ioe) {
      LOGGER.error("String_Node_Str",ioe);
    }
  }
}

Fixed version (ground truth):
protected void setOutputStream(final OutputStream os){
  if (header != null) {
    try {
      os.write(header,0,header.length);
      this.os=os;
    }
 catch (    final IOException ioe) {
      LOGGER.error("String_Node_Str",ioe);
    }
  }
}
Program: 90716
Project: 90716
Buggy source:
protected void close(){
  if (os == System.out || os == System.err) {
    return;
  }
  try {
    os.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}

Fixed version (ground truth):
protected void close(){
  OutputStream stream=os;
  if (stream == System.out || stream == System.err) {
    return;
  }
  try {
    stream.close();
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str" + getName() + "String_Node_Str"+ ex);
  }
}
Program: 90720
Project: 90720
Buggy source:
private void constructHierarchy(final Node node,final Element element){
  processAttributes(node,element);
  final StringBuffer buffer=new StringBuffer();
  final NodeList list=element.getChildNodes();
  final List<Node> children=node.getChildren();
  for (int i=0; i < list.getLength(); i++) {
    final org.w3c.dom.Node w3cNode=list.item(i);
    if (w3cNode instanceof Element) {
      final Element child=(Element)w3cNode;
      final String name=getType(child);
      final PluginType type=getPluginManager().getPluginType(name);
      final Node childNode=new Node(node,name,type);
      constructHierarchy(childNode,child);
      if (type == null) {
        final String value=childNode.getValue();
        if (!childNode.hasChildren() && value != null) {
          node.getAttributes().put(name,value);
        }
 else {
          status.add(new Status(name,element,ErrorType.CLASS_NOT_FOUND));
        }
      }
 else {
        children.add(childNode);
      }
    }
 else     if (w3cNode instanceof Text) {
      final Text data=(Text)w3cNode;
      buffer.append(data.getData());
    }
  }
  final String text=buffer.toString().trim();
  if (text.length() > 0 || (!node.hasChildren() && !node.isRoot())) {
    node.setValue(text);
  }
}

Fixed version (ground truth):
private void constructHierarchy(final Node node,final Element element){
  processAttributes(node,element);
  final StringBuffer buffer=new StringBuffer();
  final NodeList list=element.getChildNodes();
  final List<Node> children=node.getChildren();
  for (int i=0; i < list.getLength(); i++) {
    final org.w3c.dom.Node w3cNode=list.item(i);
    if (w3cNode instanceof Element) {
      final Element child=(Element)w3cNode;
      final String name=getType(child);
      final PluginType<?> type=getPluginManager().getPluginType(name);
      final Node childNode=new Node(node,name,type);
      constructHierarchy(childNode,child);
      if (type == null) {
        final String value=childNode.getValue();
        if (!childNode.hasChildren() && value != null) {
          node.getAttributes().put(name,value);
        }
 else {
          status.add(new Status(name,element,ErrorType.CLASS_NOT_FOUND));
        }
      }
 else {
        children.add(childNode);
      }
    }
 else     if (w3cNode instanceof Text) {
      final Text data=(Text)w3cNode;
      buffer.append(data.getData());
    }
  }
  final String text=buffer.toString().trim();
  if (text.length() > 0 || (!node.hasChildren() && !node.isRoot())) {
    node.setValue(text);
  }
}
Program: 90721
Project: 90721
Buggy source:
/** 
 * Main startup for the receiver.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length != 4) {
    usage("String_Node_Str");
  }
  final String qcfBindingName=args[0];
  final String queueBindingName=args[1];
  final String username=args[2];
  final String password=args[3];
  new JMSQueueReceiver(qcfBindingName,queueBindingName,username,password);
  final BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
  System.out.println("String_Node_Str");
  while (true) {
    final String s=stdin.readLine();
    if (s.equalsIgnoreCase("String_Node_Str")) {
      System.out.println("String_Node_Str" + "String_Node_Str");
      return;
    }
  }
}

Fixed version (ground truth):
/** 
 * Main startup for the receiver.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length != 4) {
    usage("String_Node_Str");
  }
  final String qcfBindingName=args[0];
  final String queueBindingName=args[1];
  final String username=args[2];
  final String password=args[3];
  new JMSQueueReceiver(qcfBindingName,queueBindingName,username,password);
  final Charset enc=Charset.defaultCharset();
  final BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in,enc));
  System.out.println("String_Node_Str");
  while (true) {
    final String s=stdin.readLine();
    if (s.equalsIgnoreCase("String_Node_Str")) {
      System.out.println("String_Node_Str" + "String_Node_Str");
      return;
    }
  }
}
Program: 90722
Project: 90722
Buggy source:
/** 
 * Main startup for the receiver.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length != 4) {
    usage("String_Node_Str");
  }
  final String tcfBindingName=args[0];
  final String topicBindingName=args[1];
  final String username=args[2];
  final String password=args[3];
  new JMSTopicReceiver(tcfBindingName,topicBindingName,username,password);
  final BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
  System.out.println("String_Node_Str");
  while (true) {
    final String s=stdin.readLine();
    if (s.equalsIgnoreCase("String_Node_Str")) {
      System.out.println("String_Node_Str" + "String_Node_Str");
      return;
    }
  }
}

Fixed version (ground truth):
/** 
 * Main startup for the receiver.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length != 4) {
    usage("String_Node_Str");
  }
  final String tcfBindingName=args[0];
  final String topicBindingName=args[1];
  final String username=args[2];
  final String password=args[3];
  new JMSTopicReceiver(tcfBindingName,topicBindingName,username,password);
  final Charset enc=Charset.defaultCharset();
  final BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in,enc));
  System.out.println("String_Node_Str");
  while (true) {
    final String s=stdin.readLine();
    if (s.equalsIgnoreCase("String_Node_Str")) {
      System.out.println("String_Node_Str" + "String_Node_Str");
      return;
    }
  }
}
Program: 90723
Project: 90723
Buggy source:
/** 
 * Main startup for the server.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length < 1 || args.length > 2) {
    System.err.println("String_Node_Str");
    printUsage();
    return;
  }
  final int port=Integer.parseInt(args[0]);
  if (port <= 0 || port >= MAX_PORT) {
    System.err.println("String_Node_Str");
    printUsage();
    return;
  }
  if (args.length == 2 && args[1].length() > 0) {
    ConfigurationFactory.setConfigurationFactory(new ServerConfigurationFactory(args[1]));
  }
  logger=LogManager.getLogger(SocketServer.class.getName());
  final SocketServer sserver=new SocketServer(port);
  final Thread server=new Thread(sserver);
  server.start();
  final BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
  while (true) {
    final String line=reader.readLine();
    if (line.equalsIgnoreCase("String_Node_Str") || line.equalsIgnoreCase("String_Node_Str") || line.equalsIgnoreCase("String_Node_Str")) {
      sserver.shutdown();
      server.join();
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Main startup for the server.
 * @param args The command line arguments.
 * @throws Exception if an error occurs.
 */
public static void main(final String[] args) throws Exception {
  if (args.length < 1 || args.length > 2) {
    System.err.println("String_Node_Str");
    printUsage();
    return;
  }
  final int port=Integer.parseInt(args[0]);
  if (port <= 0 || port >= MAX_PORT) {
    System.err.println("String_Node_Str");
    printUsage();
    return;
  }
  if (args.length == 2 && args[1].length() > 0) {
    ConfigurationFactory.setConfigurationFactory(new ServerConfigurationFactory(args[1]));
  }
  logger=LogManager.getLogger(SocketServer.class.getName());
  final SocketServer sserver=new SocketServer(port);
  final Thread server=new Thread(sserver);
  server.start();
  final Charset enc=Charset.defaultCharset();
  final BufferedReader reader=new BufferedReader(new InputStreamReader(System.in,enc));
  while (true) {
    final String line=reader.readLine();
    if (line.equalsIgnoreCase("String_Node_Str") || line.equalsIgnoreCase("String_Node_Str") || line.equalsIgnoreCase("String_Node_Str")) {
      sserver.shutdown();
      server.join();
      break;
    }
  }
}
Program: 90724
Project: 90724
Buggy source:
/** 
 * Create a Console Appender.
 * @param layout The layout to use (required).
 * @param filter The Filter or null.
 * @param t The target ("SYSTEM_OUT" or "SYSTEM_ERR"). The default is "SYSTEM_OUT".
 * @param follow If true will follow changes to the underlying output stream.
 * @param name The name of the Appender (required).
 * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.The default is "true".
 * @return The ConsoleAppender.
 */
@PluginFactory public static <S extends Serializable>ConsoleAppender<S> createAppender(@PluginElement("String_Node_Str") Layout<S> layout,@PluginElement("String_Node_Str") final Filter filter,@PluginAttr("String_Node_Str") final String t,@PluginAttr("String_Node_Str") final String name,@PluginAttr("String_Node_Str") final String follow,@PluginAttr("String_Node_Str") final String suppress){
  if (name == null) {
    LOGGER.error("String_Node_Str");
    return null;
  }
  if (layout == null) {
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Layout<S> l=(Layout<S>)PatternLayout.createLayout(null,null,null,null,null);
    layout=l;
  }
  final boolean isFollow=follow == null ? false : Boolean.valueOf(follow);
  final boolean handleExceptions=suppress == null ? true : Boolean.valueOf(suppress);
  final Target target=t == null ? Target.SYSTEM_OUT : Target.valueOf(t);
  return new ConsoleAppender<S>(name,layout,filter,getManager(isFollow,target),handleExceptions);
}

Fixed version (ground truth):
/** 
 * Create a Console Appender.
 * @param layout The layout to use (required).
 * @param filter The Filter or null.
 * @param t The target ("SYSTEM_OUT" or "SYSTEM_ERR"). The default is "SYSTEM_OUT".
 * @param follow If true will follow changes to the underlying output stream.
 * @param name The name of the Appender (required).
 * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.The default is "true".
 * @return The ConsoleAppender.
 */
@PluginFactory public static <S extends Serializable>ConsoleAppender<S> createAppender(@PluginElement("String_Node_Str") Layout<S> layout,@PluginElement("String_Node_Str") final Filter filter,@PluginAttr("String_Node_Str") final String t,@PluginAttr("String_Node_Str") final String name,@PluginAttr("String_Node_Str") final String follow,@PluginAttr("String_Node_Str") final String suppress){
  if (name == null) {
    LOGGER.error("String_Node_Str");
    return null;
  }
  if (layout == null) {
    @SuppressWarnings({"String_Node_Str"}) Layout<S> l=(Layout<S>)PatternLayout.createLayout(null,null,null,null,null);
    layout=l;
  }
  final boolean isFollow=follow == null ? false : Boolean.valueOf(follow);
  final boolean handleExceptions=suppress == null ? true : Boolean.valueOf(suppress);
  final Target target=t == null ? Target.SYSTEM_OUT : Target.valueOf(t);
  return new ConsoleAppender<S>(name,layout,filter,getManager(isFollow,target),handleExceptions);
}
Program: 90725
Project: 90725
Buggy source:
private static OutputStream getOutputStream(final boolean follow,final Target target){
  final PrintStream printStream=target == Target.SYSTEM_OUT ? follow ? new PrintStream(new SystemOutStream()) : System.out : follow ? new PrintStream(new SystemErrStream()) : System.err;
  PropertiesUtil propsUtil=PropertiesUtil.getProperties();
  if (!propsUtil.getStringProperty("String_Node_Str").startsWith("String_Node_Str") || propsUtil.getBooleanProperty("String_Node_Str")) {
    return printStream;
  }
 else {
    try {
      final ClassLoader loader=Loader.getClassLoader();
      final Class<?> clazz=loader.loadClass("String_Node_Str");
      final Constructor<?> constructor=clazz.getConstructor(OutputStream.class);
      return (OutputStream)constructor.newInstance(printStream);
    }
 catch (    final ClassNotFoundException cnfe) {
      LOGGER.debug("String_Node_Str");
    }
catch (    final NoSuchMethodException nsme) {
      LOGGER.warn("String_Node_Str");
    }
catch (    final Exception ex) {
      LOGGER.warn("String_Node_Str");
    }
    return printStream;
  }
}

Fixed version (ground truth):
private static OutputStream getOutputStream(final boolean follow,final Target target){
  final String enc=Charset.defaultCharset().name();
  PrintStream printStream=null;
  try {
    printStream=target == Target.SYSTEM_OUT ? follow ? new PrintStream(new SystemOutStream(),true,enc) : System.out : follow ? new PrintStream(new SystemErrStream(),true,enc) : System.err;
  }
 catch (  UnsupportedEncodingException ex) {
    throw new IllegalStateException("String_Node_Str" + enc,ex);
  }
  PropertiesUtil propsUtil=PropertiesUtil.getProperties();
  if (!propsUtil.getStringProperty("String_Node_Str").startsWith("String_Node_Str") || propsUtil.getBooleanProperty("String_Node_Str")) {
    return printStream;
  }
 else {
    try {
      final ClassLoader loader=Loader.getClassLoader();
      final Class<?> clazz=loader.loadClass("String_Node_Str");
      final Constructor<?> constructor=clazz.getConstructor(OutputStream.class);
      return (OutputStream)constructor.newInstance(printStream);
    }
 catch (    final ClassNotFoundException cnfe) {
      LOGGER.debug("String_Node_Str");
    }
catch (    final NoSuchMethodException nsme) {
      LOGGER.warn("String_Node_Str");
    }
catch (    final Exception ex) {
      LOGGER.warn("String_Node_Str");
    }
    return printStream;
  }
}
Program: 90726
Project: 90726
Buggy source:
/** 
 * Formats the Log Event as a byte array.
 * @param event The Log Event.
 * @return The formatted event as a byte array.
 */
@Override public byte[] toByteArray(final LogEvent event){
  return encoder.getBytes(toSerializable(event));
}

Fixed version (ground truth):
/** 
 * Formats the Log Event as a byte array.
 * @param event The Log Event.
 * @return The formatted event as a byte array.
 */
@Override public byte[] toByteArray(final LogEvent event){
  return toSerializable(event).getBytes(charset);
}
Program: 90727
Project: 90727
Buggy source:
protected AbstractStringLayout(final Charset charset){
  this.charset=charset;
  boolean useClass=false;
  try {
    if (String.class.getMethod("String_Node_Str",new Class[]{Charset.class}) != null) {
      useClass=true;
    }
  }
 catch (  final NoSuchMethodException ex) {
  }
  encoder=useClass ? new ClassEncoder() : new NameEncoder();
}

Fixed version (ground truth):
protected AbstractStringLayout(final Charset charset){
  this.charset=charset;
}
Program: 90728
Project: 90728
Buggy source:
/** 
 * Obtains an instance of pattern converter.
 * @param options options, may be null. May contain a list of level names andThe value that should be displayed for the Level.
 * @return instance of pattern converter.
 */
public static LevelPatternConverter newInstance(final String[] options){
  if (options == null || options.length == 0) {
    return INSTANCE;
  }
  final EnumMap<Level,String> levelMap=new EnumMap<Level,String>(Level.class);
  final String[] definitions=options[0].split("String_Node_Str");
  for (  final String def : definitions) {
    final String[] pair=def.split("String_Node_Str");
    if (pair == null || pair.length != 2) {
      LOGGER.error("String_Node_Str",def);
      continue;
    }
    final Level level=Level.toLevel(pair[0].trim(),null);
    if (level == null) {
      LOGGER.error("String_Node_Str",pair[0].trim());
    }
    levelMap.put(level,pair[1].trim());
  }
  if (levelMap.size() == 0) {
    return INSTANCE;
  }
  for (  final Level level : Level.values()) {
    if (!levelMap.containsKey(level)) {
      levelMap.put(level,level.toString());
    }
  }
  return new LevelPatternConverter(levelMap);
}

Fixed version (ground truth):
/** 
 * Obtains an instance of pattern converter.
 * @param options options, may be null. May contain a list of level names andThe value that should be displayed for the Level.
 * @return instance of pattern converter.
 */
public static LevelPatternConverter newInstance(final String[] options){
  if (options == null || options.length == 0) {
    return INSTANCE;
  }
  final EnumMap<Level,String> levelMap=new EnumMap<Level,String>(Level.class);
  final String[] definitions=options[0].split("String_Node_Str");
  for (  final String def : definitions) {
    final String[] pair=def.split("String_Node_Str");
    if (pair == null || pair.length != 2) {
      LOGGER.error("String_Node_Str",def);
      continue;
    }
    final Level level=Level.toLevel(pair[0].trim(),null);
    if (level == null) {
      LOGGER.error("String_Node_Str",pair[0].trim());
    }
 else {
      levelMap.put(level,pair[1].trim());
    }
  }
  if (levelMap.size() == 0) {
    return INSTANCE;
  }
  for (  final Level level : Level.values()) {
    if (!levelMap.containsKey(level)) {
      levelMap.put(level,level.toString());
    }
  }
  return new LevelPatternConverter(levelMap);
}
Program: 90730
Project: 90730
Buggy source:
public Stats(String raw,int repeat){
  String[] lines=raw.split("String_Node_Str");
  long totalOps=0;
  for (  String line : lines) {
    if (line.startsWith("String_Node_Str")) {
      _latencyRowCount++;
      String[] parts=line.split("String_Node_Str");
      int i=0;
      _average+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _pct99+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _pct99_99+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _count+=Integer.parseInt(parts[i].split("String_Node_Str")[1]);
    }
 else {
      _throughputRowCount++;
      String number=line.substring(0,line.indexOf(' '));
      long opsPerSec=Long.parseLong(number);
      totalOps+=opsPerSec;
    }
  }
  _averageOpsPerSec=totalOps / _throughputRowCount;
}

Fixed version (ground truth):
public Stats(String raw){
  String[] lines=raw.split("String_Node_Str");
  long totalOps=0;
  for (  String line : lines) {
    if (line.startsWith("String_Node_Str")) {
      _latencyRowCount++;
      String[] parts=line.split("String_Node_Str");
      int i=0;
      _average+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _pct99+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _pct99_99+=Long.parseLong(parts[i++].split("String_Node_Str")[1]);
      _count+=Integer.parseInt(parts[i].split("String_Node_Str")[1]);
    }
 else {
      _throughputRowCount++;
      String number=line.substring(0,line.indexOf(' '));
      long opsPerSec=Long.parseLong(number);
      totalOps+=opsPerSec;
    }
  }
  _averageOpsPerSec=totalOps / _throughputRowCount;
}
Program: 90731
Project: 90731
Buggy source:
/** 
 * @see AppenderAdminMBean#PATTERN 
 */
public ObjectName getObjectName(){
  return objectName;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code ObjectName} of this mbean.
 * @return the {@code ObjectName}
 * @see AppenderAdminMBean#PATTERN
 */
public ObjectName getObjectName(){
  return objectName;
}
Program: 90732
Project: 90732
Buggy source:
/** 
 * Throws a   {@code NullPointerException} if the specified parameter is{@code null}, otherwise returns the specified parameter. <p> Usage: <pre> // earlier you would write this: public SomeConstructor(Object param) { if (param == null) { throw new NullPointerException(name + &quot; is null&quot;); } this.field = param; } // now you can do the same in one line: public SomeConstructor(Object param) { this.field = Assert.isNotNull(param); } </pre>
 * @param checkMe the parameter to check
 * @param name name of the parameter to use in the error message if{@code null}
 * @return the specified parameter
 */
public static <T>T isNotNull(T checkMe,String name){
  if (checkMe == null) {
    throw new NullPointerException(name + "String_Node_Str");
  }
  return checkMe;
}

Fixed version (ground truth):
/** 
 * Throws a   {@code NullPointerException} if the specified parameter is{@code null}, otherwise returns the specified parameter. <p> Usage: <pre> // earlier you would write this: public SomeConstructor(Object param) { if (param == null) { throw new NullPointerException(name + &quot; is null&quot;); } this.field = param; } // now you can do the same in one line: public SomeConstructor(Object param) { this.field = Assert.isNotNull(param); } </pre>
 * @param < T > the type of the parameter to check and return
 * @param checkMe the parameter to check
 * @param name name of the parameter to use in the error message if{@code null}
 * @return the specified parameter
 */
public static <T>T isNotNull(T checkMe,String name){
  if (checkMe == null) {
    throw new NullPointerException(name + "String_Node_Str");
  }
  return checkMe;
}
Program: 90733
Project: 90733
Buggy source:
private void populateWidgets(){
  try {
    configTextArea.setText(contextAdmin.getConfigText());
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter(2048);
    ex.printStackTrace(new PrintWriter(sw));
    configTextArea.setText(sw.toString());
  }
  String uri=contextAdmin.getConfigLocationURI();
  locationTextField.setText(uri);
}

Fixed version (ground truth):
private void populateWidgets(){
  try {
    configTextArea.setText(contextAdmin.getConfigText());
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter(ERR_MSG_INITIAL_BUFFER_SIZE);
    ex.printStackTrace(new PrintWriter(sw));
    configTextArea.setText(sw.toString());
  }
  String uri=contextAdmin.getConfigLocationURI();
  locationTextField.setText(uri);
}
Program: 90734
Project: 90734
Buggy source:
private void createWidgets(){
  configTextArea=new JTextArea(CONFIG_TEXT_ROWS,CONFIG_TEXT_COLS);
  configTextArea.setBackground(Color.white);
  configTextArea.setForeground(Color.black);
  configTextArea.setFont(new Font("String_Node_Str",Font.PLAIN,configTextArea.getFont().getSize()));
  JScrollPane scrollConfig=new JScrollPane(configTextArea);
  locationTextField=new JTextField(LOCATION_TEXT_COLS);
  locationLabel=new JLabel("String_Node_Str");
  locationLabel.setLabelFor(locationTextField);
  buttonSendLocation=new JButton(actionReconfigureFromLocation);
  buttonSendConfigText=new JButton(actionReconfigureFromText);
  JPanel north=new JPanel();
  north.setLayout(new BoxLayout(north,BoxLayout.LINE_AXIS));
  north.add(locationLabel);
  north.add(locationTextField);
  north.add(buttonSendLocation);
  north.add(Box.createRigidArea(new Dimension(20,0)));
  north.add(buttonSendConfigText);
  this.setLayout(new BorderLayout());
  this.add(north,BorderLayout.NORTH);
  this.add(scrollConfig,BorderLayout.CENTER);
}

Fixed version (ground truth):
private void createWidgets(){
  configTextArea=new JTextArea(CONFIG_TEXT_ROWS,CONFIG_TEXT_COLS);
  configTextArea.setBackground(Color.white);
  configTextArea.setForeground(Color.black);
  configTextArea.setFont(new Font("String_Node_Str",Font.PLAIN,configTextArea.getFont().getSize()));
  JScrollPane scrollConfig=new JScrollPane(configTextArea);
  locationTextField=new JTextField(LOCATION_TEXT_COLS);
  locationLabel=new JLabel("String_Node_Str");
  locationLabel.setLabelFor(locationTextField);
  buttonSendLocation=new JButton(actionReconfigureFromLocation);
  buttonSendConfigText=new JButton(actionReconfigureFromText);
  JPanel north=new JPanel();
  north.setLayout(new BoxLayout(north,BoxLayout.LINE_AXIS));
  north.add(locationLabel);
  north.add(locationTextField);
  north.add(buttonSendLocation);
  north.add(Box.createRigidArea(new Dimension(HORIZONTAL_GAP,0)));
  north.add(buttonSendConfigText);
  this.setLayout(new BorderLayout());
  this.add(north,BorderLayout.NORTH);
  this.add(scrollConfig,BorderLayout.CENTER);
}
Program: 90736
Project: 90736
Buggy source:
/** 
 * @see ContextSelectorAdminMBean#NAME 
 */
public ObjectName getObjectName(){
  return objectName;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code ObjectName} of this mbean.
 * @return the {@code ObjectName}
 * @see ContextSelectorAdminMBean#NAME
 */
public ObjectName getObjectName(){
  return objectName;
}
Program: 90737
Project: 90737
Buggy source:
/** 
 * @see LoggerConfigAdminMBean#PATTERN 
 */
public ObjectName getObjectName(){
  return objectName;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code ObjectName} of this mbean.
 * @return the {@code ObjectName}
 * @see LoggerConfigAdminMBean#PATTERN
 */
public ObjectName getObjectName(){
  return objectName;
}
Program: 90738
Project: 90738
Buggy source:
/** 
 * Constructs a new   {@code LoggerContextAdmin} with the {@code Executor} tobe used for sending  {@code Notification}s asynchronously to listeners.
 * @param executor
 */
public LoggerContextAdmin(LoggerContext loggerContext,Executor executor){
  super(executor,createNotificationInfo());
  this.loggerContext=Assert.isNotNull(loggerContext,"String_Node_Str");
  try {
    String ctxName=Server.escape(loggerContext.getName());
    String name=String.format(PATTERN,ctxName);
    objectName=new ObjectName(name);
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  loggerContext.addPropertyChangeListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@code LoggerContextAdmin} with the {@code Executor} tobe used for sending  {@code Notification}s asynchronously to listeners.
 * @param executor used to send notifications asynchronously
 * @param loggerContext the instrumented object
 */
public LoggerContextAdmin(LoggerContext loggerContext,Executor executor){
  super(executor,createNotificationInfo());
  this.loggerContext=Assert.isNotNull(loggerContext,"String_Node_Str");
  try {
    String ctxName=Server.escape(loggerContext.getName());
    String name=String.format(PATTERN,ctxName);
    objectName=new ObjectName(name);
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  loggerContext.addPropertyChangeListener(this);
}
Program: 90739
Project: 90739
Buggy source:
/** 
 * @see LoggerContextAdminMBean#PATTERN 
 */
public ObjectName getObjectName(){
  return objectName;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code ObjectName} of this mbean.
 * @return the {@code ObjectName}
 * @see LoggerContextAdminMBean#PATTERN
 */
public ObjectName getObjectName(){
  return objectName;
}
Program: 90740
Project: 90740
Buggy source:
/** 
 * Returns the configuration text, which may be the contents of the configuration file or the text that was last set with a call to  {@code setConfigText}.
 * @return the configuration text
 */
String getConfigText() throws IOException ;

Fixed version (ground truth):
/** 
 * Returns the configuration text, which may be the contents of the configuration file or the text that was last set with a call to  {@code setConfigText}.
 * @return the configuration text
 * @throws IOException if a problem occurred reading the contents of theconfig file.
 */
String getConfigText() throws IOException ;
Program: 90741
Project: 90741
Buggy source:
/** 
 * Sets the configuration location to the specified URI. This will cause the instrumented   {@code LoggerContext} to reconfigure.
 * @param configLocationURI location of the configuration file in{@link URI} format.
 * @throws URISyntaxException if the format of the specifiedconfigLocationURI is incorrect
 * @throws IOException if an error occurred reading the specified location
 */
void setConfigLocationURI(String configLocation) throws URISyntaxException, IOException ;

Fixed version (ground truth):
/** 
 * Sets the configuration location to the specified URI. This will cause the instrumented   {@code LoggerContext} to reconfigure.
 * @param configLocation location of the configuration file in{@link java.net.URI} format.
 * @throws URISyntaxException if the format of the specifiedconfigLocationURI is incorrect
 * @throws IOException if an error occurred reading the specified location
 */
void setConfigLocationURI(String configLocation) throws URISyntaxException, IOException ;
Program: 90742
Project: 90742
Buggy source:
/** 
 * Constructs a new   {@code StatusLoggerAdmin} with the {@code Executor} tobe used for sending  {@code Notification}s asynchronously to listeners.
 * @param executor
 */
public StatusLoggerAdmin(Executor executor){
  super(executor,createNotificationInfo());
  try {
    objectName=new ObjectName(NAME);
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  StatusLogger.getLogger().registerListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@code StatusLoggerAdmin} with the {@code Executor} tobe used for sending  {@code Notification}s asynchronously to listeners.
 * @param executor used to send notifications asynchronously
 */
public StatusLoggerAdmin(Executor executor){
  super(executor,createNotificationInfo());
  try {
    objectName=new ObjectName(NAME);
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  StatusLogger.getLogger().registerListener(this);
}
Program: 90743
Project: 90743
Buggy source:
/** 
 * @see StatusLoggerAdminMBean#NAME 
 */
public ObjectName getObjectName(){
  return objectName;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code ObjectName} of this mbean.
 * @return the {@code ObjectName}
 * @see StatusLoggerAdminMBean#NAME
 */
public ObjectName getObjectName(){
  return objectName;
}