nus-yam/ex-repair huggingface dataset:
Program: 90481
Project: 90481
Buggy source:
/** 
 * Runs a given test comparing against the expected values.
 * @param options The list of options to parse.
 * @param expectedLines The expected lines.
 * @param expectedPackages The expected package filters.
 * @param expectedSeparator The expected seperator.
 */
private static void test(final String[] options,final int expectedLines,final String expectedSeparator,final List<String> expectedPackages){
  final ThrowableFormatOptions o=ThrowableFormatOptions.newInstance(options);
  assertEquals("String_Node_Str",expectedLines,o.getLines());
  assertEquals("String_Node_Str",expectedSeparator,o.getSeparator());
  assertEquals("String_Node_Str",expectedPackages,o.getPackages());
  assertEquals("String_Node_Str",expectedLines == Integer.MAX_VALUE,o.allLines());
  assertEquals("String_Node_Str",expectedLines != 0,o.anyLines());
  assertEquals("String_Node_Str",0,o.minLines(0));
  assertEquals("String_Node_Str",expectedLines,o.minLines(Integer.MAX_VALUE));
  assertEquals("String_Node_Str",expectedPackages != null && !expectedPackages.isEmpty(),o.hasPackages());
  assertNotNull("String_Node_Str",o.toString());
}

Fixed version (ground truth):
/** 
 * Runs a given test comparing against the expected values.
 * @param options The list of options to parse.
 * @param expectedLines The expected lines.
 * @param expectedPackages The expected package filters.
 * @param expectedSeparator The expected seperator.
 */
private static void test(final String[] options,final int expectedLines,final String expectedSeparator,final List<String> expectedPackages){
  final ThrowableFormatOptions o=ThrowableFormatOptions.newInstance(options);
  assertEquals("String_Node_Str",expectedLines,o.getLines());
  assertEquals("String_Node_Str",expectedSeparator,o.getSeparator());
  assertEquals("String_Node_Str",expectedPackages,o.getIgnorePackages());
  assertEquals("String_Node_Str",expectedLines == Integer.MAX_VALUE,o.allLines());
  assertEquals("String_Node_Str",expectedLines != 0,o.anyLines());
  assertEquals("String_Node_Str",0,o.minLines(0));
  assertEquals("String_Node_Str",expectedLines,o.minLines(Integer.MAX_VALUE));
  assertEquals("String_Node_Str",expectedPackages != null && !expectedPackages.isEmpty(),o.hasPackages());
  assertNotNull("String_Node_Str",o.toString());
}
Program: 90482
Project: 90482
Buggy source:
/** 
 * Logs entry to a method using a Message to describe the parameters. <pre> public void doSomething(Request foo) { LOGGER.traceEntry(new JsonMessage(foo)); // do something } </pre>
 * @param message The message.
 * @return the built message
 * @since 2.6
 */
EntryMessage traceEntry(Message message);

Fixed version (ground truth):
/** 
 * Logs entry to a method using a Message to describe the parameters. <pre> public void doSomething(Request foo) { LOGGER.traceEntry(new JsonMessage(foo)); // do something } </pre> <p> Avoid passing a   {@code ReusableMessage} to this method (therefore, also avoid passing messages created bycalling  {@code logger.getMessageFactory().newMessage("some message")}): Log4j will replace such messages with an immutable message to prevent situations where the reused message instance is modified by subsequent calls to the logger before the returned   {@code EntryMessage} is fully processed.</p>
 * @param message The message. Avoid specifying a ReusableMessage, use immutable messages instead.
 * @return the built message
 * @since 2.6
 * @see org.apache.logging.log4j.message.ReusableMessage
 */
EntryMessage traceEntry(Message message);
Program: 90483
Project: 90483
Buggy source:
@Override public EntryMessage newEntryMessage(final Message message){
  return new SimpleEntryMessage(entryText,message);
}

Fixed version (ground truth):
@Override public EntryMessage newEntryMessage(final Message message){
  return new SimpleEntryMessage(entryText,makeImmutable(message));
}
Program: 90484
Project: 90484
Buggy source:
private MessageRenderer loadMessageRenderer(String[] options){
  if (formats != null && formats.length == 0) {
    return null;
  }
  final String format=formats[0].toUpperCase(Locale.ROOT);
switch (format) {
case "String_Node_Str":
    return new JAnsiMessageRenderer(formats);
case "String_Node_Str":
  return new HtmlMessageRenderer(formats);
}
return null;
}

Fixed version (ground truth):
private MessageRenderer loadMessageRenderer(String[] options){
  if (formats != null && formats.length > 0) {
    final String format=formats[0].toUpperCase(Locale.ROOT);
switch (format) {
case "String_Node_Str":
      return new JAnsiMessageRenderer(formats);
case "String_Node_Str":
    return new HtmlMessageRenderer(formats);
}
}
return null;
}
Program: 90485
Project: 90485
Buggy source:
/** 
 * Provide the RollingFileManager to the policy.
 * @param manager The RollingFileManager.
 */
@Override public void initialize(final RollingFileManager manager){
  this.manager=manager;
  if (manager.getFileSize() > 0) {
    manager.skipFooter(true);
    manager.rollover();
    manager.skipFooter(false);
  }
}

Fixed version (ground truth):
/** 
 * Provide the RollingFileManager to the policy.
 * @param manager The RollingFileManager.
 */
