nus-yam/ex-repair huggingface dataset:
Program: 36393
Project: 36393
Buggy source:
@Override public boolean isValid(Principal principal,Object credential,Subject activeSubject){
  DomainInfo cachedEntry=getCacheInfo(principal);
  PicketBoxLogger.LOGGER.traceBeginIsValid(principal,cachedEntry != null ? cachedEntry.toString() : null);
  boolean isValid=false;
  if (cachedEntry != null) {
    isValid=validateCache(cachedEntry,credential,activeSubject);
  }
  if (!isValid)   isValid=authenticate(principal,credential,activeSubject);
  PicketBoxLogger.LOGGER.traceEndIsValid(isValid);
  return isValid;
}

Fixed version (ground truth):
@Override public boolean isValid(Principal principal,Object credential,Subject activeSubject){
  DomainInfo cachedEntry=getCacheInfo(principal != null ? principal : new org.jboss.security.SimplePrincipal("String_Node_Str"));
  PicketBoxLogger.LOGGER.traceBeginIsValid(principal,cachedEntry != null ? cachedEntry.toString() : null);
  boolean isValid=false;
  if (cachedEntry != null) {
    isValid=validateCache(cachedEntry,credential,activeSubject);
  }
  if (!isValid)   isValid=authenticate(principal,credential,activeSubject);
  PicketBoxLogger.LOGGER.traceEndIsValid(isValid);
  return isValid;
}
Program: 36395
Project: 36395
Buggy source:
/** 
 * Test {CLASS}org.jboss.security.plugins.FilePassword
 * @throws Exception
 */
public void testFilePassword() throws Exception {
  String passwordCmd="String_Node_Str";
  passwordCmd=StringPropertyReplacer.replaceProperties(passwordCmd);
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}

Fixed version (ground truth):
/** 
 * Test {CLASS}org.jboss.security.plugins.FilePassword
 * @throws Exception
 */
public void testFilePassword() throws Exception {
  String passwordCmd="String_Node_Str";
  passwordCmd=StringPropertyReplacer.replaceProperties(passwordCmd);
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}
Program: 36396
Project: 36396
Buggy source:
/** 
 * Test {EXT}org.jboss.test.security.helpers.ExecPasswordCmd
 * @throws Exception
 */
public void testExtPassword() throws Exception {
  String passwordCmd=buildExtCommand("String_Node_Str");
  log.info("String_Node_Str" + passwordCmd);
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}

Fixed version (ground truth):
/** 
 * Test {EXT}org.jboss.test.security.helpers.ExecPasswordCmd
 * @throws Exception
 */
public void testExtPassword() throws Exception {
  String passwordCmd=buildExtCommand("String_Node_Str");
  log.info("String_Node_Str" + passwordCmd);
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}
Program: 36397
Project: 36397
Buggy source:
/** 
 * Test {CMD}org.jboss.test.security.helpers.ExecPasswordCmd
 * @throws Exception
 */
public void testCmdPassword() throws Exception {
  String passwordCmd=buildExtCommand("String_Node_Str",',');
  log.info("String_Node_Str" + passwordCmd);
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  String passwordCmdWithParam=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithParam);
  password=Util.loadPassword(passwordCmdWithParam);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  passwordCmdWithParam=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithParam);
  password=Util.loadPassword(passwordCmdWithParam);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  String passwordCmdWithTwoParams=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithTwoParams);
  password=Util.loadPassword(passwordCmdWithTwoParams);
  assertTrue("String_Node_Str",Arrays.equals(new String(password).substring(0,"String_Node_Str".length()).toCharArray(),"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",new String(password).substring("String_Node_Str".length()).matches("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test {CMD}org.jboss.test.security.helpers.ExecPasswordCmd
 * @throws Exception
 */
public void testCmdPassword() throws Exception {
  String passwordCmd=buildExtCommand("String_Node_Str",',');
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  log.info("String_Node_Str" + passwordCmd);
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  String passwordCmdWithParam=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithParam);
  password=Util.loadPassword(passwordCmdWithParam);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  passwordCmdWithParam=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithParam);
  password=Util.loadPassword(passwordCmdWithParam);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  String passwordCmdWithTwoParams=passwordCmd + "String_Node_Str";
  log.info("String_Node_Str" + passwordCmdWithTwoParams);
  password=Util.loadPassword(passwordCmdWithTwoParams);
  assertTrue("String_Node_Str",Arrays.equals(new String(password).substring(0,"String_Node_Str".length()).toCharArray(),"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",new String(password).substring("String_Node_Str".length()).matches("String_Node_Str"));
}
Program: 36398
Project: 36398
Buggy source:
/** 
 * Test {CLASS}org.jboss.security.plugins.TmpFilePassword
 * @throws Exception
 */
public void testTmpFilePassword() throws Exception {
  String passwordCmd="String_Node_Str";
  passwordCmd=StringPropertyReplacer.replaceProperties(passwordCmd);
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}

Fixed version (ground truth):
/** 
 * Test {CLASS}org.jboss.security.plugins.TmpFilePassword
 * @throws Exception
 */
public void testTmpFilePassword() throws Exception {
  String passwordCmd="String_Node_Str";
  passwordCmd=StringPropertyReplacer.replaceProperties(passwordCmd);
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  char[] password=Util.loadPassword(passwordCmd);
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
}
Program: 36399
Project: 36399
Buggy source:
public void testExtPasswordCache() throws Exception {
  ExternalPasswordCache.getExternalPasswordCacheInstance().reset();
  String passwordCmd=buildExtCommand("String_Node_Str");
  char[] password=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  char[] cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 1);
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
}

Fixed version (ground truth):
public void testExtPasswordCache() throws Exception {
  ExternalPasswordCache.getExternalPasswordCacheInstance().reset();
  String passwordCmd=buildExtCommand("String_Node_Str");
  char[] password=Util.loadPassword(passwordCmd + "String_Node_Str");
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  char[] cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(password,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 1);
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
  cachedPassword=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(cachedPassword,"String_Node_Str".toCharArray()));
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
}
Program: 36400
Project: 36400
Buggy source:
public void testExtPasswordCacheTimeOut() throws Exception {
  ExternalPasswordCache.getExternalPasswordCacheInstance().reset();
  final String TO="String_Node_Str";
  String passwordCmd=buildExtCommand("String_Node_Str" + TO);
  char[] password4=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str" + TO,Arrays.equals(new String(password4).substring(0,9).toCharArray(),"String_Node_Str".toCharArray()));
  char[] cachedPassword4_2=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str" + TO + "String_Node_Str",Arrays.equals(password4,cachedPassword4_2));
  long WAIT=800;
  Thread.sleep(WAIT);
  char[] cachedPassword4_3=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertFalse("String_Node_Str" + TO + "String_Node_Str"+ WAIT,Arrays.equals(password4,cachedPassword4_3));
  char[] cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(new String(cachedPassword5).substring(0,9).toCharArray(),"String_Node_Str".toCharArray()));
  cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
  cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
}

