nus-yam/ex-repair huggingface dataset:
Program: 90658
Project: 90658
Buggy source:
@Ignore @Test public void testFlushAtEndOfBatch() throws Exception {
  final File f=new File("String_Node_Str","String_Node_Str");
  f.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  final String logMsg="String_Node_Str";
  log.info(logMsg);
  ((LifeCycle)LogManager.getContext()).stop();
  final BufferedReader reader=new BufferedReader(new FileReader(f));
  String line1;
  String line2;
  String line3;
  String line4;
  try {
    line1=reader.readLine();
    line2=reader.readLine();
    line3=reader.readLine();
    line4=reader.readLine();
  }
  finally {
    reader.close();
    f.delete();
  }
  assertNotNull("String_Node_Str",line1);
  final String msg1="String_Node_Str";
  assertTrue("String_Node_Str" + line1 + "String_Node_Str"+ msg1+ ']',line1.equals(msg1));
  assertNotNull("String_Node_Str",line2);
  final String msg2="String_Node_Str";
  assertTrue("String_Node_Str" + line2 + "String_Node_Str"+ msg2+ ']',line2.equals(msg2));
  assertNotNull("String_Node_Str",line3);
  final String msg3="String_Node_Str";
  assertTrue("String_Node_Str" + line3 + "String_Node_Str"+ msg3+ ']',line3.contains(msg3));
  assertNotNull("String_Node_Str",line4);
  final String msg4=logMsg;
  assertTrue("String_Node_Str" + line4 + "String_Node_Str"+ msg4+ ']',line4.contains(msg4));
  final String location="String_Node_Str";
  assertTrue("String_Node_Str",!line1.contains(location));
}

Fixed version (ground truth):
@Test public void testFlushAtEndOfBatch() throws Exception {
  final File f=new File("String_Node_Str","String_Node_Str");
  f.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  final String logMsg="String_Node_Str";
  log.info(logMsg);
  ((LifeCycle)LogManager.getContext()).stop();
  final BufferedReader reader=new BufferedReader(new FileReader(f));
  String line1;
  String line2;
  String line3;
  String line4;
  try {
    line1=reader.readLine();
    line2=reader.readLine();
    line3=reader.readLine();
    line4=reader.readLine();
  }
  finally {
    reader.close();
    f.delete();
  }
  assertNotNull("String_Node_Str",line1);
  final String msg1="String_Node_Str";
  assertTrue("String_Node_Str" + line1 + "String_Node_Str"+ msg1+ ']',line1.equals(msg1));
  assertNotNull("String_Node_Str",line2);
  final String msg2="String_Node_Str";
  assertTrue("String_Node_Str" + line2 + "String_Node_Str"+ msg2+ ']',line2.equals(msg2));
  assertNotNull("String_Node_Str",line3);
  final String msg3="String_Node_Str";
  assertTrue("String_Node_Str" + line3 + "String_Node_Str"+ msg3+ ']',line3.contains(msg3));
  assertNotNull("String_Node_Str",line4);
  final String msg4=logMsg;
  assertTrue("String_Node_Str" + line4 + "String_Node_Str"+ msg4+ ']',line4.contains(msg4));
  final String location="String_Node_Str";
  assertTrue("String_Node_Str",!line1.contains(location));
}
Program: 90659
Project: 90659
Buggy source:
@Ignore @Test public void testFlushAtEndOfBatch() throws Exception {
  final File f=new File("String_Node_Str","String_Node_Str");
  f.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  final String logMsg="String_Node_Str";
  log.info(logMsg);
  ((LifeCycle)LogManager.getContext()).stop();
  final BufferedReader reader=new BufferedReader(new FileReader(f));
  String line1;
  String line2;
  String line3;
  try {
    line1=reader.readLine();
    line2=reader.readLine();
    line3=reader.readLine();
  }
  finally {
    reader.close();
    f.delete();
  }
  assertNotNull("String_Node_Str",line1);
  assertNotNull("String_Node_Str",line1);
  final String msg1="String_Node_Str";
  assertTrue("String_Node_Str" + line1 + "String_Node_Str"+ msg1+ ']',line1.contains(msg1));
  assertNotNull("String_Node_Str",line2);
  final String msg2=logMsg;
  assertTrue("String_Node_Str" + line2 + "String_Node_Str"+ msg2+ ']',line2.contains(msg2));
  assertNotNull("String_Node_Str",line3);
  final String msg3="String_Node_Str";
  assertTrue("String_Node_Str" + line3 + "String_Node_Str"+ msg3+ ']',line3.contains(msg3));
  final String location="String_Node_Str";
  assertTrue("String_Node_Str",!line1.contains(location));
}

Fixed version (ground truth):
@Test public void testFlushAtEndOfBatch() throws Exception {
  final File f=new File("String_Node_Str","String_Node_Str");
  f.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  final String logMsg="String_Node_Str";
  log.info(logMsg);
  ((LifeCycle)LogManager.getContext()).stop();
  final BufferedReader reader=new BufferedReader(new FileReader(f));
  String line1;
  String line2;
  String line3;
  try {
    line1=reader.readLine();
    line2=reader.readLine();
    line3=reader.readLine();
  }
  finally {
    reader.close();
    f.delete();
  }
  assertNotNull("String_Node_Str",line1);
  assertNotNull("String_Node_Str",line1);
  final String msg1="String_Node_Str";
  assertTrue("String_Node_Str" + line1 + "String_Node_Str"+ msg1+ ']',line1.contains(msg1));
  assertNotNull("String_Node_Str",line2);
  final String msg2=logMsg;
  assertTrue("String_Node_Str" + line2 + "String_Node_Str"+ msg2+ ']',line2.contains(msg2));
  assertNotNull("String_Node_Str",line3);
  final String msg3="String_Node_Str";
  assertTrue("String_Node_Str" + line3 + "String_Node_Str"+ msg3+ ']',line3.contains(msg3));
  final String location="String_Node_Str";
  assertTrue("String_Node_Str",!line1.contains(location));
}
Program: 90661
Project: 90661
Buggy source:
@Override public DatagramSocketManager createManager(final String name,final FactoryData data){
  InetAddress inetAddress;
  final OutputStream os=new DatagramOutputStream(data.host,data.port,data.layout.getHeader(),data.layout.getFooter());
  try {
    inetAddress=InetAddress.getByName(data.host);
  }
 catch (  final UnknownHostException ex) {
    LOGGER.error("String_Node_Str" + data.host,ex);
    return null;
  }
  return new DatagramSocketManager(name,os,inetAddress,data.host,data.port,data.layout);
}