@Override public void initialize(final RollingFileManager manager){
  if (manager.getFileTime() < JVM_START_TIME && manager.getFileSize() >= minSize) {
    manager.skipFooter(true);
    manager.rollover();
    manager.skipFooter(false);
  }
}
Program: 90486
Project: 90486
Buggy source:
@PluginFactory public static OnStartupTriggeringPolicy createPolicy(){
  return new OnStartupTriggeringPolicy();
}

Fixed version (ground truth):
@PluginFactory public static OnStartupTriggeringPolicy createPolicy(@PluginAttribute(value="String_Node_Str",defaultLong=1) final long minSize){
  return new OnStartupTriggeringPolicy(minSize);
}
Program: 90487
Project: 90487
Buggy source:
@Test public void testPolicy() throws Exception {
  final Configuration configuration=new DefaultConfiguration();
  final Path target=Paths.get(TARGET_FILE);
  final Path rolled=Paths.get(ROLLED_FILE);
  Files.deleteIfExists(target);
  Files.deleteIfExists(rolled);
  final InputStream is=new ByteArrayInputStream(TEST_DATA.getBytes("String_Node_Str"));
  Files.copy(is,target);
  is.close();
  final long size=Files.size(target);
  assertTrue(size > 0);
  final PatternLayout layout=PatternLayout.newBuilder().withPattern("String_Node_Str").withConfiguration(configuration).build();
  final RolloverStrategy strategy=DefaultRolloverStrategy.createStrategy(null,null,null,"String_Node_Str",null,true,configuration);
  final OnStartupTriggeringPolicy policy=OnStartupTriggeringPolicy.createPolicy();
  final RollingFileManager manager=RollingFileManager.getFileManager(TARGET_FILE,TARGET_PATTERN,true,false,policy,strategy,null,layout,8192,true);
  manager.initialize();
  assertTrue(Files.exists(target));
  assertTrue(Files.size(target) == 0);
  assertTrue(Files.exists(rolled));
  assertTrue(Files.size(rolled) == size);
}

Fixed version (ground truth):
@Test public void testPolicy() throws Exception {
  final Configuration configuration=new DefaultConfiguration();
  final Path target=Paths.get(TARGET_FILE);
  final Path rolled=Paths.get(ROLLED_FILE);
  Files.deleteIfExists(target);
  Files.deleteIfExists(rolled);
  final InputStream is=new ByteArrayInputStream(TEST_DATA.getBytes("String_Node_Str"));
  Files.copy(is,target);
  is.close();
  final long size=Files.size(target);
  assertTrue(size > 0);
  final PatternLayout layout=PatternLayout.newBuilder().withPattern("String_Node_Str").withConfiguration(configuration).build();
  final RolloverStrategy strategy=DefaultRolloverStrategy.createStrategy(null,null,null,"String_Node_Str",null,true,configuration);
  final OnStartupTriggeringPolicy policy=OnStartupTriggeringPolicy.createPolicy(1);
  final RollingFileManager manager=RollingFileManager.getFileManager(TARGET_FILE,TARGET_PATTERN,true,false,policy,strategy,null,layout,8192,true);
  manager.initialize();
  assertTrue(Files.exists(target));
  assertTrue(Files.size(target) == 0);
  assertTrue(Files.exists(rolled));
  assertTrue(Files.size(rolled) == size);
}
Program: 90488
Project: 90488
Buggy source:
/** 
 * Not a real test, just make sure we can compile access to the typed manager.
 * @throws IOException
 */
@Test public void testAccessManager() throws IOException {
  final LoggerContext ctx=LoggerContext.getContext(false);
  final Configuration config=ctx.getConfiguration();
  final File file=File.createTempFile("String_Node_Str","String_Node_Str");
  file.deleteOnExit();
  final RollingFileAppender appender=RollingFileAppender.createAppender(file.getCanonicalPath(),"String_Node_Str",null,"String_Node_Str",null,null,null,OnStartupTriggeringPolicy.createPolicy(),null,null,null,null,null,null,config);
  final RollingFileManager manager=appender.getManager();
  manager.getRolloverStrategy();
  manager.getTriggeringPolicy();
}

Fixed version (ground truth):
/** 
 * Not a real test, just make sure we can compile access to the typed manager.
 * @throws IOException
 */
@Test public void testAccessManager() throws IOException {
  final LoggerContext ctx=LoggerContext.getContext(false);
  final Configuration config=ctx.getConfiguration();
  final File file=File.createTempFile("String_Node_Str","String_Node_Str");
  file.deleteOnExit();
  final RollingFileAppender appender=RollingFileAppender.createAppender(file.getCanonicalPath(),"String_Node_Str",null,"String_Node_Str",null,null,null,OnStartupTriggeringPolicy.createPolicy(1),null,null,null,null,null,null,config);
  final RollingFileManager manager=appender.getManager();
  manager.getRolloverStrategy();
  manager.getTriggeringPolicy();
}
Program: 90489
Project: 90489
Buggy source:
private void initThrowable(final Object[] params,final int argCount,final int usedParams){
  if (usedParams < argCount && this.throwable == null && params[argCount - 1] instanceof Throwable) {
    this.throwable=(Throwable)params[argCount - 1];
  }
}