Fixed version (ground truth):
public void testExtPasswordCacheTimeOut() throws Exception {
  ExternalPasswordCache.getExternalPasswordCacheInstance().reset();
  final String TO="String_Node_Str";
  String passwordCmd=buildExtCommand("String_Node_Str" + TO);
  if (!Util.isPasswordCommand(passwordCmd)) {
    fail(passwordCmd + "String_Node_Str");
  }
  char[] password4=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str" + TO,Arrays.equals(new String(password4).substring(0,9).toCharArray(),"String_Node_Str".toCharArray()));
  char[] cachedPassword4_2=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str" + TO + "String_Node_Str",Arrays.equals(password4,cachedPassword4_2));
  long WAIT=800;
  Thread.sleep(WAIT);
  char[] cachedPassword4_3=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertFalse("String_Node_Str" + TO + "String_Node_Str"+ WAIT,Arrays.equals(password4,cachedPassword4_3));
  char[] cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(new String(cachedPassword5).substring(0,9).toCharArray(),"String_Node_Str".toCharArray()));
  cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
  cachedPassword5=Util.loadPassword(passwordCmd + "String_Node_Str");
  assertTrue("String_Node_Str",ExternalPasswordCache.getExternalPasswordCacheInstance().getCachedPasswordsCount() == 2);
}
Program: 36401
Project: 36401
Buggy source:
/** 
 * @see SubjectFactory#createSubject(String)
 */
public Subject createSubject(String securityDomainName){
  if (securityManagement == null) {
    log.warn("String_Node_Str");
    securityManagement=new DefaultSecurityManagement(new JBossCallbackHandler());
  }
  Subject subject=new Subject();
  Principal principal=SubjectActions.getPrincipal();
  AuthenticationManager authenticationManager=securityManagement.getAuthenticationManager(securityDomainName);
  if (authenticationManager == null) {
    String defaultSecurityDomain=SecurityConstants.DEFAULT_APPLICATION_POLICY;
    if (log.isTraceEnabled()) {
      log.trace("String_Node_Str" + securityDomainName + "String_Node_Str"+ defaultSecurityDomain);
    }
    authenticationManager=securityManagement.getAuthenticationManager(defaultSecurityDomain);
  }
  if (authenticationManager.isValid(principal,SubjectActions.getCredential(),subject) == false)   throw new SecurityException("String_Node_Str" + principal);
  return subject;
}

Fixed version (ground truth):
/** 
 * @see SubjectFactory#createSubject(String)
 */
public Subject createSubject(String securityDomainName){
  if (securityManagement == null) {
    log.warn("String_Node_Str");
    securityManagement=new DefaultSecurityManagement(new JBossCallbackHandler());
  }
  Subject subject=new Subject();
  Principal principal=SubjectActions.getPrincipal();
  AuthenticationManager authenticationManager=securityManagement.getAuthenticationManager(securityDomainName);
  if (authenticationManager == null) {
    String defaultSecurityDomain=SecurityConstants.DEFAULT_APPLICATION_POLICY;
    if (log.isTraceEnabled()) {
      log.trace("String_Node_Str" + securityDomainName + "String_Node_Str"+ defaultSecurityDomain);
    }
    authenticationManager=securityManagement.getAuthenticationManager(defaultSecurityDomain);
  }
  ClassLoader tccl=SubjectActions.getContextClassLoader();
  try {
    SubjectActions.setContextClassLoader(this.getClass().getClassLoader());
    if (!authenticationManager.isValid(principal,SubjectActions.getCredential(),subject))     throw new SecurityException("String_Node_Str" + principal);
  }
  finally {
    SubjectActions.setContextClassLoader(tccl);
  }
  return subject;
}
Program: 36402
Project: 36402
Buggy source:
public RiftApp(){
  super();
  Hmd.initialize();
  try {
    Thread.sleep(100);
  }
 catch (  InterruptedException e) {
    throw new IllegalStateException(e);
  }
  hmd=openFirstHmd();
  if (null == hmd) {
    throw new IllegalStateException("String_Node_Str");
  }
  hmdDesc=hmd.getDesc();
  if (0 == hmd.startSensor(ovrSensorCap_Orientation,0)) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (int eye=0; eye < 2; ++eye) {
    fovPorts[eye]=hmdDesc.DefaultEyeFov[eye];
    projections[eye]=RiftUtils.toMatrix4f(Hmd.getPerspectiveProjection(fovPorts[eye],0.1f,1000000f,true));
    Texture texture=eyeTextures[eye]=new Texture();
    TextureHeader header=texture.Header;
    header.TextureSize=hmd.getFovTextureSize(eye,fovPorts[eye],1.0f);
    header.RenderViewport.Size=header.TextureSize;
    header.RenderViewport.Pos=new OvrVector2i(0,0);
  }
}