Fixed version (ground truth):
@Override public DatagramSocketManager createManager(final String name,final FactoryData data){
  InetAddress inetAddress;
  try {
    inetAddress=InetAddress.getByName(data.host);
  }
 catch (  final UnknownHostException ex) {
    LOGGER.error("String_Node_Str" + data.host,ex);
    return null;
  }
  final OutputStream os=new DatagramOutputStream(data.host,data.port,data.layout.getHeader(),data.layout.getFooter());
  return new DatagramSocketManager(name,os,inetAddress,data.host,data.port,data.layout);
}
Program: 90663
Project: 90663
Buggy source:
@Test public void testJavaIoSerializable() throws Exception {
  final Log4jLogEvent evt=new Log4jLogEvent("String_Node_Str",null,Strings.EMPTY,Level.INFO,new SimpleMessage("String_Node_Str"),null);
  final ByteArrayOutputStream arr=new ByteArrayOutputStream();
  final ObjectOutputStream out=new ObjectOutputStream(arr);
  out.writeObject(evt);
  final ByteArrayInputStream inArr=new ByteArrayInputStream(arr.toByteArray());
  final ObjectInputStream in=new ObjectInputStream(inArr);
  final Log4jLogEvent evt2=(Log4jLogEvent)in.readObject();
  assertEquals(evt.getTimeMillis(),evt2.getTimeMillis());
  assertEquals(evt.getLoggerFqcn(),evt2.getLoggerFqcn());
  assertEquals(evt.getLevel(),evt2.getLevel());
  assertEquals(evt.getLoggerName(),evt2.getLoggerName());
  assertEquals(evt.getMarker(),evt2.getMarker());
  assertEquals(evt.getContextMap(),evt2.getContextMap());
  assertEquals(evt.getContextStack(),evt2.getContextStack());
  assertEquals(evt.getMessage(),evt2.getMessage());
  assertEquals(evt.getSource(),evt2.getSource());
  assertEquals(evt.getThreadName(),evt2.getThreadName());
  assertEquals(evt.getThrown(),evt2.getThrown());
  assertEquals(evt.isEndOfBatch(),evt2.isEndOfBatch());
  assertEquals(evt.isIncludeLocation(),evt2.isIncludeLocation());
}

Fixed version (ground truth):
@Test public void testJavaIoSerializable() throws Exception {
  final Log4jLogEvent evt=new Log4jLogEvent("String_Node_Str",null,Strings.EMPTY,Level.INFO,new SimpleMessage("String_Node_Str"),null);
  byte[] binary=serialize(evt);
  final Log4jLogEvent evt2=deserialize(binary);
  assertEquals(evt.getTimeMillis(),evt2.getTimeMillis());
  assertEquals(evt.getLoggerFqcn(),evt2.getLoggerFqcn());
  assertEquals(evt.getLevel(),evt2.getLevel());
  assertEquals(evt.getLoggerName(),evt2.getLoggerName());
  assertEquals(evt.getMarker(),evt2.getMarker());
  assertEquals(evt.getContextMap(),evt2.getContextMap());
  assertEquals(evt.getContextStack(),evt2.getContextStack());
  assertEquals(evt.getMessage(),evt2.getMessage());
  assertEquals(evt.getSource(),evt2.getSource());
  assertEquals(evt.getThreadName(),evt2.getThreadName());
  assertEquals(evt.getThrown(),evt2.getThrown());
  assertEquals(evt.isEndOfBatch(),evt2.isEndOfBatch());
  assertEquals(evt.isIncludeLocation(),evt2.isIncludeLocation());
}
Program: 90664
Project: 90664
Buggy source:
@Test public void testJavaIoSerializableWithThrown() throws Exception {
  final Error thrown=new InternalError("String_Node_Str");
  final Log4jLogEvent evt=new Log4jLogEvent("String_Node_Str",null,Strings.EMPTY,Level.INFO,new SimpleMessage("String_Node_Str"),thrown);
  final ByteArrayOutputStream arr=new ByteArrayOutputStream();
  final ObjectOutputStream out=new ObjectOutputStream(arr);
  out.writeObject(evt);
  final ByteArrayInputStream inArr=new ByteArrayInputStream(arr.toByteArray());
  final ObjectInputStream in=new ObjectInputStream(inArr);
  final Log4jLogEvent evt2=(Log4jLogEvent)in.readObject();
  assertEquals(evt.getTimeMillis(),evt2.getTimeMillis());
  assertEquals(evt.getLoggerFqcn(),evt2.getLoggerFqcn());
  assertEquals(evt.getLevel(),evt2.getLevel());
  assertEquals(evt.getLoggerName(),evt2.getLoggerName());
  assertEquals(evt.getMarker(),evt2.getMarker());
  assertEquals(evt.getContextMap(),evt2.getContextMap());
  assertEquals(evt.getContextStack(),evt2.getContextStack());
  assertEquals(evt.getMessage(),evt2.getMessage());
  assertEquals(evt.getSource(),evt2.getSource());
  assertEquals(evt.getThreadName(),evt2.getThreadName());
  assertEquals(evt.getThrown().getClass(),evt2.getThrown().getClass());
  assertEquals(evt.getThrown().getMessage(),evt2.getThrown().getMessage());
  assertEquals(evt.getThrownProxy(),evt2.getThrownProxy());
  assertEquals(evt.isEndOfBatch(),evt2.isEndOfBatch());
  assertEquals(evt.isIncludeLocation(),evt2.isIncludeLocation());
}