Fixed version (ground truth):
private void initThrowable(final Object[] params,final int argCount,final int usedParams){
  if (usedParams < argCount && params[argCount - 1] instanceof Throwable) {
    this.throwable=(Throwable)params[argCount - 1];
  }
 else {
    this.throwable=null;
  }
}
Program: 90491
Project: 90491
Buggy source:
@Override public void evaluate() throws Throwable {
  final Configuration oldConfig=rule.getConfiguration();
  final org.apache.logging.log4j.Logger logger=rule.getLogger("String_Node_Str");
  final int MONITOR_INTERVAL_SECONDS=5;
  final File file=new File("String_Node_Str");
  final long orig=file.lastModified();
  final long newTime=orig + 10000;
  assertTrue("String_Node_Str",file.setLastModified(newTime));
  TimeUnit.SECONDS.sleep(MONITOR_INTERVAL_SECONDS + 1);
  for (int i=0; i < 17; ++i) {
    logger.debug("String_Node_Str");
  }
  int loopCount=0;
  Configuration newConfig;
  do {
    Thread.sleep(100);
    newConfig=rule.getConfiguration();
    ++loopCount;
  }
 while (newConfig == oldConfig && loopCount <= 5);
  assertNotSame("String_Node_Str",newConfig,oldConfig);
}

Fixed version (ground truth):
@Override public void evaluate() throws Throwable {
  CompositeConfiguration config=(CompositeConfiguration)lcr.getConfiguration();
  Map<String,Appender> appendersMap=config.getLogger("String_Node_Str").getAppenders();
  assertEquals("String_Node_Str" + appendersMap.size(),2,appendersMap.size());
  assertTrue(appendersMap.get("String_Node_Str") instanceof ConsoleAppender);
  appendersMap=config.getLogger("String_Node_Str").getAppenders();
  assertEquals("String_Node_Str" + appendersMap.size(),1,appendersMap.size());
  assertTrue(appendersMap.get("String_Node_Str") instanceof FileAppender);
  appendersMap=config.getLogger("String_Node_Str").getAppenders();
  assertEquals("String_Node_Str" + appendersMap.size(),1,appendersMap.size());
  assertTrue(appendersMap.get("String_Node_Str") instanceof FileAppender);
  appendersMap=config.getRootLogger().getAppenders();
  assertEquals("String_Node_Str" + appendersMap.size(),2,appendersMap.size());
  assertTrue(appendersMap.get("String_Node_Str") instanceof FileAppender);
  assertTrue(appendersMap.get("String_Node_Str") instanceof ConsoleAppender);
}
Program: 90492
Project: 90492
Buggy source:
private boolean handleInterruptedException(final Log4jLogEvent frozenLogEvent){
  final boolean appendSuccessful=queue.offer(frozenLogEvent);
  if (!appendSuccessful) {
    LOGGER.warn("String_Node_Str",getName());
  }
  Thread.currentThread().interrupt();
  return appendSuccessful;
}

Fixed version (ground truth):
private boolean handleInterruptedException(final LogEvent memento){
  final boolean appendSuccessful=queue.offer(memento);
  if (!appendSuccessful) {
    LOGGER.warn("String_Node_Str",getName());
  }
  Thread.currentThread().interrupt();
  return appendSuccessful;
}
Program: 90493
Project: 90493
Buggy source:
/** 
 * FOR INTERNAL USE ONLY.
 * @param logEvent the event to log
 */
public void logMessageInBackgroundThread(final LogEvent logEvent){
  final boolean success=blocking ? enqueueOrBlockIfQueueFull(logEvent) : enqueueOrDropIfQueueFull(logEvent);
  logToErrorAppenderIfNecessary(success,logEvent);
}

Fixed version (ground truth):
/** 
 * FOR INTERNAL USE ONLY.
 * @param logEvent the event to log
 */
public void logMessageInBackgroundThread(final LogEvent logEvent){
  try {
    queue.put(logEvent);
  }
 catch (  final InterruptedException e) {
    final boolean appendSuccessful=handleInterruptedException(logEvent);
    logToErrorAppenderIfNecessary(appendSuccessful,logEvent);
  }
}
Program: 90494
Project: 90494
Buggy source:
/** 
 * Actual writing occurs here.
 * @param logEvent The LogEvent.
 */