Fixed version (ground truth):
public RiftApp(){
  super();
  Hmd.initialize();
  try {
    Thread.sleep(400);
  }
 catch (  InterruptedException e) {
    throw new IllegalStateException(e);
  }
  hmd=openFirstHmd();
  if (null == hmd) {
    throw new IllegalStateException("String_Node_Str");
  }
  hmdDesc=hmd.getDesc();
  if (0 == hmd.startSensor(ovrSensorCap_Orientation,0)) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (int eye=0; eye < 2; ++eye) {
    fovPorts[eye]=hmdDesc.DefaultEyeFov[eye];
    projections[eye]=RiftUtils.toMatrix4f(Hmd.getPerspectiveProjection(fovPorts[eye],0.1f,1000000f,true));
    Texture texture=eyeTextures[eye]=new Texture();
    TextureHeader header=texture.Header;
    header.TextureSize=hmd.getFovTextureSize(eye,fovPorts[eye],1.0f);
    header.RenderViewport.Size=header.TextureSize;
    header.RenderViewport.Pos=new OvrVector2i(0,0);
  }
}
Program: 36403
Project: 36403
Buggy source:
@Override public void prepare(Map stormConf,TopologyContext context){
}

Fixed version (ground truth):
@Override public void prepare(Map stormConf,TopologyContext context){
  pattern=Pattern.compile(ptnString);
}
Program: 36404
Project: 36404
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  options.put(PATTERN_STRING,ptnString);
  super.parseOptions(options);
  spoutNum=BenchmarkUtils.getInt(options,SPOUT_NUM,spoutNum);
  matBoltNum=BenchmarkUtils.getInt(options,FM_NUM,matBoltNum);
  cntBoltNum=BenchmarkUtils.getInt(options,CM_NUM,cntBoltNum);
  spout=new KafkaSpout(KafkaUtils.getSpoutConfig(options,new SchemeAsMultiScheme(new StringScheme())));
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  spoutNum=BenchmarkUtils.getInt(options,SPOUT_NUM,spoutNum);
  matBoltNum=BenchmarkUtils.getInt(options,FM_NUM,matBoltNum);
  cntBoltNum=BenchmarkUtils.getInt(options,CM_NUM,cntBoltNum);
  ptnString=(String)Utils.get(options,PATTERN_STRING,ptnString);
  spout=new KafkaSpout(KafkaUtils.getSpoutConfig(options,new SchemeAsMultiScheme(new StringScheme())));
  return this;
}
Program: 36405
Project: 36405
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  String server=(String)options.get(SERVER);
  if (null == server) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Integer port=(Integer)options.get(PORT);
  if (null == port) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  kafkaConfig=KafkaUtils.getTridentKafkaConfig(options,new SchemeAsMultiScheme(new StringScheme()));
  metrics=new DRPCMetrics(FUNCTION,ARGS,server,port);
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  String server=(String)options.get(SERVER);
  if (null == server) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Integer port=(Integer)options.get(PORT);
  if (null == port) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  spout=new TransactionalTridentKafkaSpout(KafkaUtils.getTridentKafkaConfig(options,new SchemeAsMultiScheme(new StringScheme())));
  metrics=new DRPCMetrics(FUNCTION,ARGS,server,port);
  return this;
}
Program: 36406
Project: 36406
Buggy source:
@Override public IBenchmark buildTopology(){
  TridentTopology trident=new TridentTopology();
  TransactionalTridentKafkaSpout kafkaSpout=new TransactionalTridentKafkaSpout(kafkaConfig);
  TridentState state=trident.newStream(kafkaConfig.clientId,kafkaSpout).shuffle().each(new Fields("String_Node_Str"),new Extract(Arrays.asList(Item.URL)),new Fields("String_Node_Str")).groupBy(new Fields("String_Node_Str")).persistentAggregate(new MemoryMapState.Factory(),new Count(),new Fields("String_Node_Str"));
  trident.newDRPCStream(FUNCTION,null).stateQuery(state,new Fields("String_Node_Str"),new MapGet(),new Fields("String_Node_Str"));
  topology=trident.build();
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark buildTopology(){
  TridentTopology trident=new TridentTopology();
  TridentState state=trident.newStream("String_Node_Str",spout).shuffle().each(new Fields(StringScheme.STRING_SCHEME_KEY),new Extract(Arrays.asList(Item.URL)),new Fields("String_Node_Str")).groupBy(new Fields("String_Node_Str")).persistentAggregate(new MemoryMapState.Factory(),new Count(),new Fields("String_Node_Str"));
  trident.newDRPCStream(FUNCTION,null).stateQuery(state,new Fields("String_Node_Str"),new MapGet(),new Fields("String_Node_Str"));
  topology=trident.build();
  return this;
}
Program: 36407
Project: 36407
Buggy source:
void writeHeader(PrintWriter writer){
  writer.println(Utils.join(header,"String_Node_Str"));
  writer.flush();
}

Fixed version (ground truth):
void writeHeader(PrintWriter writer){
  LOG.info("String_Node_Str");
  writer.println(Utils.join(header,"String_Node_Str"));
  writer.flush();
}
Program: 36409
Project: 36409
Buggy source:
@Override public IMetrics setConfig(BenchmarkConfig benchConfig){
  config=benchConfig.getStormConfig();
  topoName=benchConfig.getTopologyName();
  pollInterval=BenchmarkUtils.getInt(config,METRICS_POLL_FREQ,DEFAULT_POLL_INTERVAL);
  totalTime=BenchmarkUtils.getInt(config,METRICS_TOTAL_TIME,DEFAULT_TOTAL_TIME);
  msgSize=BenchmarkUtils.getInt(config,BenchmarkConfig.MESSAGE_SIZE,DEFAULT_MESSAGE_SIZE);
  path=(String)Utils.get(config,METRICS_PATH,DEFAULT_PATH);
  return this;
}

Fixed version (ground truth):
@Override public IMetrics setConfig(BenchmarkConfig benchConfig){
  config=Utils.readStormConfig();
  topoName=(String)Utils.get(config,Config.TOPOLOGY_NAME,BenchmarkConfig.DEFAULT_TOPOLOGY_NAME);
  pollInterval=BenchmarkUtils.getInt(config,METRICS_POLL_FREQ,DEFAULT_POLL_INTERVAL);
  totalTime=BenchmarkUtils.getInt(config,METRICS_TOTAL_TIME,DEFAULT_TOTAL_TIME);
  msgSize=BenchmarkUtils.getInt(config,BenchmarkConfig.MESSAGE_SIZE,DEFAULT_MESSAGE_SIZE);
  path=(String)Utils.get(config,METRICS_PATH,DEFAULT_PATH);
  return this;
}
Program: 36410
Project: 36410
Buggy source:
boolean pollNimbus(Nimbus.Client client,long now,MetricsState state,PrintWriter writer) throws Exception {
  ClusterSummary cs=client.getClusterInfo();
  if (null == cs) {
    return false;
  }
  updateSupervisorStats(cs);
  TopologySummary ts=MetricsUtils.getTopologySummary(cs,topoName);
  if (null == ts) {
    throw new RuntimeException("String_Node_Str" + topoName);
  }
  updateTopologyStats(ts,state,now);
  TopologyInfo info=client.getTopologyInfo(ts.get_id());
  boolean firstTime=now == state.startTime;
  updateExecutorStats(info,state,now,firstTime);
  if (firstTime) {
    writeHeader(writer);
  }
  writeLine(writer);
  state.lastTime=now;
  return true;
}

Fixed version (ground truth):
boolean pollNimbus(Nimbus.Client client,long now,MetricsState state,PrintWriter writer) throws Exception {
  ClusterSummary cs=client.getClusterInfo();
  if (null == cs) {
    LOG.error("String_Node_Str");
    return false;
  }
  updateSupervisorStats(cs);
  TopologySummary ts=MetricsUtils.getTopologySummary(cs,topoName);
  if (null == ts) {
    LOG.error("String_Node_Str" + topoName);
    return false;
  }
  updateTopologyStats(ts,state,now);
  TopologyInfo info=client.getTopologyInfo(ts.get_id());
  boolean firstTime=(now == state.startTime);
  updateExecutorStats(info,state,now,firstTime);
  if (firstTime) {
    writeHeader(writer);
  }
  writeLine(writer);
  state.lastTime=now;
  return true;
}
Program: 36411
Project: 36411
Buggy source:
public Nimbus.Client getNimbusClient(){
  Map clusterConf=Utils.readStormConfig();
  clusterConf.putAll(config);
  return NimbusClient.getConfiguredClient(clusterConf).getClient();
}

Fixed version (ground truth):
public Nimbus.Client getNimbusClient(){
  return NimbusClient.getConfiguredClient(config).getClient();
}
Program: 36412
Project: 36412
Buggy source:
public void writeStormConfig(PrintWriter writer){
  if (writer != null) {
    for (    Object key : config.keySet()) {
      writer.println(key + "String_Node_Str" + config.get(key));
    }
    writer.flush();
  }
}

Fixed version (ground truth):
public void writeStormConfig(PrintWriter writer){
  LOG.info("String_Node_Str");
  if (writer != null) {
    Map sorted=new TreeMap();
    sorted.putAll(config);
    for (    Object key : sorted.keySet()) {
      writer.println(key + "String_Node_Str" + config.get(key));
    }
    writer.flush();
  }
}
Program: 36413
Project: 36413
Buggy source:
void writeLine(PrintWriter writer){
  List<String> line=new LinkedList<String>();
  for (  String h : header) {
    line.add(metrics.get(h));
  }
  writer.println(Utils.join(line,"String_Node_Str"));
  writer.flush();
}

Fixed version (ground truth):
void writeLine(PrintWriter writer){
  LOG.info("String_Node_Str");
  List<String> line=new LinkedList<String>();
  for (  String h : header) {
    line.add(metrics.get(h));
  }
  writer.println(Utils.join(line,"String_Node_Str"));
  writer.flush();
}
Program: 36414
Project: 36414
Buggy source:
boolean isBatchStream(String id){
  return id.equals("String_Node_Str");
}

Fixed version (ground truth):
boolean isBatchStream(String stream){
  return stream.equals("String_Node_Str");
}
Program: 36415
Project: 36415
Buggy source:
boolean isDefaultStream(String id){
  return id.equals(Utils.DEFAULT_STREAM_ID);
}

Fixed version (ground truth):
boolean isDefaultStream(String stream){
  return stream.equals(Utils.DEFAULT_STREAM_ID);
}
Program: 36416
Project: 36416
Buggy source:
void writeHeader(PrintWriter writer){
  LOG.info("String_Node_Str");
  writer.println(Utils.join(header,"String_Node_Str"));
  writer.flush();
}

Fixed version (ground truth):
void writeHeader(PrintWriter writer){
  header.add(TIME);
  header.add(TOTAl_SLOTS);
  header.add(USED_SLOTS);
  header.add(WORKERS);
  header.add(TASKS);
  header.add(EXECUTORS);
  header.add(EXECUTORS_METRICS);
  header.add(TRANSFERRED);
  header.add(THROUGHPUT);
  header.add(THROUGHPUT_MB);
  header.add(SPOUT_EXECUTORS);
  header.add(SPOUT_TRANSFERRED);
  header.add(SPOUT_ACKED);
  header.add(SPOUT_THROUGHPUT);
  header.add(SPOUT_THROUGHPUT_MB);
  header.add(String.format(SPOUT_AVG_LATENCY_FORMAT,"String_Node_Str"));
  header.add(String.format(SPOUT_MAX_LATENCY_FORMAT,"String_Node_Str"));
  LOG.info("String_Node_Str");
  writer.println(Utils.join(header,"String_Node_Str"));
  writer.flush();
}
Program: 36417
Project: 36417
Buggy source:
@Override public IMetrics start(){
  long now=System.currentTimeMillis();
  long endTime=now + totalTime;
  MetricsState state=new MetricsState();
  state.startTime=now;
  state.lastTime=now;
  final String confFile=String.format(METRICS_CONF_FORMAT,path,topoName,now);
  final String dataFile=String.format(METRICS_FILE_FORMAT,path,topoName,now);
  PrintWriter confWriter=FileUtils.createFileWriter(path,confFile);
  PrintWriter dataWriter=FileUtils.createFileWriter(path,dataFile);
  writeStormConfig(confWriter);
  addHeaders();
  Nimbus.Client client=getNimbusClient();
  try {
    boolean live=true;
    while (live && now < endTime) {
      live=pollNimbus(client,now,state,dataWriter);
      Utils.sleep(pollInterval);
      now=System.currentTimeMillis();
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    dataWriter.close();
    confWriter.close();
  }
  return this;
}

Fixed version (ground truth):
@Override public IMetrics start(){
  long now=System.currentTimeMillis();
  long endTime=now + totalTime;
  MetricsState state=new MetricsState();
  state.startTime=now;
  state.lastTime=now;
  final String confFile=String.format(METRICS_CONF_FORMAT,path,topoName,now);
  final String dataFile=String.format(METRICS_FILE_FORMAT,path,topoName,now);
  PrintWriter confWriter=FileUtils.createFileWriter(path,confFile);
  PrintWriter dataWriter=FileUtils.createFileWriter(path,dataFile);
  writeStormConfig(confWriter);
  writeHeader(dataWriter);
  try {
    boolean live=true;
    while (live && now < endTime) {
      live=pollNimbus(getNimbusClient(),now,state,dataWriter);
      Utils.sleep(pollInterval);
      now=System.currentTimeMillis();
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    dataWriter.close();
    confWriter.close();
  }
  return this;
}
Program: 36419
Project: 36419
Buggy source:
boolean pollNimbus(Nimbus.Client client,long now,MetricsState state,PrintWriter writer) throws Exception {
  ClusterSummary cs=client.getClusterInfo();
  if (null == cs) {
    LOG.error("String_Node_Str");
    return false;
  }
  updateSupervisorStats(cs);
  TopologySummary ts=MetricsUtils.getTopologySummary(cs,topoName);
  if (null == ts) {
    LOG.error("String_Node_Str" + topoName);
    return false;
  }
  updateTopologyStats(ts,state,now);
  TopologyInfo info=client.getTopologyInfo(ts.get_id());
  boolean firstTime=(now == state.startTime);
  updateExecutorStats(info,state,now,firstTime);
  if (firstTime) {
    writeHeader(writer);
  }
  writeLine(writer);
  state.lastTime=now;
  return true;
}

Fixed version (ground truth):
boolean pollNimbus(Nimbus.Client client,long now,MetricsState state,PrintWriter writer) throws Exception {
  ClusterSummary cs=client.getClusterInfo();
  if (null == cs) {
    LOG.error("String_Node_Str");
    return false;
  }
  updateSupervisorStats(cs);
  TopologySummary ts=MetricsUtils.getTopologySummary(cs,topoName);
  if (null == ts) {
    LOG.error("String_Node_Str" + topoName);
    return false;
  }
  updateTopologyStats(ts,state,now);
  TopologyInfo info=client.getTopologyInfo(ts.get_id());
  updateExecutorStats(info,state,now);
  writeLine(writer);
  state.lastTime=now;
  return true;
}
Program: 36420
Project: 36420
Buggy source:
@Override public StormMetrics start(){
  long now=System.currentTimeMillis();
  final long endTime=now + totalTime;
  long totalLat=0L;
  int count=0;
  try {
    final String confFile=String.format(METRICS_CONF_FORMAT,path,topoName,now);
    final String dataFile=String.format(METRICS_FILE_FORMAT,path,topoName,now);
    PrintWriter confWriter=FileUtils.createFileWriter(path,confFile);
    PrintWriter dataWriter=FileUtils.createFileWriter(path,dataFile);
    writeConf(confWriter);
    while (now < endTime) {
      Thread.sleep(pollInterval);
      long lat=execute(nextArg());
      dataWriter.println(String.format("String_Node_Str",lat));
      dataWriter.flush();
      totalLat+=lat;
      count++;
      now=System.currentTimeMillis();
    }
    long avgLat=0 == count ? 0L : totalLat / count;
    dataWriter.println(String.format("String_Node_Str",avgLat));
    dataWriter.close();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return this;
}

Fixed version (ground truth):
@Override public StormMetrics start(){
  long now=System.currentTimeMillis();
  final long endTime=now + totalTime;
  long totalLat=0L;
  int count=0;
  try {
    final String confFile=String.format(METRICS_CONF_FORMAT,path,topoName,now);
    final String dataFile=String.format(METRICS_FILE_FORMAT,path,topoName,now);
    PrintWriter confWriter=FileUtils.createFileWriter(path,confFile);
    PrintWriter dataWriter=FileUtils.createFileWriter(path,dataFile);
    writeStormConfig(confWriter);
    while (now < endTime) {
      Thread.sleep(pollInterval);
      long lat=execute(nextArg(),dataWriter);
      totalLat+=lat;
      count++;
      now=System.currentTimeMillis();
    }
    double avgLat=0 == count ? 0.0 : (double)totalLat / count;
    dataWriter.println(String.format("String_Node_Str",avgLat));
    dataWriter.close();
  }
 catch (  DRPCExecutionException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  TException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    LOG.error("String_Node_Str",e);
  }
  return this;
}
Program: 36421
Project: 36421
Buggy source:
private long execute(String arg) throws Exception {
  DRPCClient client=new DRPCClient(server,port);
  long start=System.currentTimeMillis();
  String result=client.execute(function,arg);
  long end=System.currentTimeMillis();
  LOG.info(String.format("String_Node_Str",function,arg,result));
  return end - start;
}

Fixed version (ground truth):
private long execute(String arg,PrintWriter writer) throws TException, DRPCExecutionException {
  LOG.debug(String.format("String_Node_Str",function,arg));
  DRPCClient client=new DRPCClient(server,port);
  long start=System.currentTimeMillis();
  String result=client.execute(function,arg);
  long end=System.currentTimeMillis();
  long latency=end - start;
  writer.println(String.format("String_Node_Str",function,arg,result,latency));
  writer.flush();
  return latency;
}
Program: 36422
Project: 36422
Buggy source:
public static PageView fromString(String s){
  LOG.debug("String_Node_Str" + s + "String_Node_Str");
  String[] parts=s.split("String_Node_Str");
  if (parts.length < 4) {
    return null;
  }
  return new PageView(parts[0],Integer.parseInt(parts[1]),Integer.parseInt(parts[2]),Integer.parseInt(parts[3]));
}

Fixed version (ground truth):
public static PageView fromString(String pv){
  LOG.debug("String_Node_Str" + pv + "String_Node_Str");
  String[] parts=pv.split("String_Node_Str");
  if (parts.length < 4) {
    return null;
  }
  for (int i=0; i < parts.length; i++) {
    parts[i]=parts[i].trim();
  }
  return new PageView(parts[0],Integer.parseInt(parts[1]),Integer.parseInt(parts[2]),Integer.parseInt(parts[3]));
}
Program: 36423
Project: 36423
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  String server=(String)options.get(SERVER);
  if (null == server) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Integer port=(Integer)options.get(PORT);
  if (null == port) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  spout=new TransactionalTridentKafkaSpout(KafkaUtils.getTridentKafkaConfig(options,new SchemeAsMultiScheme(new StringScheme())));
  metrics=new DRPCMetrics(FUNCTION,ARGS,server,port);
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  String server=(String)options.get(SERVER);
  if (null == server) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Integer port=(Integer)options.get(PORT);
  if (null == port) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  spoutNum=BenchmarkUtils.getInt(options,SPOUT_NUM,spoutNum);
  pageNum=BenchmarkUtils.getInt(options,PAGE_NUM,pageNum);
  viewNum=BenchmarkUtils.getInt(options,VIEW_NUM,viewNum);
  spout=new TransactionalTridentKafkaSpout(KafkaUtils.getTridentKafkaConfig(options,new SchemeAsMultiScheme(new StringScheme())));
  metrics=new DRPCMetrics(FUNCTION,ARGS,server,port);
  return this;
}
Program: 36424
Project: 36424
Buggy source:
@Override public IBenchmark buildTopology(){
  TridentTopology trident=new TridentTopology();
  TridentState state=trident.newStream("String_Node_Str",spout).shuffle().each(new Fields(StringScheme.STRING_SCHEME_KEY),new Extract(Arrays.asList(Item.URL)),new Fields("String_Node_Str")).groupBy(new Fields("String_Node_Str")).persistentAggregate(new MemoryMapState.Factory(),new Count(),new Fields("String_Node_Str"));
  trident.newDRPCStream(FUNCTION,null).stateQuery(state,new Fields("String_Node_Str"),new MapGet(),new Fields("String_Node_Str"));
  topology=trident.build();
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark buildTopology(){
  TridentTopology trident=new TridentTopology();
  TridentState state=trident.newStream("String_Node_Str",spout).parallelismHint(spoutNum).shuffle().each(new Fields(StringScheme.STRING_SCHEME_KEY),new Extract(Arrays.asList(Item.URL)),new Fields("String_Node_Str")).parallelismHint(pageNum).groupBy(new Fields("String_Node_Str")).persistentAggregate(new MemoryMapState.Factory(),new Count(),new Fields("String_Node_Str")).parallelismHint(viewNum);
  trident.newDRPCStream(FUNCTION,null).stateQuery(state,new Fields("String_Node_Str"),new MapGet(),new Fields("String_Node_Str"));
  topology=trident.build();
  return this;
}
Program: 36425
Project: 36425
Buggy source:
@Test public void testFromString(){
  String pvString="String_Node_Str";
  PageView pageView=PageView.fromString(pvString);
  assertThat(pageView.url).isEqualTo("String_Node_Str");
  assertThat(pageView.status).isEqualTo(200);
  assertThat(pageView.zipCode).isEqualTo(100000);
  assertThat(pageView.userID).isEqualTo(1);
}

Fixed version (ground truth):
@Test public void testFromString(){
  String pvString="String_Node_Str";
  PageView pageView=PageView.fromString(pvString);
  assertThat(pageView.url).isEqualTo("String_Node_Str");
  assertThat(pageView.status).isEqualTo(200);
  assertThat(pageView.zipCode).isEqualTo(100000);
  assertThat(pageView.userID).isEqualTo(1);
  assertThat(pageView.toString()).isEqualTo(pvString);
}
Program: 36426
Project: 36426
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  spout=new KafkaFileReadSpout(FILE,partitions);
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  spout=new KafkaFileReadSpout(FILE);
  return this;
}
Program: 36427
Project: 36427
Buggy source:
public KafkaFileReadSpout(String file,int partitions){
  super(partitions);
  this.reader=new FileReader(file);
}

Fixed version (ground truth):
public KafkaFileReadSpout(String file){
  this.reader=new FileReader(file);
}
Program: 36428
Project: 36428
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  spout=new KafkaPageViewSpout(partitions);
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  spout=new KafkaPageViewSpout();
  return this;
}
Program: 36429
Project: 36429
Buggy source:
public KafkaPageViewSpout(int partitions){
  super(partitions);
  this.generator=new PageViewGenerator();
}

Fixed version (ground truth):
public KafkaPageViewSpout(){
  super();
  this.generator=new PageViewGenerator();
}
Program: 36430
Project: 36430
Buggy source:
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  Map stormConfig=config.getStormConfig();
  stormConfig.putAll(getKafkaConfig(options));
  spoutNum=Util.retIfPositive(spoutNum,(Integer)options.get(SPOUT));
  boltNum=Util.retIfPositive(boltNum,(Integer)options.get(BOLT));
  partitions=Util.retIfPositive(partitions,(Integer)options.get(PARTITIONS));
  metrics=new BasicMetrics();
  return this;
}

Fixed version (ground truth):
@Override public IBenchmark parseOptions(Map options){
  super.parseOptions(options);
  Map stormConfig=config.getStormConfig();
  stormConfig.putAll(getKafkaConfig(options));
  spoutNum=Util.retIfPositive(spoutNum,(Integer)options.get(SPOUT));
  boltNum=Util.retIfPositive(boltNum,(Integer)options.get(BOLT));
  metrics=new BasicMetrics();
  return this;
}
Program: 36431
Project: 36431
Buggy source:
public KafkaProducerSpout(int partitions){
  this.partitions=Util.retIfPositive(1,partitions);
}

Fixed version (ground truth):
public KafkaProducerSpout(){
  random=new Random();
}
Program: 36432
Project: 36432
Buggy source:
protected void nextMessage(String message){
  if (index >= partitions) {
    index=0;
  }
  collector.emit(new Values(index + "String_Node_Str",message));
  index++;
}

Fixed version (ground truth):
protected void nextMessage(String message){
  collector.emit(new Values(random.nextInt() + "String_Node_Str",message));
}
Program: 36433
Project: 36433
Buggy source:
@Override protected void processResponse(AngularResponse angularResponse){
}

Fixed version (ground truth):
@Override protected void processResponse(AngularResponse angularResponse){
  angularResponse.alert("String_Node_Str");
  TestObject ble=getModelObject();
  ble.getTest1();
}
Program: 36434
Project: 36434
Buggy source:
static Stage createFMNTStage(Screen screen,boolean show){
  Stage owner=new Stage(UTILITY);
  owner.setOpacity(0);
  owner.setWidth(5);
  owner.setHeight(5);
  owner.show();
  owner.setX(screen.getBounds().getMinX() + 1);
  owner.setY(screen.getBounds().getMinY() + 1);
  Stage s=new Stage(UNDECORATED);
  s.initOwner(owner);
  s.initModality(APPLICATION_MODAL);
  s.setAlwaysOnTop(true);
  if (show)   s.show();
  s.setX(screen.getBounds().getMinX());
  s.setY(screen.getBounds().getMinY());
  s.setWidth(screen.getBounds().getWidth());
  s.setHeight(screen.getBounds().getHeight());
  return s;
}

Fixed version (ground truth):
/** 
 * Create fullscreen modal no taskbar stage on given screen. The stage will have its owner, style and modality initialized and be prepared to be shown. <p/> Use: just set your scene on it and call show(). <p/> Easy way to get popup like behavior that: <ul> <li> is always fullscreen <li> is modal - does not lose focus and is always on top of other application windows <li> has no taskbar icon (for your information, javafx normally disallows this, but it is doable using owner stage with UTILITY style). </ul>
 */
static Stage createFMNTStage(Screen screen,boolean show){
  Stage owner=new Stage(UTILITY);
  owner.setOpacity(0);
  owner.setWidth(10);
  owner.setHeight(10);
  owner.show();
  owner.setAlwaysOnTop(true);
  owner.setX(screen.getBounds().getMinX() + 1);
  owner.setY(screen.getBounds().getMinY() + 1);
  Stage s=new Stage(UNDECORATED){
    @Override public void hide(){
      if (owner.isShowing()) {
        owner.hide();
      }
 else {
        super.hide();
      }
    }
  }
;
  s.initOwner(owner);
  s.setAlwaysOnTop(true);
  if (show)   s.show();
  s.setX(screen.getBounds().getMinX());
  s.setY(screen.getBounds().getMinY());
  s.setWidth(screen.getBounds().getWidth());
  s.setHeight(screen.getBounds().getHeight());
  return s;
}
Program: 36435
Project: 36435
Buggy source:
public ConfigurableField(Class<T> type,T value){
  this.type=type;
  this.value=value;
  p.onChange=() -> chain.onItemChange.accept(null);
  p.configure(lc.toConfigurable.apply(this.value));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public ConfigurableField(Class<T> type,T value){
  this.type=type;
  this.value=value;
  p.onChange=() -> chain.onItemChange.accept(null);
  p.configure((Configurable)lc.toConfigurable.apply(this.value));
}
Program: 36436
Project: 36436
Buggy source:
@Override public T getValue(){
  Class<T> oType=p.getConfigFields().get(0).config.getType();
  T o=p.getConfigFields().get(0).getValue();
  if (type == oType)   return o;
 else   return value;
}

Fixed version (ground truth):
@Override public T getValue(){
  Class<? extends T> oType=p.getConfigFields().get(0).config.getType();
  T o=p.getConfigFields().get(0).getValue();
  if (type == oType)   return o;
 else   return value;
}
Program: 36437
Project: 36437
Buggy source:
private void buildChildren(){
  all_children=new HashSet<>();
  children=new HashSet<>();
  List<Item> files=new ArrayList<>();
  children_files().forEach(f -> {
    all_children.add(f.getPath().toLowerCase());
    FileType type=FileType.of(f);
    if (type == DIRECTORY) {
      children.add(createItem(this,f,type));
    }
 else {
      if (filterChildFile(f))       files.add(createItem(this,f,type));
    }
  }
);
  children.addAll(files);
}

Fixed version (ground truth):
private void buildChildren(){
  if (disposed)   return;
  Set<String> all=new HashSet<>();
  List<Item> dirs=new ArrayList<>();
  List<Item> files=new ArrayList<>();
  children_files().forEach(f -> {
    if (!disposed) {
      all.add(f.getPath().toLowerCase());
      FileType type=FileType.of(f);
      if (type == DIRECTORY) {
        dirs.add(createItem(this,f,type));
      }
 else {
        if (filterChildFile(f))         files.add(createItem(this,f,type));
      }
    }
  }
);
  if (!disposed) {
    children=new HashSet<>(dirs.size() + files.size());
    children.addAll(dirs);
    children.addAll(files);
    all_children=all;
  }
}
Program: 36438
Project: 36438
Buggy source:
private static boolean file_exists(Item c,File f){
  return c != null && f != null && c.all_children.contains(f.getPath().toLowerCase());
}

Fixed version (ground truth):
private static boolean file_exists(Item c,File f){
  return c != null && f != null && !c.disposed && c.all_children.contains(f.getPath().toLowerCase());
}
Program: 36439
Project: 36439
Buggy source:
public Try<LoadResult,Void> loadCover(boolean full,ImageSize size){
  throwIfFxThread();
  boolean wasCoverFile_loaded=coverFile_loaded;
  File file=getCoverFile();
  if (file == null) {
    if (!wasCoverFile_loaded && cover_file == null && (val.getPath().endsWith("String_Node_Str") || val.getPath().endsWith("String_Node_Str"))) {
      cover=IconExtractor.getFileIcon(val);
      cover_loadedFull.set(true);
      cover_loadedThumb.set(true);
      return Try.ok(new LoadResult(false,null,cover));
    }
  }
 else {
    if (full) {
      boolean wasLoaded=cover_loadedThumb.get() || cover_loadedFull.get();
      if (!cover_loadedFull.get()) {
        Image img=Image2PassLoader.INSTANCE.getHq().invoke(file,size);
        if (img != null) {
          cover=img;
          return Try.ok(new LoadResult(wasLoaded,file,cover));
        }
        cover_loadedFull.set(true);
      }
    }
 else {
      boolean wasLoaded=cover_loadedThumb.get();
      if (!wasLoaded) {
        Image imgCached=Thumbnail.getCached(file,size);
        cover=imgCached != null ? imgCached : Image2PassLoader.INSTANCE.getLq().invoke(file,size);
        cover_loadedThumb.set(true);
      }
      return Try.ok(new LoadResult(wasLoaded,file,cover));
    }
  }
  return Try.error();
}

Fixed version (ground truth):
public Try<LoadResult,Void> loadCover(boolean full,ImageSize size){
  throwIfFxThread();
  if (disposed)   return Try.error();
  boolean wasCoverFile_loaded=coverFile_loaded;
  File file=getCoverFile();
  if (file == null) {
    if (!wasCoverFile_loaded && cover_file == null && (val.getPath().endsWith("String_Node_Str") || val.getPath().endsWith("String_Node_Str"))) {
      cover=IconExtractor.getFileIcon(val);
      cover_loadedFull.set(true);
      cover_loadedThumb.set(true);
      return Try.ok(new LoadResult(false,null,cover));
    }
  }
 else {
    if (full) {
      boolean wasLoaded=cover_loadedThumb.get() || cover_loadedFull.get();
      if (!cover_loadedFull.get()) {
        Image img=Image2PassLoader.INSTANCE.getHq().invoke(file,size);
        if (img != null) {
          cover=img;
          return Try.ok(new LoadResult(wasLoaded,file,cover));
        }
        cover_loadedFull.set(true);
      }
    }
 else {
      boolean wasLoaded=cover_loadedThumb.get();
      if (!wasLoaded) {
        Image imgCached=Thumbnail.getCached(file,size);
        cover=imgCached != null ? imgCached : Image2PassLoader.INSTANCE.getLq().invoke(file,size);
        cover_loadedThumb.set(true);
      }
      return Try.ok(new LoadResult(wasLoaded,file,cover));
    }
  }
  return Try.error();
}
Program: 36440
Project: 36440
Buggy source:
public void dispose(){
  if (children != null)   children.forEach(Item::dispose);
  if (children != null)   children.clear();
  if (all_children != null)   all_children.clear();
  children=null;
  all_children=null;
  cover=null;
}

Fixed version (ground truth):
public void dispose(){
  if (children != null)   children.forEach(Item::dispose);
  if (children != null)   children.clear();
  if (all_children != null)   all_children.clear();
  children=null;
  all_children=null;
  cover=null;
  disposed=true;
}
Program: 36441
Project: 36441
Buggy source:
protected File getCoverFile(){
  if (coverFile_loaded)   return cover_file;
  coverFile_loaded=true;
  if (valType == DIRECTORY) {
    if (all_children == null)     buildChildren();
    cover_file=getImageT(val,"String_Node_Str");
  }
 else {
    if (ImageFileFormat.isSupported(val)) {
      cover_file=val;
    }
 else {
      File i=getImage(val.getParentFile(),getNameWithoutExtensionOrRoot(val));
      if (i == null && parent != null)       cover_file=parent.getCoverFile();
 else       cover_file=i;
    }
  }
  return cover_file;
}

Fixed version (ground truth):
protected File getCoverFile(){
  if (disposed)   return null;
  if (coverFile_loaded)   return cover_file;
  coverFile_loaded=true;
  if (valType == DIRECTORY) {
    if (all_children == null)     buildChildren();
    cover_file=getImageT(val,"String_Node_Str");
  }
 else {
    if (ImageFileFormat.isSupported(val)) {
      cover_file=val;
    }
 else {
      File i=getImage(val.getParentFile(),getNameWithoutExtensionOrRoot(val));
      if (i == null && parent != null)       cover_file=parent.getCoverFile();
 else       cover_file=i;
    }
  }
  return cover_file;
}