Fixed version (ground truth):
@Test public void testJavaIoSerializableWithThrown() throws Exception {
  final Error thrown=new InternalError("String_Node_Str");
  final Log4jLogEvent evt=new Log4jLogEvent("String_Node_Str",null,Strings.EMPTY,Level.INFO,new SimpleMessage("String_Node_Str"),thrown);
  byte[] binary=serialize(evt);
  final Log4jLogEvent evt2=deserialize(binary);
  assertEquals(evt.getTimeMillis(),evt2.getTimeMillis());
  assertEquals(evt.getLoggerFqcn(),evt2.getLoggerFqcn());
  assertEquals(evt.getLevel(),evt2.getLevel());
  assertEquals(evt.getLoggerName(),evt2.getLoggerName());
  assertEquals(evt.getMarker(),evt2.getMarker());
  assertEquals(evt.getContextMap(),evt2.getContextMap());
  assertEquals(evt.getContextStack(),evt2.getContextStack());
  assertEquals(evt.getMessage(),evt2.getMessage());
  assertEquals(evt.getSource(),evt2.getSource());
  assertEquals(evt.getThreadName(),evt2.getThreadName());
  assertNull(evt2.getThrown());
  assertNotNull(evt2.getThrownProxy());
  assertEquals(evt.getThrownProxy(),evt2.getThrownProxy());
  assertEquals(evt.isEndOfBatch(),evt2.isEndOfBatch());
  assertEquals(evt.isIncludeLocation(),evt2.isIncludeLocation());
}
Program: 90665
Project: 90665
Buggy source:
private ThrowableProxy[] toSuppressedProxies(final Throwable thrown){
  try {
    final Throwable[] suppressed=Throwables.getSuppressed(thrown);
    if (suppressed == null) {
      return null;
    }
    final ThrowableProxy[] proxies=new ThrowableProxy[suppressed.length];
    for (int i=0; i < suppressed.length; i++) {
      proxies[i]=new ThrowableProxy(suppressed[i]);
    }
    return proxies;
  }
 catch (  final Exception e) {
    StatusLogger.getLogger().error(e);
  }
  return null;
}

Fixed version (ground truth):
private ThrowableProxy[] toSuppressedProxies(final Throwable thrown){
  try {
    final Throwable[] suppressed=Throwables.getSuppressed(thrown);
    if (suppressed == null) {
      return EMPTY_THROWABLE_PROXY_ARRAY;
    }
    final ThrowableProxy[] proxies=new ThrowableProxy[suppressed.length];
    for (int i=0; i < suppressed.length; i++) {
      proxies[i]=new ThrowableProxy(suppressed[i]);
    }
    return proxies;
  }
 catch (  final Exception e) {
    StatusLogger.getLogger().error(e);
  }
  return null;
}
Program: 90668
Project: 90668
Buggy source:
public static void stop(){
  final Disruptor<RingBufferLogEvent> temp=disruptor;
  disruptor=null;
  if (temp == null) {
    return;
  }
  temp.shutdown();
  final RingBuffer<RingBufferLogEvent> ringBuffer=temp.getRingBuffer();
  for (int i=0; i < MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN; i++) {
    if (ringBuffer.hasAvailableCapacity(ringBuffer.getBufferSize())) {
      break;
    }
    try {
      Thread.sleep(SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS);
    }
 catch (    final InterruptedException e) {
    }
  }
  executor.shutdown();
  threadlocalInfo.remove();
}

Fixed version (ground truth):
public static void stop(){
  final Disruptor<RingBufferLogEvent> temp=disruptor;
  disruptor=null;
  if (temp == null) {
    return;
  }
  for (int i=0; hasBacklog(temp) && i < MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN; i++) {
    try {
      Thread.sleep(SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS);
    }
 catch (    final InterruptedException e) {
    }
  }
  temp.shutdown();
  executor.shutdown();
  threadlocalInfo.remove();
}
Program: 90669
Project: 90669
Buggy source:
/** 
 * Decreases the reference count. If the reference count reached zero, the Disruptor and its associated thread are shut down and their references set to   {@code null}.
 */
synchronized static void release(){
  if (--count > 0) {
    LOGGER.trace("String_Node_Str",count);
    return;
  }
  final Disruptor<Log4jEventWrapper> temp=disruptor;
  if (temp == null) {
    LOGGER.trace("String_Node_Str",count);
    return;
  }
  LOGGER.trace("String_Node_Str",count);
  disruptor=null;
  temp.shutdown();
  final RingBuffer<Log4jEventWrapper> ringBuffer=temp.getRingBuffer();
  for (int i=0; i < MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN; i++) {
    if (ringBuffer.hasAvailableCapacity(ringBuffer.getBufferSize())) {
      break;
    }
    try {
      Thread.sleep(HALF_A_SECOND);
    }
 catch (    final InterruptedException e) {
    }
  }
  executor.shutdown();
  executor=null;
}

Fixed version (ground truth):
/** 
 * Decreases the reference count. If the reference count reached zero, the Disruptor and its associated thread are shut down and their references set to   {@code null}.
 */
synchronized static void release(){
  if (--count > 0) {
    LOGGER.trace("String_Node_Str",count);
    return;
  }
  final Disruptor<Log4jEventWrapper> temp=disruptor;
  if (temp == null) {
    LOGGER.trace("String_Node_Str",count);
    count=0;
    return;
  }
  LOGGER.trace("String_Node_Str",count);
  disruptor=null;
  for (int i=0; hasBacklog(temp) && i < MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN; i++) {
    try {
      Thread.sleep(SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS);
    }
 catch (    final InterruptedException e) {
    }
  }
  temp.shutdown();
  executor.shutdown();
  executor=null;
}
Program: 90670
Project: 90670
Buggy source:
/** 
 * Tear down the configuration.
 */
@Override public void stop(){
  final LoggerContextFactory factory=LogManager.getFactory();
  if (factory instanceof Log4jContextFactory) {
    ContextSelector selector=((Log4jContextFactory)factory).getSelector();
    if (selector instanceof AsyncLoggerContextSelector) {
    }
  }
  Set<LoggerConfig> alreadyStopped=new HashSet<LoggerConfig>();
  for (  final LoggerConfig logger : loggers.values()) {
    if (logger instanceof AsyncLoggerConfig) {
      logger.clearAppenders();
      logger.stopFilter();
      alreadyStopped.add(logger);
    }
  }
  if (root instanceof AsyncLoggerConfig) {
    root.stopFilter();
    alreadyStopped.add(root);
  }
  final Appender[] array=appenders.values().toArray(new Appender[appenders.size()]);
  for (int i=array.length - 1; i >= 0; --i) {
    if (array[i] instanceof AsyncAppender) {
      array[i].stop();
    }
  }
  for (int i=array.length - 1; i >= 0; --i) {
    if (array[i].isStarted()) {
      array[i].stop();
    }
  }
  for (  final LoggerConfig logger : loggers.values()) {
    if (alreadyStopped.contains(logger)) {
      continue;
    }
    logger.clearAppenders();
    logger.stopFilter();
  }
  if (!alreadyStopped.contains(root)) {
    root.stopFilter();
  }
  stopFilter();
  if (advertiser != null && advertisement != null) {
    advertiser.unadvertise(advertisement);
  }
}