@Override public void append(LogEvent logEvent){
  if (!isStarted()) {
    throw new IllegalStateException("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND) {
    logEvent.getMessage().getFormattedMessage();
  }
  final EventRoute route=asyncEventRouter.getRoute(thread.getId(),logEvent.getLevel());
  route.logMessage(this,logEvent);
}

Fixed version (ground truth):
/** 
 * Actual writing occurs here.
 * @param logEvent The LogEvent.
 */
@Override public void append(LogEvent logEvent){
  if (!isStarted()) {
    throw new IllegalStateException("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND) {
    logEvent.getMessage().getFormattedMessage();
  }
  final Log4jLogEvent memento=Log4jLogEvent.createMemento(logEvent,includeLocation);
  if (!queue.offer(memento)) {
    if (blocking) {
      final EventRoute route=asyncEventRouter.getRoute(thread.getId(),memento.getLevel());
      route.logMessage(this,memento);
    }
 else {
      error("String_Node_Str" + getName() + "String_Node_Str");
      logToErrorAppenderIfNecessary(false,memento);
    }
  }
}
Program: 90495
Project: 90495
Buggy source:
private static void runLatencyTest(final int samples,final Logger logger,final Histogram serviceTmHist,final Histogram responseTmHist,final Pacer pacer){
  for (int i=0; i < samples; i++) {
    final long expectedStartTimeNanos=pacer.expectedNextOperationNanoTime();
    pacer.acquire(1);
    final long actualStartTime=System.nanoTime();
    logger.info(LATENCY_MSG);
    final long doneTime=System.nanoTime();
    serviceTmHist.recordValue(doneTime - actualStartTime);
    responseTmHist.recordValue(doneTime - expectedStartTimeNanos);
  }
}

Fixed version (ground truth):
private static void runLatencyTest(final int samples,final Logger logger,final Histogram serviceTmHist,final Histogram responseTmHist,final Pacer pacer){
  pacer.setInitialStartTime(System.nanoTime());
  for (int i=0; i < samples; i++) {
    final long expectedStartTimeNanos=pacer.expectedNextOperationNanoTime();
    pacer.acquire(1);
    final long actualStartTime=System.nanoTime();
    logger.info(LATENCY_MSG);
    final long doneTime=System.nanoTime();
    serviceTmHist.recordValue(doneTime - actualStartTime);
    responseTmHist.recordValue(doneTime - expectedStartTimeNanos);
  }
}
Program: 90496
Project: 90496
Buggy source:
private void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    parameters=reusable.swapParameters(parameters);
    parameterCount=reusable.getParameterCount();
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}

Fixed version (ground truth):
private void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    if (parameters != null) {
      parameters=reusable.swapParameters(parameters);
      parameterCount=reusable.getParameterCount();
    }
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}
Program: 90497
Project: 90497
Buggy source:
public void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    parameters=reusable.swapParameters(parameters);
    parameterCount=reusable.getParameterCount();
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}

Fixed version (ground truth):
public void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    if (parameters != null) {
      parameters=reusable.swapParameters(parameters);
      parameterCount=reusable.getParameterCount();
    }
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}
Program: 90498
Project: 90498
Buggy source:
@Override public T build(){
  T configuration;
  try {
    if (source == null) {
      source=ConfigurationSource.NULL_SOURCE;
    }
    final Constructor<T> constructor=clazz.getConstructor(ConfigurationSource.class,Component.class);
    configuration=constructor.newInstance(source,root);
    configuration.setMonitorInterval(monitorInterval);
    if (name != null) {
      configuration.setName(name);
    }
    if (level != null) {
      configuration.getStatusConfiguration().withStatus(level);
    }
    if (verbosity != null) {
      configuration.getStatusConfiguration().withVerbosity(verbosity);
    }
    if (packages != null) {
      configuration.setPluginPackages(packages);
    }
    if (shutdownFlag != null) {
      configuration.setShutdownHook(shutdownFlag);
    }
    if (advertiser != null) {
      configuration.createAdvertiser(advertiser,source);
    }
  }
 catch (  final Exception ex) {
    throw new IllegalArgumentException("String_Node_Str",ex);
  }
  configuration.getStatusConfiguration().initialize();
  configuration.initialize();
  return configuration;
}

Fixed version (ground truth):
@Override public T build(boolean initialize){
  T configuration;
  try {
    if (source == null) {
      source=ConfigurationSource.NULL_SOURCE;
    }
    final Constructor<T> constructor=clazz.getConstructor(ConfigurationSource.class,Component.class);
    configuration=constructor.newInstance(source,root);
    configuration.setMonitorInterval(monitorInterval);
    configuration.getRootNode().getAttributes().putAll(root.getAttributes());
    if (name != null) {
      configuration.setName(name);
    }
    if (level != null) {
      configuration.getStatusConfiguration().withStatus(level);
    }
    if (verbosity != null) {
      configuration.getStatusConfiguration().withVerbosity(verbosity);
    }
    if (packages != null) {
      configuration.setPluginPackages(packages);
    }
    if (shutdownFlag != null) {
      configuration.setShutdownHook(shutdownFlag);
    }
    if (advertiser != null) {
      configuration.createAdvertiser(advertiser,source);
    }
  }
 catch (  final Exception ex) {
    throw new IllegalArgumentException("String_Node_Str",ex);
  }
  configuration.getStatusConfiguration().initialize();
  if (initialize) {
    configuration.initialize();
  }
  return configuration;
}
Program: 90499
Project: 90499
Buggy source:
/** 
 * Construct the ComponsiteConfiguration.
 * @param configurations The List of Configurations to merge.
 */
public CompositeConfiguration(List<? extends AbstractConfiguration> configurations){
  super(ConfigurationSource.NULL_SOURCE);
  this.configurations=configurations;
  String mergeStrategyClassName=PropertiesUtil.getProperties().getStringProperty(MERGE_STRATEGY_PROPERTY,DefaultMergeStrategy.class.getName());
  try {
    mergeStrategy=LoaderUtil.newInstanceOf(mergeStrategyClassName);
  }
 catch (  ClassNotFoundException|IllegalAccessException|NoSuchMethodException|InvocationTargetException|InstantiationException ex) {
    mergeStrategy=new DefaultMergeStrategy();
  }
}

Fixed version (ground truth):
/** 
 * Construct the ComponsiteConfiguration.
 * @param configurations The List of Configurations to merge.
 */
public CompositeConfiguration(List<? extends AbstractConfiguration> configurations){
  super(ConfigurationSource.NULL_SOURCE);
  rootNode=configurations.get(0).getRootNode();
  this.configurations=configurations;
  String mergeStrategyClassName=PropertiesUtil.getProperties().getStringProperty(MERGE_STRATEGY_PROPERTY,DefaultMergeStrategy.class.getName());
  try {
    mergeStrategy=LoaderUtil.newInstanceOf(mergeStrategyClassName);
  }
 catch (  ClassNotFoundException|IllegalAccessException|NoSuchMethodException|InvocationTargetException|InstantiationException ex) {
    mergeStrategy=new DefaultMergeStrategy();
  }
  for (  AbstractConfiguration config : configurations) {
    mergeStrategy.mergeRootProperties(rootNode,config);
  }
  final StatusConfiguration statusConfig=new StatusConfiguration().withVerboseClasses(VERBOSE_CLASSES).withStatus(getDefaultStatus());
  for (  final Map.Entry<String,String> entry : rootNode.getAttributes().entrySet()) {
    final String key=entry.getKey();
    final String value=getStrSubstitutor().replace(entry.getValue());
    if ("String_Node_Str".equalsIgnoreCase(key)) {
      statusConfig.withStatus(value.toUpperCase());
    }
 else     if ("String_Node_Str".equalsIgnoreCase(key)) {
      statusConfig.withDestination(value);
    }
 else     if ("String_Node_Str".equalsIgnoreCase(key)) {
      isShutdownHookEnabled=!"String_Node_Str".equalsIgnoreCase(value);
    }
 else     if ("String_Node_Str".equalsIgnoreCase(key)) {
      statusConfig.withVerbosity(value);
    }
 else     if ("String_Node_Str".equalsIgnoreCase(key)) {
      pluginPackages.addAll(Arrays.asList(value.split(Patterns.COMMA_SEPARATOR)));
    }
 else     if ("String_Node_Str".equalsIgnoreCase(key)) {
      setName(value);
    }
  }
  statusConfig.initialize();
}
Program: 90501
Project: 90501
Buggy source:
@Override public Configuration reconfigure(){
  List<AbstractConfiguration> configs=new ArrayList<>();
  ConfigurationFactory factory=ConfigurationFactory.getInstance();
  for (  AbstractConfiguration config : configurations) {
    ConfigurationSource source=config.getConfigurationSource();
    URI sourceURI=source.getURI();
    Configuration currentConfig;
    if (sourceURI != null) {
      LOGGER.warn("String_Node_Str",config.getName());
      currentConfig=factory.getConfiguration(config.getName(),sourceURI);
      if (currentConfig == null) {
        LOGGER.warn("String_Node_Str",config.getName());
        currentConfig=config;
      }
    }
 else {
      currentConfig=config;
    }
    configs.add((AbstractConfiguration)currentConfig);
  }
  return new CompositeConfiguration(configs);
}

Fixed version (ground truth):
@Override public Configuration reconfigure(){
  LOGGER.debug("String_Node_Str");
  List<AbstractConfiguration> configs=new ArrayList<>();
  ConfigurationFactory factory=ConfigurationFactory.getInstance();
  for (  AbstractConfiguration config : configurations) {
    ConfigurationSource source=config.getConfigurationSource();
    URI sourceURI=source.getURI();
    Configuration currentConfig;
    if (sourceURI != null) {
      LOGGER.warn("String_Node_Str",config.getName());
      currentConfig=factory.getConfiguration(config.getName(),sourceURI);
      if (currentConfig == null) {
        LOGGER.warn("String_Node_Str",config.getName());
        currentConfig=config;
      }
    }
 else {
      currentConfig=config;
    }
    configs.add((AbstractConfiguration)currentConfig);
  }
  return new CompositeConfiguration(configs);
}
Program: 90503
Project: 90503
Buggy source:
@Override public Configuration reconfigure(){
  try {
    final ConfigurationSource source=getConfigurationSource().resetInputStream();
    if (source == null) {
      return null;
    }
    final PropertiesConfigurationFactory factory=new PropertiesConfigurationFactory();
    final PropertiesConfiguration config=factory.getConfiguration(source);
    return config == null || config.getState() != State.INITIALIZED ? null : config;
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str",getConfigurationSource(),ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public Configuration reconfigure(){
  try {
    final ConfigurationSource source=getConfigurationSource().resetInputStream();
    if (source == null) {
      return null;
    }
    final PropertiesConfigurationFactory factory=new PropertiesConfigurationFactory();
    final PropertiesConfiguration config=factory.getConfiguration(source);
    return config == null || config.getState() != State.INITIALIZING ? null : config;
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str",getConfigurationSource(),ex);
  }
  return null;
}
Program: 90505
Project: 90505
Buggy source:
private boolean configureExistingStatusConsoleListener(){
  boolean configured=false;
  for (  final StatusListener statusListener : this.logger.getListeners()) {
    if (statusListener instanceof StatusConsoleListener) {
      final StatusConsoleListener listener=(StatusConsoleListener)statusListener;
      listener.setLevel(this.status);
      if (this.verbosity == Verbosity.QUIET) {
        listener.setFilters(this.verboseClasses);
      }
      configured=true;
    }
  }
  return configured;
}

Fixed version (ground truth):
private boolean configureExistingStatusConsoleListener(){
  boolean configured=false;
  for (  final StatusListener statusListener : this.logger.getListeners()) {
    if (statusListener instanceof StatusConsoleListener) {
      final StatusConsoleListener listener=(StatusConsoleListener)statusListener;
      listener.setLevel(this.status);
      this.logger.updateListenerLevel(this.status);
      if (this.verbosity == Verbosity.QUIET) {
        listener.setFilters(this.verboseClasses);
      }
      configured=true;
    }
  }
  return configured;
}
Program: 90506
Project: 90506
Buggy source:
private void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    parameters=reusable.swapParameters(parameters);
    parameterCount=reusable.getParameterCount();
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}