Fixed version (ground truth):
/** 
 * Tear down the configuration.
 */
@Override public void stop(){
  final LoggerContextFactory factory=LogManager.getFactory();
  if (factory instanceof Log4jContextFactory) {
    ContextSelector selector=((Log4jContextFactory)factory).getSelector();
    if (selector instanceof AsyncLoggerContextSelector) {
    }
  }
  for (  final LoggerConfig logger : loggers.values()) {
    if (logger instanceof AsyncLoggerConfig) {
      logger.stopFilter();
    }
  }
  if (root instanceof AsyncLoggerConfig) {
    root.stopFilter();
  }
  final Appender[] array=appenders.values().toArray(new Appender[appenders.size()]);
  for (int i=array.length - 1; i >= 0; --i) {
    if (array[i] instanceof AsyncAppender) {
      array[i].stop();
    }
  }
  for (int i=array.length - 1; i >= 0; --i) {
    if (array[i].isStarted()) {
      array[i].stop();
    }
  }
  for (  final LoggerConfig logger : loggers.values()) {
    logger.clearAppenders();
    logger.stopFilter();
  }
  root.stopFilter();
  stopFilter();
  if (advertiser != null && advertisement != null) {
    advertiser.unadvertise(advertisement);
  }
}
Program: 90671
Project: 90671
Buggy source:
@Test public void testConfig(){
  System.setProperty("String_Node_Str","String_Node_Str");
  final LoggerContext ctx=this.init.getContext();
  ctx.reconfigure();
  final Configuration config=ctx.getConfiguration();
  assertTrue("String_Node_Str",config instanceof XMLConfiguration);
  assertSame(StatusLogger.getLogger().getLevel(),Level.INFO);
  Layout<? extends Serializable> layout=PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN,config,null,null,null,null,null,null);
  Appender appender=FileAppender.createAppender(LOG_FILE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",layout,null,"String_Node_Str",null,config);
  appender.start();
  config.addAppender(appender);
  AppenderRef ref=AppenderRef.createAppenderRef("String_Node_Str",null,null);
  AppenderRef[] refs=new AppenderRef[]{ref};
  LoggerConfig loggerConfig=LoggerConfig.createLogger("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",refs,null,config,null);
  loggerConfig.addAppender(appender,null,null);
  config.addLogger("String_Node_Str",loggerConfig);
  ctx.updateLoggers();
  Logger logger=ctx.getLogger(CustomConfigurationTest.class.getName());
  logger.info("String_Node_Str");
  final File file=new File(LOG_FILE);
  assertTrue("String_Node_Str",file.exists());
  assertTrue("String_Node_Str",file.length() > 0);
}

Fixed version (ground truth):
@Test public void testConfig(){
  final LoggerContext ctx=this.init.getContext();
  ctx.reconfigure();
  final Configuration config=ctx.getConfiguration();
  assertTrue("String_Node_Str",config instanceof XMLConfiguration);
  for (  StatusListener listener : StatusLogger.getLogger().getListeners()) {
    if (listener instanceof StatusConsoleListener) {
      assertSame(listener.getStatusLevel(),Level.INFO);
      break;
    }
  }
  Layout<? extends Serializable> layout=PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN,config,null,null,null,null,null,null);
  Appender appender=FileAppender.createAppender(LOG_FILE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",layout,null,"String_Node_Str",null,config);
  appender.start();
  config.addAppender(appender);
  AppenderRef ref=AppenderRef.createAppenderRef("String_Node_Str",null,null);
  AppenderRef[] refs=new AppenderRef[]{ref};
  LoggerConfig loggerConfig=LoggerConfig.createLogger("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",refs,null,config,null);
  loggerConfig.addAppender(appender,null,null);
  config.addLogger("String_Node_Str",loggerConfig);
  ctx.updateLoggers();
  Logger logger=ctx.getLogger(CustomConfigurationTest.class.getName());
  logger.info("String_Node_Str");
  final File file=new File(LOG_FILE);
  assertTrue("String_Node_Str",file.exists());
  assertTrue("String_Node_Str",file.length() > 0);
}
Program: 90672
Project: 90672
Buggy source:
private static void encode(final ConcurrentMap<String,ConcurrentMap<String,PluginType<?>>> map){
  final String fileName=rootDir + PATH + FILENAME;
  DataOutputStream dos=null;
  try {
    final File file=new File(rootDir + PATH);
    file.mkdirs();
    final FileOutputStream fos=new FileOutputStream(fileName);
    final BufferedOutputStream bos=new BufferedOutputStream(fos);
    dos=new DataOutputStream(bos);
    dos.writeInt(map.size());
    for (    final Map.Entry<String,ConcurrentMap<String,PluginType<?>>> outer : map.entrySet()) {
      dos.writeUTF(outer.getKey());
      dos.writeInt(outer.getValue().size());
      for (      final Map.Entry<String,PluginType<?>> entry : outer.getValue().entrySet()) {
        dos.writeUTF(entry.getKey());
        final PluginType<?> pt=entry.getValue();
        dos.writeUTF(pt.getPluginClass().getName());
        dos.writeUTF(pt.getElementName());
        dos.writeBoolean(pt.isObjectPrintable());
        dos.writeBoolean(pt.isDeferChildren());
      }
    }
  }
 catch (  final Exception ex) {
    ex.printStackTrace();
  }
 finally {
    Closer.closeSilent(dos);
  }
}