Fixed version (ground truth):
private void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    if (parameters != null) {
      parameters=reusable.swapParameters(parameters);
      parameterCount=reusable.getParameterCount();
    }
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}
Program: 90507
Project: 90507
Buggy source:
public void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    parameters=reusable.swapParameters(parameters);
    parameterCount=reusable.getParameterCount();
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}

Fixed version (ground truth):
public void setMessage(final Message msg){
  if (msg instanceof ReusableMessage) {
    ReusableMessage reusable=(ReusableMessage)msg;
    reusable.formatTo(getMessageTextForWriting());
    if (parameters != null) {
      parameters=reusable.swapParameters(parameters);
      parameterCount=reusable.getParameterCount();
    }
  }
 else {
    if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) {
      msg.getFormattedMessage();
    }
    this.message=msg;
  }
}
Program: 90508
Project: 90508
Buggy source:
@Override public boolean isEnabled(final Level level,final Marker marker,final String data,final Throwable t){
  return isEnabled(level,marker,new SimpleMessage(data),t);
}

Fixed version (ground truth):
@Override public boolean isEnabled(final Level level,final Marker marker,final String data,final Throwable t){
  return isEnabled(level,marker,(Message)new SimpleMessage(data),t);
}
Program: 90509
Project: 90509
Buggy source:
@Test public void testTimestampMessage(){
  final Logger log=context.getLogger("String_Node_Str");
  log.info(new TimeMsg("String_Node_Str",123456789000L));
  final List<String> msgs=app.getMessages();
  assertNotNull(msgs);
  assertEquals(1,msgs.size());
  final String NL=System.lineSeparator();
  assertEquals("String_Node_Str" + NL,msgs.get(0));
}

Fixed version (ground truth):
@Test public void testTimestampMessage(){
  final Logger log=context.getLogger("String_Node_Str");
  log.info((Message)new TimeMsg("String_Node_Str",123456789000L));
  final List<String> msgs=app.getMessages();
  assertNotNull(msgs);
  assertEquals(1,msgs.size());
  final String NL=System.lineSeparator();
  assertEquals("String_Node_Str" + NL,msgs.get(0));
}
Program: 90510
Project: 90510
Buggy source:
@Test public void testAsyncLogWritesToLog() throws Exception {
  final File file=new File("String_Node_Str","String_Node_Str");
  file.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  assertFalse(PoisonClock.called);
  log.info(new TimeMsg("String_Node_Str",123456789000L));
  assertTrue(PoisonClock.called);
  CoreLoggerContexts.stopLoggerContext(false,file);
  final BufferedReader reader=new BufferedReader(new FileReader(file));
  final String line1=reader.readLine();
  reader.close();
  file.delete();
  assertNotNull(line1);
  assertTrue("String_Node_Str",line1.equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testAsyncLogWritesToLog() throws Exception {
  final File file=new File("String_Node_Str","String_Node_Str");
  file.delete();
  final Logger log=LogManager.getLogger("String_Node_Str");
  assertFalse(PoisonClock.called);
  log.info((Message)new TimeMsg("String_Node_Str",123456789000L));
  assertTrue(PoisonClock.called);
  CoreLoggerContexts.stopLoggerContext(false,file);
  final BufferedReader reader=new BufferedReader(new FileReader(file));
  final String line1=reader.readLine();
  reader.close();
  file.delete();
  assertNotNull(line1);
  assertTrue("String_Node_Str",line1.equals("String_Node_Str"));
}
Program: 90511
Project: 90511
Buggy source:
@BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.SECONDS) @Benchmark public void testDebugMessageDisabledThroughput(final Blackhole bh){
  logger.debug(new SimpleMessage(msg));
}

Fixed version (ground truth):
@BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.SECONDS) @Benchmark public void testDebugMessageDisabledThroughput(final Blackhole bh){
  logger.debug((Message)new SimpleMessage(msg));
}
Program: 90512
Project: 90512
Buggy source:
@BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Benchmark public void testDebugDisabledMessageResponseTime(final Blackhole bh){
  logger.debug(new SimpleMessage(msg));
}