Fixed version (ground truth):
private static void encode(final ConcurrentMap<String,ConcurrentMap<String,PluginType<?>>> map){
  final String fileName=rootDir + PATH + FILENAME;
  final File file=new File(rootDir + PATH);
  file.mkdirs();
  try {
    final DataOutputStream dos=new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));
    try {
      dos.writeInt(map.size());
      for (      final Map.Entry<String,ConcurrentMap<String,PluginType<?>>> outer : map.entrySet()) {
        dos.writeUTF(outer.getKey());
        dos.writeInt(outer.getValue().size());
        for (        final Map.Entry<String,PluginType<?>> entry : outer.getValue().entrySet()) {
          dos.writeUTF(entry.getKey());
          final PluginType<?> pt=entry.getValue();
          dos.writeUTF(pt.getPluginClass().getName());
          dos.writeUTF(pt.getElementName());
          dos.writeBoolean(pt.isObjectPrintable());
          dos.writeBoolean(pt.isDeferChildren());
        }
      }
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
 finally {
      Closer.closeSilent(dos);
    }
  }
 catch (  FileNotFoundException e) {
    LOGGER.error("String_Node_Str",fileName,e);
  }
}
Program: 90673
Project: 90673
Buggy source:
@Override public String toString(){
  final StringBuilder msg=new StringBuilder("String_Node_Str" + Plugin.class.getSimpleName());
  if (isA != null) {
    msg.append("String_Node_Str" + isA.getSimpleName());
  }
  return msg.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final StringBuilder msg=new StringBuilder("String_Node_Str").append(Plugin.class.getSimpleName());
  if (isA != null) {
    msg.append("String_Node_Str").append(isA.getSimpleName());
  }
  return msg.toString();
}
Program: 90675
Project: 90675
Buggy source:
protected PluginAliasesElementVisitor(){
  super(Collections.<PluginEntry>emptyList());
}

Fixed version (ground truth):
private PluginAliasesElementVisitor(final Elements elements){
  super(Collections.<PluginEntry>emptyList());
  this.elements=elements;
}
Program: 90676
Project: 90676
Buggy source:
private void collectPlugins(final Iterable<? extends Element> elements){
  for (  final Element element : elements) {
    final Plugin plugin=element.getAnnotation(Plugin.class);
    final PluginEntry entry=element.accept(pluginVisitor,plugin);
    pluginCategories.putIfAbsent(entry.getCategory(),new ConcurrentHashMap<String,PluginEntry>());
    final ConcurrentMap<String,PluginEntry> category=pluginCategories.get(entry.getCategory());
    category.put(entry.getKey(),entry);
    final Collection<PluginEntry> entries=element.accept(pluginAliasesVisitor,plugin);
    for (    final PluginEntry pluginEntry : entries) {
      category.put(pluginEntry.getKey(),pluginEntry);
    }
  }
}

Fixed version (ground truth):
private void collectPlugins(final Iterable<? extends Element> elements){
  final Elements elementUtils=processingEnv.getElementUtils();
  final ElementVisitor<PluginEntry,Plugin> pluginVisitor=new PluginElementVisitor(elementUtils);
  final ElementVisitor<Collection<PluginEntry>,Plugin> pluginAliasesVisitor=new PluginAliasesElementVisitor(elementUtils);
  for (  final Element element : elements) {
    final Plugin plugin=element.getAnnotation(Plugin.class);
    final PluginEntry entry=element.accept(pluginVisitor,plugin);
    pluginCategories.putIfAbsent(entry.getCategory(),new ConcurrentHashMap<String,PluginEntry>());
    final ConcurrentMap<String,PluginEntry> category=pluginCategories.get(entry.getCategory());
    category.put(entry.getKey(),entry);
    final Collection<PluginEntry> entries=element.accept(pluginAliasesVisitor,plugin);
    for (    final PluginEntry pluginEntry : entries) {
      category.put(pluginEntry.getKey(),pluginEntry);
    }
  }
}
Program: 90677
Project: 90677
Buggy source:
@Override public Collection<PluginEntry> visitType(final TypeElement e,final Plugin plugin){
  final PluginAliases aliases=e.getAnnotation(PluginAliases.class);
  if (aliases == null) {
    return DEFAULT_VALUE;
  }
  final Collection<PluginEntry> entries=new ArrayList<PluginEntry>(aliases.value().length);
  for (  final String alias : aliases.value()) {
    final PluginEntry entry=new PluginEntry();
    entry.setKey(alias.toLowerCase());
    entry.setClassName(e.getQualifiedName().toString());
    entry.setName(Plugin.EMPTY.equals(plugin.elementType()) ? alias : plugin.elementType());
    entry.setPrintable(plugin.printObject());
    entry.setDefer(plugin.deferChildren());
    entry.setCategory(plugin.category());
    entries.add(entry);
  }
  return entries;
}

Fixed version (ground truth):
@Override public Collection<PluginEntry> visitType(final TypeElement e,final Plugin plugin){
  final PluginAliases aliases=e.getAnnotation(PluginAliases.class);
  if (aliases == null) {
    return DEFAULT_VALUE;
  }
  final Collection<PluginEntry> entries=new ArrayList<PluginEntry>(aliases.value().length);
  for (  final String alias : aliases.value()) {
    final PluginEntry entry=new PluginEntry();
    entry.setKey(alias.toLowerCase());
    entry.setClassName(elements.getBinaryName(e).toString());
    entry.setName(Plugin.EMPTY.equals(plugin.elementType()) ? alias : plugin.elementType());
    entry.setPrintable(plugin.printObject());
    entry.setDefer(plugin.deferChildren());
    entry.setCategory(plugin.category());
    entries.add(entry);
  }
  return entries;
}
Program: 90678
Project: 90678
Buggy source:
private void verifyFakePluginEntry(final String name,final PluginEntry fake){
  assertNotNull("String_Node_Str" + name.toLowerCase() + "String_Node_Str",fake);
  assertEquals(FakePlugin.class.getName(),fake.getClassName());
  assertEquals(name.toLowerCase(),fake.getKey());
  assertEquals("String_Node_Str",p.elementType());
  assertEquals(name,fake.getName());
  assertEquals(p.printObject(),fake.isPrintable());
  assertEquals(p.deferChildren(),fake.isDefer());
}

Fixed version (ground truth):
private void verifyFakePluginEntry(final String name,final PluginEntry fake){
  assertNotNull("String_Node_Str" + name.toLowerCase() + "String_Node_Str",fake);
  assertEquals(FakePlugin.class.getName(),fake.getClassName());
  assertEquals(name.toLowerCase(),fake.getKey());
  assertEquals(Plugin.EMPTY,p.elementType());
  assertEquals(name,fake.getName());
  assertEquals(p.printObject(),fake.isPrintable());
  assertEquals(p.deferChildren(),fake.isDefer());
}
Program: 90679
Project: 90679
Buggy source:
@Test public void testLogToFile() throws Exception {
  final Logger logger=this.ctx.getLogger(FILE_LOGGER_NAME);
  final long random=ThreadLocalRandom.current().nextLong();
  logger.debug("String_Node_Str",random);
  int count=0;
  String line="String_Node_Str";
  final BufferedReader in=new BufferedReader(new FileReader(this.logFileName));
  try {
    while (in.ready()) {
      ++count;
      line=in.readLine();
    }
  }
  finally {
    in.close();
  }
  assertThat(count,is(equalTo(1)));
  assertThat(line,endsWith(Long.toString(random)));
}

Fixed version (ground truth):
@Test public void testLogToFile() throws Exception {
  final Logger logger=this.ctx.getLogger(FILE_LOGGER_NAME);
  final long random=this.random.nextLong();
  logger.debug("String_Node_Str",random);
  int count=0;
  String line="String_Node_Str";
  final BufferedReader in=new BufferedReader(new FileReader(this.logFileName));
  try {
    while (in.ready()) {
      ++count;
      line=in.readLine();
    }
  }
  finally {
    in.close();
  }
  assertThat(count,is(equalTo(1)));
  assertThat(line,endsWith(Long.toString(random)));
}
Program: 90680
Project: 90680
Buggy source:
/** 
 * Add an event.
 * @param marker The Marker
 * @param fqcn   The fully qualified class name of the <b>caller</b>
 * @param level  The logging level
 * @param msg    The message associated with the event.
 * @param t      A Throwable or null.
 */
@Override public void logMessage(final String fqcn,final Level level,final Marker marker,final Message msg,final Throwable t){
  StackTraceElement element=null;
  if (fqcn != null) {
    element=getStackTraceElement(fqcn,Thread.currentThread().getStackTrace());
  }
  final StatusData data=new StatusData(element,level,msg,t);
  msgLock.lock();
  try {
    messages.add(data);
  }
  finally {
    msgLock.unlock();
  }
  if (listeners.size() > 0) {
    for (    final StatusListener listener : listeners) {
      if (data.getLevel().isAtLeastAsSpecificAs(listener.getStatusLevel())) {
        listener.log(data);
      }
    }
  }
 else {
    logger.logMessage(fqcn,level,marker,msg,t);
  }
}

Fixed version (ground truth):
/** 
 * Add an event.
 * @param marker The Marker
 * @param fqcn   The fully qualified class name of the <b>caller</b>
 * @param level  The logging level
 * @param msg    The message associated with the event.
 * @param t      A Throwable or null.
 */
@Override public void logMessage(final String fqcn,final Level level,final Marker marker,final Message msg,final Throwable t){
  StackTraceElement element=null;
  if (fqcn != null) {
    element=getStackTraceElement(fqcn,Thread.currentThread().getStackTrace());
  }
  final StatusData data=new StatusData(element,level,msg,t);
  msgLock.lock();
  try {
    messages.add(data);
  }
  finally {
    msgLock.unlock();
  }
  if (listeners.size() > 0) {
    for (    final StatusListener listener : listeners) {
      if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
        listener.log(data);
      }
    }
  }
 else {
    logger.logMessage(fqcn,level,marker,msg,t);
  }
}
Program: 90681
Project: 90681
Buggy source:
/** 
 * Decide if we're going to log <code>event</code> based on whether the maximum burst of log statements has been exceeded.
 * @param level The log level.
 * @return The onMatch value if the filter passes, onMismatch otherwise.
 */
private Result filter(final Level level){
  if (this.level.isAtLeastAsSpecificAs(level)) {
    LogDelay delay=history.poll();
    while (delay != null) {
      available.add(delay);
      delay=history.poll();
    }
    delay=available.poll();
    if (delay != null) {
      delay.setDelay(burstInterval);
      history.add(delay);
      return onMatch;
    }
    return onMismatch;
  }
  return onMatch;
}

Fixed version (ground truth):
/** 
 * Decide if we're going to log <code>event</code> based on whether the maximum burst of log statements has been exceeded.
 * @param level The log level.
 * @return The onMatch value if the filter passes, onMismatch otherwise.
 */
private Result filter(final Level level){
  if (this.level.isMoreSpecificThan(level)) {
    LogDelay delay=history.poll();
    while (delay != null) {
      available.add(delay);
      delay=history.poll();
    }
    delay=available.poll();
    if (delay != null) {
      delay.setDelay(burstInterval);
      history.add(delay);
      return onMatch;
    }
    return onMismatch;
  }
  return onMatch;
}
Program: 90682
Project: 90682
Buggy source:
private Result filter(final Level level){
  final Object value=ThreadContext.get(key);
  if (value != null) {
    Level ctxLevel=levelMap.get(value);
    if (ctxLevel == null) {
      ctxLevel=defaultThreshold;
    }
    return level.isAtLeastAsSpecificAs(ctxLevel) ? onMatch : onMismatch;
  }
  return Result.NEUTRAL;
}

Fixed version (ground truth):
private Result filter(final Level level){
  final Object value=ThreadContext.get(key);
  if (value != null) {
    Level ctxLevel=levelMap.get(value);
    if (ctxLevel == null) {
      ctxLevel=defaultThreshold;
    }
    return level.isMoreSpecificThan(ctxLevel) ? onMatch : onMismatch;
  }
  return Result.NEUTRAL;
}
Program: 90683
Project: 90683
Buggy source:
private Result filter(final Level level){
  return level.isAtLeastAsSpecificAs(this.level) ? onMatch : onMismatch;
}

Fixed version (ground truth):
private Result filter(final Level level){
  return level.isMoreSpecificThan(this.level) ? onMatch : onMismatch;
}
Program: 90686
Project: 90686
Buggy source:
/** 
 * Reconfigure the context.
 */