Fixed version (ground truth):
@BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Benchmark public void testDebugDisabledMessageResponseTime(final Blackhole bh){
  logger.debug((Message)new SimpleMessage(msg));
}
Program: 90513
Project: 90513
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void format(final LogEvent event,final StringBuilder toAppendTo){
  ThrowableProxy proxy=null;
  if (event instanceof Log4jLogEvent) {
    proxy=event.getThrownProxy();
  }
  final Throwable throwable=event.getThrown();
  if (throwable != null && options.anyLines()) {
    if (proxy == null) {
      super.format(event,toAppendTo);
      return;
    }
    final String trace=proxy.getCauseStackTraceAsString(options.getPackages());
    final int len=toAppendTo.length();
    if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
      toAppendTo.append(' ');
    }
    if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
      final StringBuilder sb=new StringBuilder();
      final String[] array=trace.split(Constants.LINE_SEPARATOR);
      final int limit=options.minLines(array.length) - 1;
      for (int i=0; i <= limit; ++i) {
        sb.append(array[i]);
        if (i < limit) {
          sb.append(options.getSeparator());
        }
      }
      toAppendTo.append(sb.toString());
    }
 else {
      toAppendTo.append(trace);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void format(final LogEvent event,final StringBuilder toAppendTo){
  ThrowableProxy proxy=event.getThrownProxy();
  final Throwable throwable=event.getThrown();
  if (throwable != null && options.anyLines()) {
    if (proxy == null) {
      super.format(event,toAppendTo);
      return;
    }
    final String trace=proxy.getCauseStackTraceAsString(options.getPackages());
    final int len=toAppendTo.length();
    if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
      toAppendTo.append(' ');
    }
    if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
      final StringBuilder sb=new StringBuilder();
      final String[] array=trace.split(Constants.LINE_SEPARATOR);
      final int limit=options.minLines(array.length) - 1;
      for (int i=0; i <= limit; ++i) {
        sb.append(array[i]);
        if (i < limit) {
          sb.append(options.getSeparator());
        }
      }
      toAppendTo.append(sb.toString());
    }
 else {
      toAppendTo.append(trace);
    }
  }
}
Program: 90514
Project: 90514
Buggy source:
public void clear(){
  loggerFqcn=null;
  marker=null;
  level=null;
  loggerName=null;
  message=null;
  thrown=null;
  thrownProxy=null;
  source=null;
  contextMap=null;
  contextStack=null;
  threadName=null;
}

Fixed version (ground truth):
public void clear(){
  loggerFqcn=null;
  marker=null;
  level=null;
  loggerName=null;
  message=null;
  thrown=null;
  thrownProxy=null;
  source=null;
  contextMap=null;
  contextStack=null;
}
Program: 90515
Project: 90515
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void format(final LogEvent event,final StringBuilder toAppendTo){
  ThrowableProxy proxy=null;
  if (event instanceof Log4jLogEvent) {
    proxy=event.getThrownProxy();
  }
  final Throwable throwable=event.getThrown();
  if ((throwable != null || proxy != null) && options.anyLines()) {
    if (proxy == null) {
      super.format(event,toAppendTo);
      return;
    }
    final String extStackTrace=proxy.getExtendedStackTraceAsString(options.getPackages());
    final int len=toAppendTo.length();
    if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
      toAppendTo.append(' ');
    }
    if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
      final StringBuilder sb=new StringBuilder();
      final String[] array=extStackTrace.split(Constants.LINE_SEPARATOR);
      final int limit=options.minLines(array.length) - 1;
      for (int i=0; i <= limit; ++i) {
        sb.append(array[i]);
        if (i < limit) {
          sb.append(options.getSeparator());
        }
      }
      toAppendTo.append(sb.toString());
    }
 else {
      toAppendTo.append(extStackTrace);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void format(final LogEvent event,final StringBuilder toAppendTo){
  ThrowableProxy proxy=event.getThrownProxy();
  final Throwable throwable=event.getThrown();
  if ((throwable != null || proxy != null) && options.anyLines()) {
    if (proxy == null) {
      super.format(event,toAppendTo);
      return;
    }
    final String extStackTrace=proxy.getExtendedStackTraceAsString(options.getPackages());
    final int len=toAppendTo.length();
    if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
      toAppendTo.append(' ');
    }
    if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
      final StringBuilder sb=new StringBuilder();
      final String[] array=extStackTrace.split(Constants.LINE_SEPARATOR);
      final int limit=options.minLines(array.length) - 1;
      for (int i=0; i <= limit; ++i) {
        sb.append(array[i]);
        if (i < limit) {
          sb.append(options.getSeparator());
        }
      }
      toAppendTo.append(sb.toString());
    }
 else {
      toAppendTo.append(extStackTrace);
    }
  }
}
Program: 90516
Project: 90516
Buggy source:
/** 
 * Some output streams synchronize writes while others do not. Synchronizing here insures that log events won't be intertwined.
 * @param bytes The serialized Log event.
 * @param offset The offset into the byte array.
 * @param length The number of bytes to write.
 * @param immediateFlush flushes immediately after writing.
 * @throws AppenderLoggingException if an error occurs.
 */
protected synchronized void write(final byte[] bytes,final int offset,final int length,boolean immediateFlush){
  if (immediateFlush && byteBuffer.position() == 0) {
    writeToDestination(bytes,offset,length);
    return;
  }
  if (length >= byteBuffer.capacity()) {
    flush();
    writeToDestination(bytes,offset,length);
  }
 else {
    if (length > byteBuffer.remaining()) {
      flush();
    }
    byteBuffer.put(bytes,offset,length);
  }
  if (immediateFlush) {
    flush();
  }
}

Fixed version (ground truth):
/** 
 * Some output streams synchronize writes while others do not. Synchronizing here insures that log events won't be intertwined.
 * @param bytes The serialized Log event.
 * @param offset The offset into the byte array.
 * @param length The number of bytes to write.
 * @param immediateFlush flushes immediately after writing.
 * @throws AppenderLoggingException if an error occurs.
 */
protected synchronized void write(final byte[] bytes,final int offset,final int length,boolean immediateFlush){
  if (immediateFlush && byteBuffer.position() == 0) {
    writeToDestination(bytes,offset,length);
    flushDestination();
    return;
  }
  if (length >= byteBuffer.capacity()) {
    flush();
    writeToDestination(bytes,offset,length);
  }
 else {
    if (length > byteBuffer.remaining()) {
      flush();
    }
    byteBuffer.put(bytes,offset,length);
  }
  if (immediateFlush) {
    flush();
  }
}
Program: 90517
Project: 90517
Buggy source:
/** 
 * Creates a LogEventProxy that can be serialized.
 * @return a LogEventProxy.
 */
protected Object writeReplace(){
  getThrownProxy();
  return new Log4jLogEvent.LogEventProxy(this,this.includeLocation);
}

Fixed version (ground truth):
/** 
 * Creates a LogEventProxy that can be serialized.
 * @return a LogEventProxy.
 */
protected Object writeReplace(){
  return new Log4jLogEvent.LogEventProxy(this,this.includeLocation);
}
Program: 90518
Project: 90518
Buggy source:
@Test public void testAppendDoesNotOverwriteExistingFile() throws IOException {
  final boolean isAppend=true;
  final File file=folder.newFile();
  assertEquals(0,file.length());
  final byte[] bytes=new byte[4 * 1024];
  try (FileOutputStream fos=new FileOutputStream(file)){
    fos.write(bytes,0,bytes.length);
    fos.flush();
  }
   assertEquals("String_Node_Str",bytes.length,file.length());
  final RandomAccessFileManager manager=RandomAccessFileManager.getFileManager(file.getAbsolutePath(),isAppend,true,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null);
  manager.write(bytes,0,bytes.length,false);
  final int expected=bytes.length * 2;
  assertEquals("String_Node_Str",expected,file.length());
}

Fixed version (ground truth):
@Test public void testAppendDoesNotOverwriteExistingFile() throws IOException {
  final boolean isAppend=true;
  final File file=folder.newFile();
  assertEquals(0,file.length());
  final byte[] bytes=new byte[4 * 1024];
  try (FileOutputStream fos=new FileOutputStream(file)){
    fos.write(bytes,0,bytes.length);
    fos.flush();
  }
   assertEquals("String_Node_Str",bytes.length,file.length());
  final RandomAccessFileManager manager=RandomAccessFileManager.getFileManager(file.getAbsolutePath(),isAppend,true,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null);
  manager.write(bytes,0,bytes.length,true);
  final int expected=bytes.length * 2;
  assertEquals("String_Node_Str",expected,file.length());
}
Program: 90519
Project: 90519
Buggy source:
/** 
 * Test method for  {@link org.apache.logging.log4j.core.appender.RandomAccessFileManager#write(byte[],int,int)}.
 */
@Test public void testWrite_dataExceedingBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,false,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null,true);
    manager.setByteBufferDestination(manager.createByteBufferDestination(false));
    final int size=RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3 + 1;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3 + 1,raf.length());
    manager.flush();
    assertEquals(size,raf.length());
  }
 }

Fixed version (ground truth):
/** 
 * Test method for  {@link org.apache.logging.log4j.core.appender.RandomAccessFileManager#write(byte[],int,int)}.
 */
@Test public void testWrite_dataExceedingBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null,true);
    final int size=RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3 + 1;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3 + 1,raf.length());
    manager.flush();
    assertEquals(size,raf.length());
  }
 }
Program: 90520
Project: 90520
Buggy source:
/** 
 * Test method for  {@link org.apache.logging.log4j.core.appender.RandomAccessFileManager#write(byte[],int,int)}.
 */
@Test public void testWrite_multiplesOfBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,false,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null,true);
    manager.setByteBufferDestination(manager.createByteBufferDestination(false));
    final int size=RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3,raf.length());
  }
 }

Fixed version (ground truth):
/** 
 * Test method for  {@link org.apache.logging.log4j.core.appender.RandomAccessFileManager#write(byte[],int,int)}.
 */
@Test public void testWrite_multiplesOfBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,RandomAccessFileManager.DEFAULT_BUFFER_SIZE,null,null,true);
    final int size=RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3,raf.length());
  }
 }
Program: 90521
Project: 90521
Buggy source:
@Test public void testWrite_dataExceedingMinBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final int bufferSize=1;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,false,bufferSize,null,null,true);
    manager.setByteBufferDestination(manager.createByteBufferDestination(false));
    final int size=bufferSize * 3 + 1;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(bufferSize * 3 + 1,raf.length());
    manager.flush();
    assertEquals(size,raf.length());
  }
 }

Fixed version (ground truth):
@Test public void testWrite_dataExceedingMinBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final int bufferSize=1;
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,bufferSize,null,null,true);
    final int size=bufferSize * 3 + 1;
    final byte[] data=new byte[size];
    manager.write(data);
    assertEquals(bufferSize * 3 + 1,raf.length());
    manager.flush();
    assertEquals(size,raf.length());
  }
 }
Program: 90522
Project: 90522
Buggy source:
@Test public void testConfigurableBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final int bufferSize=4 * 1024;
    assertNotEquals(bufferSize,RandomAccessFileManager.DEFAULT_BUFFER_SIZE);
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,false,bufferSize,null,null,true);
    assertEquals(bufferSize,manager.getBufferSize());
  }
 }

Fixed version (ground truth):
@Test public void testConfigurableBufferSize() throws IOException {
  final File file=folder.newFile();
  try (final RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str")){
    final OutputStream os=NullOutputStream.NULL_OUTPUT_STREAM;
    final int bufferSize=4 * 1024;
    assertNotEquals(bufferSize,RandomAccessFileManager.DEFAULT_BUFFER_SIZE);
    final RandomAccessFileManager manager=new RandomAccessFileManager(raf,file.getName(),os,bufferSize,null,null,true);
    assertEquals(bufferSize,manager.getBufferSize());
  }
 }