public synchronized void reconfigure(){
  LOGGER.debug("String_Node_Str" + name);
  final Configuration instance=ConfigurationFactory.getInstance().getConfiguration(name,configLocation);
  setConfiguration(instance);
  LOGGER.debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reconfigure the context.
 */
public synchronized void reconfigure(){
  LOGGER.debug("String_Node_Str" + name);
  final Configuration instance=ConfigurationFactory.getInstance().getConfiguration(name,configLocation);
  setConfiguration(instance);
  try {
    Server.reregisterMBeansAfterReconfigure();
  }
 catch (  final Exception ex) {
    LOGGER.error("String_Node_Str",ex);
  }
  LOGGER.debug("String_Node_Str");
}
Program: 90687
Project: 90687
Buggy source:
/** 
 * Constructor that initializes the ContextSelector.
 */
public Log4jContextFactory(){
  final String sel=PropertiesUtil.getProperties().getStringProperty(Constants.LOG4J_CONTEXT_SELECTOR);
  if (sel != null) {
    try {
      final Class<?> clazz=Loader.loadClass(sel);
      if (clazz != null && ContextSelector.class.isAssignableFrom(clazz)) {
        selector=(ContextSelector)clazz.newInstance();
      }
    }
 catch (    final Exception ex) {
      LOGGER.error("String_Node_Str" + sel,ex);
    }
  }
  if (selector == null) {
    selector=new ClassLoaderContextSelector();
  }
  try {
    Server.registerMBeans(selector);
  }
 catch (  final Exception ex) {
    LOGGER.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Constructor that initializes the ContextSelector.
 */
public Log4jContextFactory(){
  final String sel=PropertiesUtil.getProperties().getStringProperty(Constants.LOG4J_CONTEXT_SELECTOR);
  if (sel != null) {
    try {
      final Class<?> clazz=Loader.loadClass(sel);
      if (clazz != null && ContextSelector.class.isAssignableFrom(clazz)) {
        selector=(ContextSelector)clazz.newInstance();
      }
    }
 catch (    final Exception ex) {
      LOGGER.error("String_Node_Str" + sel,ex);
    }
  }
  if (selector == null) {
    selector=new ClassLoaderContextSelector();
  }
}
Program: 90688
Project: 90688
Buggy source:
private static void unregisterAllMatching(final String search,final MBeanServer mbs){
  try {
    final ObjectName pattern=new ObjectName(search);
    final Set<ObjectName> found=mbs.queryNames(pattern,null);
    for (    final ObjectName objectName : found) {
      mbs.unregisterMBean(objectName);
    }
  }
 catch (  final Exception ex) {
    StatusLogger.getLogger().error("String_Node_Str" + search,ex);
  }
}

Fixed version (ground truth):
private static void unregisterAllMatching(final String search,final MBeanServer mbs){
  try {
    final ObjectName pattern=new ObjectName(search);
    final Set<ObjectName> found=mbs.queryNames(pattern,null);
    for (    final ObjectName objectName : found) {
      LOGGER.debug("String_Node_Str",objectName);
      mbs.unregisterMBean(objectName);
    }
  }
 catch (  final Exception ex) {
    LOGGER.error("String_Node_Str" + search,ex);
  }
}
Program: 90689
Project: 90689
Buggy source:
private static void registerContextSelector(final ContextSelector selector,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final ContextSelectorAdmin mbean=new ContextSelectorAdmin(selector);
  mbs.registerMBean(mbean,mbean.getObjectName());
}

Fixed version (ground truth):
private static void registerContextSelector(final ContextSelector selector,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final ContextSelectorAdmin mbean=new ContextSelectorAdmin(selector);
  register(mbs,mbean,mbean.getObjectName());
}
Program: 90690
Project: 90690
Buggy source:
private static void registerAppenders(final LoggerContext ctx,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final Map<String,Appender> map=ctx.getConfiguration().getAppenders();
  for (  final String name : map.keySet()) {
    final Appender appender=map.get(name);
    if (appender instanceof AsyncAppender) {
      AsyncAppender async=((AsyncAppender)appender);
      final AsyncAppenderAdmin mbean=new AsyncAppenderAdmin(ctx.getName(),async);
      mbs.registerMBean(mbean,mbean.getObjectName());
    }
 else {
      final AppenderAdmin mbean=new AppenderAdmin(ctx.getName(),appender);
      mbs.registerMBean(mbean,mbean.getObjectName());
    }
  }
}

Fixed version (ground truth):
private static void registerAppenders(final LoggerContext ctx,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final Map<String,Appender> map=ctx.getConfiguration().getAppenders();
  for (  final String name : map.keySet()) {
    final Appender appender=map.get(name);
    if (appender instanceof AsyncAppender) {
      AsyncAppender async=((AsyncAppender)appender);
      final AsyncAppenderAdmin mbean=new AsyncAppenderAdmin(ctx.getName(),async);
      register(mbs,mbean,mbean.getObjectName());
    }
 else {
      final AppenderAdmin mbean=new AppenderAdmin(ctx.getName(),appender);
      register(mbs,mbean,mbean.getObjectName());
    }
  }
}
Program: 90691
Project: 90691
Buggy source:
/** 
 * Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the specified MBean server so they can be accessed by remote clients.
 * @param selector starting point in the log4j class hierarchy
 * @param mbs the MBean Server to register the instrumented objects in
 * @throws JMException if a problem occurs during registration
 */
public static void registerMBeans(final ContextSelector selector,final MBeanServer mbs) throws JMException {
  if (Boolean.getBoolean(PROPERTY_DISABLE_JMX)) {
    StatusLogger.getLogger().debug("String_Node_Str");
    return;
  }
  final Executor executor=Executors.newFixedThreadPool(1);
  registerStatusLogger(mbs,executor);
  registerContextSelector(selector,mbs,executor);
  final List<LoggerContext> contexts=selector.getLoggerContexts();
  registerContexts(contexts,mbs,executor);
  for (  final LoggerContext context : contexts) {
    context.addPropertyChangeListener(new PropertyChangeListener(){
      @Override public void propertyChange(      final PropertyChangeEvent evt){
        if (!LoggerContext.PROPERTY_CONFIG.equals(evt.getPropertyName())) {
          return;
        }
        unregisterLoggerConfigs(context.getName(),mbs);
        unregisterAsyncLoggerConfigRingBufferAdmins(context.getName(),mbs);
        unregisterAppenders(context.getName(),mbs);
        unregisterAsyncAppenders(context.getName(),mbs);
        try {
          registerLoggerConfigs(context,mbs,executor);
          registerAppenders(context,mbs,executor);
        }
 catch (        final Exception ex) {
          StatusLogger.getLogger().error("String_Node_Str",ex);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the specified MBean server so they can be accessed by remote clients.
 * @param selector starting point in the log4j class hierarchy
 * @param mbs the MBean Server to register the instrumented objects in
 * @throws JMException if a problem occurs during registration
 */
public static void registerMBeans(final ContextSelector selector,final MBeanServer mbs) throws JMException {
  if (Boolean.getBoolean(PROPERTY_DISABLE_JMX)) {
    LOGGER.debug("String_Node_Str");
    return;
  }
  registerStatusLogger(mbs,executor);
  registerContextSelector(selector,mbs,executor);
  final List<LoggerContext> contexts=selector.getLoggerContexts();
  registerContexts(contexts,mbs,executor);
}
Program: 90692
Project: 90692
Buggy source:
/** 
 * Registers MBeans for all contexts in the list. First unregisters each context (and nested loggers, appender etc) to prevent InstanceAlreadyExistsExceptions.
 */
private static void registerContexts(final List<LoggerContext> contexts,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  for (  final LoggerContext ctx : contexts) {
    unregisterContext(ctx.getName());
    final LoggerContextAdmin mbean=new LoggerContextAdmin(ctx,executor);
    mbs.registerMBean(mbean,mbean.getObjectName());
    if (ctx instanceof AsyncLoggerContext) {
      RingBufferAdmin rbmbean=AsyncLogger.createRingBufferAdmin(ctx.getName());
      mbs.registerMBean(rbmbean,rbmbean.getObjectName());
    }
  }
}

Fixed version (ground truth):
/** 
 * Registers MBeans for all contexts in the list. First unregisters each context (and nested loggers, appender etc) to prevent InstanceAlreadyExistsExceptions.
 */
private static void registerContexts(final List<LoggerContext> contexts,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  for (  final LoggerContext ctx : contexts) {
    unregisterContext(ctx.getName());
    final LoggerContextAdmin mbean=new LoggerContextAdmin(ctx,executor);
    register(mbs,mbean,mbean.getObjectName());
    if (ctx instanceof AsyncLoggerContext) {
      RingBufferAdmin rbmbean=AsyncLogger.createRingBufferAdmin(ctx.getName());
      register(mbs,rbmbean,rbmbean.getObjectName());
    }
  }
}
Program: 90693
Project: 90693
Buggy source:
private static void registerStatusLogger(final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final StatusLoggerAdmin mbean=new StatusLoggerAdmin(executor);
  mbs.registerMBean(mbean,mbean.getObjectName());
}

Fixed version (ground truth):
private static void registerStatusLogger(final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final StatusLoggerAdmin mbean=new StatusLoggerAdmin(executor);
  register(mbs,mbean,mbean.getObjectName());
}
Program: 90694
Project: 90694
Buggy source:
private static void registerLoggerConfigs(final LoggerContext ctx,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final Map<String,LoggerConfig> map=ctx.getConfiguration().getLoggers();
  for (  final String name : map.keySet()) {
    final LoggerConfig cfg=map.get(name);
    final LoggerConfigAdmin mbean=new LoggerConfigAdmin(ctx.getName(),cfg);
    mbs.registerMBean(mbean,mbean.getObjectName());
    if (cfg instanceof AsyncLoggerConfig) {
      AsyncLoggerConfig async=(AsyncLoggerConfig)cfg;
      RingBufferAdmin rbmbean=async.createRingBufferAdmin(ctx.getName());
      mbs.registerMBean(rbmbean,rbmbean.getObjectName());
    }
  }
}

Fixed version (ground truth):
private static void registerLoggerConfigs(final LoggerContext ctx,final MBeanServer mbs,final Executor executor) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  final Map<String,LoggerConfig> map=ctx.getConfiguration().getLoggers();
  for (  final String name : map.keySet()) {
    final LoggerConfig cfg=map.get(name);
    final LoggerConfigAdmin mbean=new LoggerConfigAdmin(ctx.getName(),cfg);
    register(mbs,mbean,mbean.getObjectName());
    if (cfg instanceof AsyncLoggerConfig) {
      AsyncLoggerConfig async=(AsyncLoggerConfig)cfg;
      RingBufferAdmin rbmbean=async.createRingBufferAdmin(ctx.getName());
      register(mbs,rbmbean,rbmbean.getObjectName());
    }
  }
}
Program: 90695
Project: 90695
Buggy source:
@Override public void log(final Marker marker,final String fqcn,final Level level,final Message data,final Throwable t){
  Info info=threadlocalInfo.get();
  if (info == null) {
    info=new Info(new RingBufferLogEventTranslator(),Thread.currentThread().getName());
    threadlocalInfo.set(info);
  }
  final boolean includeLocation=config.loggerConfig.isIncludeLocation();
  info.translator.setValues(this,getName(),marker,fqcn,level,data,t,ThreadContext.getImmutableContext(),ThreadContext.getImmutableStack(),THREAD_NAME_STRATEGY.getThreadName(info),includeLocation ? location(fqcn) : null,clock.currentTimeMillis());
  disruptor.publishEvent(info.translator);
}

Fixed version (ground truth):
@Override public void log(final Marker marker,final String fqcn,final Level level,final Message data,final Throwable t){
  Info info=threadlocalInfo.get();
  if (info == null) {
    info=new Info(new RingBufferLogEventTranslator(),Thread.currentThread().getName(),false);
    threadlocalInfo.set(info);
  }
  if (info.isAppenderThread && disruptor.getRingBuffer().remainingCapacity() == 0) {
    config.loggerConfig.log(getName(),marker,fqcn,level,data,t);
    return;
  }
  final boolean includeLocation=config.loggerConfig.isIncludeLocation();
  info.translator.setValues(this,getName(),marker,fqcn,level,data,t,ThreadContext.getImmutableContext(),ThreadContext.getImmutableStack(),THREAD_NAME_STRATEGY.getThreadName(info),includeLocation ? location(fqcn) : null,clock.currentTimeMillis());
  disruptor.publishEvent(info.translator);
}
Program: 90696
Project: 90696
Buggy source:
public Info(RingBufferLogEventTranslator translator,String threadName){
  this.translator=translator;
  this.cachedThreadName=threadName;
}

Fixed version (ground truth):
public Info(RingBufferLogEventTranslator translator,String threadName,boolean appenderThread){
  this.translator=translator;
  this.cachedThreadName=threadName;
  this.isAppenderThread=appenderThread;
}
Program: 90697
Project: 90697
Buggy source:
/** 
 * Passes on the event to a separate thread that will call  {@link #asyncCallAppenders(LogEvent)}.
 */
@Override protected void callAppenders(final LogEvent event){
  event.getSource();
  event.getThreadName();
  helper.callAppendersFromAnotherThread(event);
}

Fixed version (ground truth):
/** 
 * Passes on the event to a separate thread that will call  {@link #asyncCallAppenders(LogEvent)}.
 */
@Override protected void callAppenders(final LogEvent event){
  event.getSource();
  event.getThreadName();
  if (!helper.callAppendersFromAnotherThread(event)) {
    super.callAppenders(event);
  }
}