nus-yam/ex-repair huggingface dataset:
Program: 6655
Project: 6655
Buggy source:
private int runJob(String name,Class<? extends Map> map,Class<? extends Reduce> reduce,String input,String output) throws Exception {
  Configuration conf=getConf();
  conf.setClass("String_Node_Str",IndexModule.class,Serializable.class);
  conf.setClass("String_Node_Str",CSVIndex.class,Serializable.class);
  conf.setClass("String_Node_Str",Filter.class,Serializable.class);
  conf.set("String_Node_Str","String_Node_Str");
  setConf(conf);
  Job job=new Job(conf,name);
  job.setJarByClass(Main.class);
  job.setMapOutputKeyClass(Text.class);
  job.setMapOutputValueClass(IntWritable.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  job.setMapperClass(map);
  job.setReducerClass(reduce);
  job.setInputFormatClass(IndexedInputFormat.class);
  job.setOutputFormatClass(TextOutputFormat.class);
  FileInputFormat.addInputPath(job,new Path(input));
  FileOutputFormat.setOutputPath(job,new Path(output));
  return job.waitForCompletion(true) ? 0 : 1;
}

Fixed version (ground truth):
private int runJob(String name,Class<? extends Map> map,Class<? extends Reduce> reduce,String input,String output) throws Exception {
  Configuration conf=getConf();
  conf.setClass("String_Node_Str",RunModule.class,Serializable.class);
  conf.setClass("String_Node_Str",CSVIndex.class,Serializable.class);
  conf.setClass("String_Node_Str",Filter.class,Serializable.class);
  conf.set("String_Node_Str","String_Node_Str");
  setConf(conf);
  Job job=new Job(conf,name);
  job.setJarByClass(Main.class);
  job.setMapOutputKeyClass(Text.class);
  job.setMapOutputValueClass(IntWritable.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  job.setMapperClass(map);
  job.setReducerClass(reduce);
  job.setInputFormatClass(IndexedInputFormat.class);
  job.setOutputFormatClass(TextOutputFormat.class);
  FileInputFormat.addInputPath(job,new Path(input));
  FileOutputFormat.setOutputPath(job,new Path(output));
  return job.waitForCompletion(true) ? 0 : 1;
}
Program: 6656
Project: 6656
Buggy source:
private BTree<String,String> getTree(File file){
  BTree<String,String> result=null;
  try {
    result=factory.get(file,FixedStringSerializer.INSTANCE,FixedStringSerializer.INSTANCE,StringComparator.INSTANCE);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + file.getAbsolutePath(),e);
  }
  return result;
}

Fixed version (ground truth):
private BTree<String,String> getTree(File file){
  BTree<String,String> result=null;
  try {
    result=factory.get(file,FixedStringSerializer.INSTANCE_1000,FixedStringSerializer.INSTANCE_1000,StringComparator.INSTANCE);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + file.getAbsolutePath(),e);
  }
  return result;
}
Program: 6657
Project: 6657
Buggy source:
@Override public Iterator<AbstractMap.SimpleEntry<String,String>> getIterator(String start,String end){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public Iterator<AbstractMap.SimpleEntry<String,String>> getIterator(String start,String end){
  ensureOpen();
  throw new UnsupportedOperationException();
}
Program: 6658
Project: 6658
Buggy source:
@Override public void addLine(String line,long pos){
  String key=extractKeyFromLine(line);
  getOrCreateWritingTree().add(key,line);
  String filename=getWriteTreeFileName();
  String propertyStr=properties.getProperty(filename,null);
  PropertyEntry p=new PropertyEntry();
  if (propertyStr != null)   p.loadFromString(propertyStr);
  if (pos < p.start) {
    p.start=pos;
  }
  if (pos > p.end) {
    p.end=pos;
  }
  properties.setProperty(filename,p.toString());
}

Fixed version (ground truth):
@Override public void addLine(String line,long pos){
  ensureOpen();
  String key=extractKeyFromLine(line);
  getOrCreateWritingTree().add(key,line);
  String filename=getWriteTreeFileName();
  String propertyStr=properties.getProperty(filename,null);
  PropertyEntry p=new PropertyEntry();
  if (propertyStr != null)   p.loadFromString(propertyStr);
  if (pos < p.start) {
    p.start=pos;
  }
  if (pos > p.end) {
    p.end=pos;
  }
  properties.setProperty(filename,p.toString());
}
Program: 6659
Project: 6659
Buggy source:
/** 
 * This method implemented by a subclass returns the key for a given line. <p/> This method isn't perfect since it assumes that each line is one entry. Maybe this can be made more generic later!
 * @param line in the hdfs file
 * @return key or null to ignore the line
 */
public abstract String extractKeyFromLine(String line);

Fixed version (ground truth):
/** 
 * This method implemented by a subclass returns the key for a given line. <p/> This method isn't perfect since it assumes that each line is one entry. Maybe this can be made more generic later! Also, call ensureOpen() in this method
 * @param line in the hdfs file
 * @return key or null to ignore the line
 */
public abstract String extractKeyFromLine(String line);
Program: 6660
Project: 6660
Buggy source:
@Override public void close(){
  try {
    saveProperties();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  if (bTreeWriting != null)   bTreeWriting.sync();
}

Fixed version (ground truth):
@Override public void close(){
  if (!isOpen())   return;
  try {
    saveProperties();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  if (bTreeWriting != null)   bTreeWriting.sync();
}
Program: 6661
Project: 6661
Buggy source:
public boolean open() throws Exception {
  File indexDir=getIndexDir();
  indexDir.mkdirs();
  loadOrCreateProperties();
  isOpen=true;
  return true;
}

Fixed version (ground truth):
public void open() throws IOException {
  File indexDir=getIndexDir();
  indexDir.mkdirs();
  loadOrCreateProperties();
  isOpen=true;
}
Program: 6662
Project: 6662
Buggy source:
public static Index create(InputSplit genericSplit,TaskAttemptContext context){
  LOG.setLevel(Level.DEBUG);
  Configuration conf=context.getConfiguration();
  Class<?> indexClass=conf.getClass("String_Node_Str",null);
  Class<?> guiceModule=conf.getClass("String_Node_Str",null);
  String hdfsFile=inputToFileSplit(genericSplit).getPath().toString();
  LOG.debug("String_Node_Str" + hdfsFile);
  try {
    LOG.debug("String_Node_Str" + indexClass.toString() + "String_Node_Str"+ guiceModule.toString());
    RunModule module=(RunModule)guiceModule.getConstructor().newInstance();
    module.setHdfsFile(hdfsFile);
    LOG.debug("String_Node_Str" + module.getClass().getName().toString());
    Injector injector=Guice.createInjector(module);
    LOG.debug("String_Node_Str");
    return (Index)injector.getInstance(indexClass);
  }
 catch (  Exception e) {
    LOG.debug(e);
    return null;
  }
}

Fixed version (ground truth):
public static Index create(InputSplit genericSplit,TaskAttemptContext context){
  LOG.setLevel(Level.DEBUG);
  Configuration conf=context.getConfiguration();
  Class<?> indexClass=conf.getClass("String_Node_Str",null);
  Class<?> guiceModule=conf.getClass("String_Node_Str",null);
  String hdfsFile=inputToFileSplit(genericSplit).getPath().toString();
  LOG.debug("String_Node_Str" + hdfsFile);
  try {
    LOG.debug("String_Node_Str" + indexClass.toString() + "String_Node_Str"+ guiceModule.toString());
    RunModule module=(RunModule)guiceModule.getConstructor().newInstance();
    module.setHdfsFile(hdfsFile);
    LOG.debug("String_Node_Str" + module.getClass().getName().toString());
    Injector injector=Guice.createInjector(module);
    LOG.debug("String_Node_Str");
    Index index=(Index)injector.getInstance(indexClass);
    index.open();
    return index;
  }
 catch (  Exception e) {
    LOG.debug(e);
    return null;
  }
}
Program: 6663
Project: 6663
Buggy source:
public synchronized void showIn(){
  santa_is_listening=true;
  notify();
}

Fixed version (ground truth):
public synchronized void showIn(){
  santa_is_listening=true;
  notifyAll();
}
Program: 6664
Project: 6664
Buggy source:
public synchronized void showOut(){
  santa_is_listening=false;
  notify();
}

Fixed version (ground truth):
public synchronized void showOut(){
  santa_is_listening=false;
  notifyAll();
}
Program: 6665
Project: 6665
Buggy source:
public synchronized void harness(){
  santa_is_harnessing=true;
  notify();
}

Fixed version (ground truth):
public synchronized void harness(){
  santa_is_harnessing=true;
  notifyAll();
}
Program: 6666
Project: 6666
Buggy source:
public synchronized void unHarness(){
  santa_is_harnessing=false;
  notify();
}

Fixed version (ground truth):
public synchronized void unHarness(){
  santa_is_harnessing=false;
  notifyAll();
}
Program: 6667
Project: 6667
Buggy source:
public synchronized void ask(Elf elf){
  elves.add(elf);
  if (elves.size() == Santa.ELF_GROUP)   notify();
}

Fixed version (ground truth):
public synchronized void ask(Elf elf){
  elves.add(elf);
  if (elves.size() == Santa.ELF_GROUP)   notifyAll();
}
Program: 6668
Project: 6668
Buggy source:
public synchronized void deliverToys(){
  reindeers++;
  if (reindeers == Santa.REINDEERS)   notify();
}

Fixed version (ground truth):
public synchronized void deliverToys(){
  reindeers++;
  if (reindeers == Santa.REINDEERS)   notifyAll();
}
Program: 6669
Project: 6669
Buggy source:
private void updateThreadInfo(JVM jvm,AgentMessage agentMessage,Thread thread){
  ThreadInfo threadInfo=jvm.getThread(thread.getId());
  if (threadInfo == null) {
    threadInfo=new ThreadInfo(thread.getId(),thread.getName(),thread.getPriority(),thread.getState().toString(),thread.getIsContextClassLoaderSet());
    addThreadInfo(jvm.getId(),threadInfo);
  }
 else {
    jvm.getThread(thread.getId()).compareAndSet(agentMessage.getTimestamp(),thread.getId(),thread.getName(),thread.getPriority(),thread.getState().toString(),thread.getIsContextClassLoaderSet());
    if (thread.hasCpuTime()) {
      threadInfo.setCpuTime(thread.getCpuTime());
    }
  }
}

Fixed version (ground truth):
private void updateThreadInfo(JVM jvm,AgentMessage agentMessage,Thread thread){
  ThreadInfo threadInfo=jvm.getThread(thread.getId());
  if (threadInfo == null) {
    threadInfo=new ThreadInfo(thread.getId(),thread.getName(),thread.getPriority(),thread.getState().toString(),thread.getIsContextClassLoaderSet(),agentMessage.getTimestamp());
    addThreadInfo(jvm.getId(),threadInfo);
  }
 else {
    jvm.getThread(thread.getId()).compareAndSet(agentMessage.getTimestamp(),thread.getId(),thread.getName(),thread.getPriority(),thread.getState().toString(),thread.getIsContextClassLoaderSet());
    if (thread.hasCpuTime()) {
      threadInfo.setCpuTime(thread.getCpuTime());
    }
  }
}
Program: 6671
Project: 6671
Buggy source:
/** 
 * Standard constructor.
 * @param id a generated id by the profiler.
 * @param name the threads name.
 * @param priority the threads priority.
 * @param state the threads state.
 * @param ccl whether the context class loader is set.
 * @param notiyWaitController
 */
public ThreadInfo(int id,String name,int priority,String state,boolean ccl){
  super();
  this.id=id;
  this.name=name;
  this.priority=priority;
  this.state=state;
  this.isContextClassLoaderSet=ccl;
  this.cpuTime=-1;
  this.stateToDuration=new ConcurrentHashMap<String,Long>();
  String possibleStates[]=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String possibleState : possibleStates) {
    stateToDuration.put(possibleState,0l);
  }
  stateToDuration.put(state,1l);
}

Fixed version (ground truth):
/** 
 * Standard constructor.
 * @param id a generated id by the profiler.
 * @param name the threads name.
 * @param priority the threads priority.
 * @param state the threads state.
 * @param ccl whether the context class loader is set.
 * @param notiyWaitController
 */
public ThreadInfo(int id,String name,int priority,String state,boolean ccl,long timestamp){
  super();
  this.id=id;
  this.name=name;
  this.priority=priority;
  this.state=state;
  this.isContextClassLoaderSet=ccl;
  this.cpuTime=-1;
  this.timeSinceLastUpdate=timestamp;
  this.stateToDuration=new ConcurrentHashMap<String,Long>();
  String possibleStates[]=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String possibleState : possibleStates) {
    stateToDuration.put(possibleState,0l);
  }
}
Program: 6672
Project: 6672
Buggy source:
public void compareAndSet(long timestamp,int id,String name,int priority,String state,boolean isContextClassLoaderSet){
  if (this.id != id) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!this.name.equals(name)) {
    this.name=name;
  }
  if (this.priority != priority) {
    this.priority=priority;
  }
  if (!stateToDuration.containsKey(state)) {
    stateToDuration.put(state,1l);
  }
  long timeSpentInState=timestamp - timeSinceLastUpdate;
  long oldTimeSpentInState=stateToDuration.get(this.state);
  stateToDuration.put(this.state,oldTimeSpentInState + timeSpentInState);
  timeSinceLastUpdate=timestamp;
  if (!this.state.equals(state)) {
    this.state=state;
  }
  if (this.isContextClassLoaderSet != isContextClassLoaderSet) {
    this.isContextClassLoaderSet=isContextClassLoaderSet;
  }
}

Fixed version (ground truth):
public void compareAndSet(long timestamp,int id,String name,int priority,String state,boolean isContextClassLoaderSet){
  if (this.id != id) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!this.name.equals(name)) {
    this.name=name;
  }
  if (this.priority != priority) {
    this.priority=priority;
  }
  long timeSpentInState=timestamp - timeSinceLastUpdate;
  long oldTimeSpentInState=stateToDuration.get(this.state);
  stateToDuration.put(this.state,oldTimeSpentInState + timeSpentInState);
  timeSinceLastUpdate=timestamp;
  if (!this.state.equals(state)) {
    this.state=state;
  }
  if (this.isContextClassLoaderSet != isContextClassLoaderSet) {
    this.isContextClassLoaderSet=isContextClassLoaderSet;
  }
}
Program: 6674
Project: 6674
Buggy source:
/** 
 * Register the servlet contrainer or reload it. Must be called after adding or removing a class into the ResourceConfig.
 */
private void reloadServlet(){
  if (container == null) {
    container=new JerseyServletBridge(this);
    try {
      httpservice.registerServlet(rootName,container,new Hashtable<String,Object>(),null);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else {
    container.reload();
  }
}

Fixed version (ground truth):
/** 
 * Register the servlet contrainer or reload it. Must be called after adding or removing a class into the ResourceConfig.
 */
private void reloadServlet(){
  if (container == null) {
    container=new JerseyServletBridge(this);
    try {
      httpservice.registerServlet(rootName,container,new Hashtable<String,Object>(),null);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else {
    System.out.println("String_Node_Str" + rsconfig.getClasses());
    if (rsconfig.isEmpty()) {
      httpservice.unregister(rootName);
      container=null;
    }
 else {
      container.reload();
    }
  }
}
Program: 6675
Project: 6675
Buggy source:
protected void destroyEndpoint(EndpointDescription endesc){
  String pathName=(String)endesc.getProperties().get(PROP_PATH);
  rsconfig.removeComponentProvider(pathName);
  try {
    container.reload();
  }
 catch (  Exception e) {
  }
  logger.log(LOG_DEBUG,"String_Node_Str" + endesc.getId() + "String_Node_Str"+ pathName+ "String_Node_Str");
}

Fixed version (ground truth):
protected void destroyEndpoint(EndpointDescription endesc){
  String pathName=(String)endesc.getProperties().get(PROP_PATH);
  rsconfig.removeComponentProvider(pathName);
  try {
    reloadServlet();
  }
 catch (  RuntimeException e) {
    logger.log(LOG_ERROR,"String_Node_Str" + endesc.getId(),e);
  }
  logger.log(LOG_DEBUG,"String_Node_Str" + endesc.getId() + "String_Node_Str"+ pathName+ "String_Node_Str");
}
Program: 6676
Project: 6676
Buggy source:
public void destroyProxy(EndpointDescription description,ServiceRegistration registration){
  if (proxies.containsKey(description.getId())) {
    Client client=proxies.remove(description.getId());
    client.closeProxy(description.getId());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void destroyProxy(EndpointDescription description,ServiceRegistration registration){
  if (proxies.containsKey(description.getId())) {
    registration.unregister();
    Client client=proxies.remove(description.getId());
    client.closeProxy(description.getId());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 6677
Project: 6677
Buggy source:
/** 
 * @return <code>true</code> if the {@link ComponentInstance} is in a valid state, <code>false</code> otherwise.
 */
protected final boolean isValid(){
  return isValid;
}

Fixed version (ground truth):
/** 
 * @return <code>true</code> if the {@link ExporterService} is in a valid state, <code>false</code> otherwise.
 */
protected final boolean isValid(){
  return isValid;
}
Program: 6678
Project: 6678
Buggy source:
/** 
 * @return <code>true</code> if the {@link ComponentInstance} is in a valid state, <code>false</code> otherwise.
 */
protected final boolean isValid(){
  return isValid;
}

Fixed version (ground truth):
/** 
 * @return <code>true</code> if the {@link ImporterService} is in a valid state, <code>false</code> otherwise.
 */
protected final boolean isValid(){
  return isValid;
}
Program: 6679
Project: 6679
Buggy source:
private DynamicImporter(Builder builder){
  extraProperties=builder.extraProperties;
  context=builder.context;
  edfilter=builder.dfilter;
  ifilter=builder.xfilter;
  customizer=builder.customizer;
  imptracker=new ImporterTracker();
}

Fixed version (ground truth):
private DynamicImporter(Builder builder){
  extraProperties=builder.extraProperties;
  context=builder.context;
  edfilter=builder.dfilter;
  ifilter=builder.imfilter;
  customizer=builder.customizer;
  imptracker=new ImporterTracker();
}
Program: 6680
Project: 6680
Buggy source:
public Builder importerFilter(String val) throws InvalidSyntaxException {
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(DEFAULT_IMPORTER_FILTER);
  sb.append(val);
  sb.append("String_Node_Str");
  return this;
}

Fixed version (ground truth):
public Builder importerFilter(String val) throws InvalidSyntaxException {
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(DEFAULT_IMPORTER_FILTER);
  sb.append(val);
  sb.append("String_Node_Str");
  imfilter=createFilter(sb.toString());
  return this;
}
Program: 6681
Project: 6681
Buggy source:
public Object doImport(ImporterService importer,EndpointDescription description,Map<String,Object> properties){
  ImportRegistration registration=importer.importService(description,properties);
  irefs.add(registration.getImportReference());
  return registration;
}

Fixed version (ground truth):
public Object doImport(ImporterService importer,EndpointDescription description,Map<String,Object> properties){
  ImportRegistration registration=importer.importService(description,properties);
  ImportReference iref=registration.getImportReference();
  if (iref != null) {
    irefs.add(registration.getImportReference());
  }
  return registration;
}
Program: 6682
Project: 6682
Buggy source:
public EndpointListenerTracker(BundleContext pContext,ImportRegistry impReg,ExportRegistry expReg){
  context=pContext;
  importReg=impReg;
  exportReg=expReg;
  tracker=new ServiceTracker(context,EndpointListener.class.getName(),this);
}

Fixed version (ground truth):
public EndpointListenerTracker(RoseMachineImpl pMachine){
  machine=pMachine;
  tracker=new ServiceTracker(machine.getContext(),EndpointListener.class.getName(),this);
}
Program: 6683
Project: 6683
Buggy source:
public Object addingService(ServiceReference reference){
  EndpointListener listener=(EndpointListener)context.getService(reference);
  Object ofilter=reference.getProperty(ENDPOINT_LISTENER_SCOPE);
  EndpointListerInterrest interrest=getEndpointListenerInterrest(reference);
  try {
switch (interrest) {
case ALL:
      exportReg.addEndpointListener(listener,(String)ofilter);
    importReg.addEndpointListener(listener,(String)ofilter);
  break;
case REMOTE:
exportReg.addEndpointListener(listener,(String)ofilter);
break;
case LOCAL:
exportReg.addEndpointListener(listener,(String)ofilter);
}
}
 catch (Exception e) {
importReg.removeEndpointListener(listener);
exportReg.removeEndpointListener(listener);
listener=null;
}
return new InterestedListener(listener,interrest);
}

Fixed version (ground truth):
public Object addingService(ServiceReference reference){
  EndpointListener listener=(EndpointListener)machine.getContext().getService(reference);
  Object ofilter=reference.getProperty(ENDPOINT_LISTENER_SCOPE);
  String sfilter=ofilter == null ? null : String.valueOf(ofilter);
  EndpointListerInterrest interrest=getEndpointListenerInterrest(reference);
  try {
    machine.addEndpointListener(listener,interrest,sfilter);
  }
 catch (  InvalidSyntaxException e) {
    machine.log(LOG_WARNING,"String_Node_Str" + reference,e);
  }
  return new InterestedListener(listener,interrest);
}
Program: 6684
Project: 6684
Buggy source:
public void removedService(ServiceReference reference,Object service){
  InterestedListener listener=(InterestedListener)service;
switch (listener.getInterest()) {
case ALL:
    importReg.removeEndpointListener(listener.getListener());
  exportReg.removeEndpointListener(listener.getListener());
break;
case REMOTE:
exportReg.removeEndpointListener(listener.getListener());
break;
case LOCAL:
importReg.removeEndpointListener(listener.getListener());
}
}

Fixed version (ground truth):
public void removedService(ServiceReference reference,Object service){
  InterestedListener listener=(InterestedListener)service;
  machine.removeEndpointListener(listener.getListener(),listener.getInterest());
}
Program: 6685
Project: 6685
Buggy source:
public void modifiedService(ServiceReference reference,Object service){
  InterestedListener listener=(InterestedListener)service;
  Object ofilter=reference.getProperty(ENDPOINT_LISTENER_SCOPE);
  try {
switch (listener.getInterest()) {
case ALL:
      exportReg.addEndpointListener(listener.getListener(),(String)ofilter);
    importReg.addEndpointListener(listener.getListener(),(String)ofilter);
  break;
case REMOTE:
exportReg.addEndpointListener(listener.getListener(),(String)ofilter);
break;
case LOCAL:
exportReg.addEndpointListener(listener.getListener(),(String)ofilter);
}
}
 catch (Exception e) {
importReg.removeEndpointListener(listener.getListener());
exportReg.removeEndpointListener(listener.getListener());
}
}

Fixed version (ground truth):
public void modifiedService(ServiceReference reference,Object service){
  InterestedListener listener=(InterestedListener)service;
  Object ofilter=reference.getProperty(ENDPOINT_LISTENER_SCOPE);
  String sfilter=ofilter == null ? null : String.valueOf(ofilter);
  try {
    machine.addEndpointListener(listener.getListener(),listener.getInterest(),sfilter);
  }
 catch (  InvalidSyntaxException e) {
    machine.log(LOG_WARNING,"String_Node_Str" + reference,e);
  }
}
Program: 6686
Project: 6686
Buggy source:
public void log(int level,String message,Throwable exception){
  logger.log(level,message,exception);
}

Fixed version (ground truth):
protected void log(int level,String message,Throwable exception){
  logger.log(level,message,exception);
}
Program: 6687
Project: 6687
Buggy source:
public RoseMachineImpl(BundleContext pContext){
  properties=new Hashtable<String,Object>(4);
  registrations=new HashMap<Object,ServiceRegistration>(4);
  context=pContext;
  initProperties(context);
  importReg=new ImportRegistryImpl();
  exportReg=new ExportRegistryImpl(context);
  tracklistener=new EndpointListenerTracker(context,importReg,exportReg);
}

Fixed version (ground truth):
public RoseMachineImpl(BundleContext pContext){
  properties=new Hashtable<String,Object>(4);
  registrations=new HashMap<Object,ServiceRegistration>(4);
  context=pContext;
  initProperties(context);
  importReg=new ImportRegistryImpl();
  exportReg=new ExportRegistryImpl(context);
  tracklistener=new EndpointListenerTracker(this);
}
Program: 6688
Project: 6688
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T getServiceObject(Class<T> klass){
  ServiceReference sref=null;
  sref=context.getServiceReference(klass.getName());
  if (sref != null) {
    return (T)context.getService(sref);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T getServiceObject(Class<T> klass){
  ServiceReference sref=null;
  sref=context.getServiceReference(klass.getName());
  if (sref != null) {
    T service=(T)context.getService(sref);
    context.ungetService(sref);
    return service;
  }
 else {
    return null;
  }
}
Program: 6689
Project: 6689
Buggy source:
public void close(){
  if (xref != null) {
    if (registrations.remove(xref.getExportedService(),this)) {
      getExportRegistry().remove(xref);
    }
    xref=null;
  }
}

Fixed version (ground truth):
public void close(){
  if (xref != null) {
    if (registrations.remove(xref.getExportedService(),this)) {
      getExportRegistry().remove(xref);
      destroyEndpoint(xref.getExportedEndpoint());
    }
    xref=null;
  }
}
Program: 6690
Project: 6690
Buggy source:
@SuppressWarnings("String_Node_Str") @Bind(aggregate=true,optional=true,id="String_Node_Str") private void bindExportedEndpointListener(ExportedEndpointListener listener,Map<String,Object> properties){
  String filter=(String)properties.get(ENDPOINT_LISTENER_SCOPE);
  try {
    addEndpointListener(listener,filter);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Bind(aggregate=true,optional=true,id="String_Node_Str") private void bindExportedEndpointListener(ExportedEndpointListener listener,Map<String,Object> properties){
  String filter=(String)properties.get(ENDPOINT_LISTENER_SCOPE);
  try {
    addEndpointListener(listener,filter);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 6691
Project: 6691
Buggy source:
public static Point2D segmentSegmentIntersection(SegmentComponent seg1,SegmentComponent seg2){
  double x1=seg1.getFrom().getX(), y1=seg1.getFrom().getY();
  double x2=seg1.getTo().getX(), y2=seg1.getTo().getY();
  double x3=seg2.getFrom().getX(), y3=seg2.getFrom().getY();
  double x4=seg2.getTo().getX(), y4=seg2.getTo().getY();
  double denom=(y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  double ua=((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom;
  double ub=((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom;
  if (ua < 0 || ua > 1 || ub < 0 || ub > 1)   return null;
  return new Point2D.Double(x1 + ua * (x2 - x1),y1 + ua * (y2 - y1));
}

Fixed version (ground truth):
public static Point2D segmentSegmentIntersection(SegmentComponent seg1,SegmentComponent seg2){
  double x1=seg1.getFrom().getX(), y1=seg1.getFrom().getY();
  double x2=seg1.getTo().getX(), y2=seg1.getTo().getY();
  double x3=seg2.getFrom().getX(), y3=seg2.getFrom().getY();
  double x4=seg2.getTo().getX(), y4=seg2.getTo().getY();
  double denom=(y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  if (Math.abs(denom) <= .00001)   return null;
  double ua=((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom;
  double ub=((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom;
  return new Point2D.Double(x1 + ua * (x2 - x1),y1 + ua * (y2 - y1));
}
Program: 6692
Project: 6692
Buggy source:
public Shape truncateFrom(CorridorComponent comp){
  if (comp.getType() == Type.SEGMENT) {
    Point2D isect=ComponentIntersector.segmentSegmentIntersection(this,(SegmentComponent)comp);
    if (isect != null)     return new Line2D.Double(isect,segment_.getP2());
  }
  return getSegment();
}

Fixed version (ground truth):
@Override public Shape truncateFrom(CorridorComponent comp){
  if (comp.getType() == Type.SEGMENT) {
    Point2D isect=ComponentIntersector.segmentSegmentIntersection(this,(SegmentComponent)comp);
    if (isect != null)     return new Line2D.Double(isect,segment_.getP2());
  }
  return getSegment();
}
Program: 6693
Project: 6693
Buggy source:
public Point2D intersect(CorridorComponent comp){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Point2D intersect(CorridorComponent comp){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 6694
Project: 6694
Buggy source:
public Type getType(){
  return Type.SEGMENT;
}

Fixed version (ground truth):
@Override public Type getType(){
  return Type.SEGMENT;
}
Program: 6695
Project: 6695
Buggy source:
public Shape truncateTo(CorridorComponent comp){
  if (comp.getType() == Type.SEGMENT) {
    Point2D isect=ComponentIntersector.segmentSegmentIntersection(this,(SegmentComponent)comp);
    if (isect != null)     return new Line2D.Double(segment_.getP1(),isect);
  }
  return getSegment();
}

Fixed version (ground truth):
@Override public Shape truncateTo(CorridorComponent comp){
  if (comp.getType() == Type.SEGMENT) {
    Point2D isect=ComponentIntersector.segmentSegmentIntersection(this,(SegmentComponent)comp);
    if (isect != null)     return new Line2D.Double(segment_.getP1(),isect);
  }
  return getSegment();
}
Program: 6696
Project: 6696
Buggy source:
public Shape getShape(){
  return getSegment();
}

Fixed version (ground truth):
@Override public Shape getShape(){
  return getSegment();
}
Program: 6697
Project: 6697
Buggy source:
public double getOffset(AnchorPoint anchor){
  if (corr_.fPoint() == anchor)   return line_.getCorridorInfo(corr_).offsetFrom_;
  if (corr_.tPoint() == anchor)   return line_.getCorridorInfo(corr_).offsetTo_;
  return -1;
}

Fixed version (ground truth):
public double getOffset(AnchorPoint anchor){
  if (corr_.fPoint() == anchor)   return line_.getCorridorInfo(corr_).offsetFrom_;
  if (corr_.tPoint() == anchor)   return -line_.getCorridorInfo(corr_).offsetTo_;
  return -1;
}
Program: 6699
Project: 6699
Buggy source:
@Override public void drawStop(TSCanvas canvas){
  Graphics2D g2d=canvas.getGraphics2D();
  double rs=canvas.getCoordinates().dxToWorld(radius_);
  Ellipse2D e=new Ellipse2D.Double(stop_.getWorldX() - rs,stop_.getWorldY() - rs,rs * 2,rs * 2);
  Path2D p=new Path2D.Double(e);
  p.transform(canvas.getCoordinates().getScaleTransform());
  p.transform(canvas.getCoordinates().getTranslateTransform());
  Point2D offset=stop_.getScreenOffset();
  if (offset != null) {
    p.transform(AffineTransform.getTranslateInstance(offset.getX(),-offset.getY()));
  }
  g2d.setColor(template_.getFillColor());
  g2d.fill(p);
  g2d.setColor(template_.getBorderColor());
  g2d.setStroke(new BasicStroke(template_.getBorderWeight()));
  g2d.draw(p);
}

Fixed version (ground truth):
@Override public void drawStop(TSCanvas canvas){
  Graphics2D g2d=canvas.getGraphics2D();
  double rs=canvas.getCoordinates().dxToWorld(radius_);
  Ellipse2D e=new Ellipse2D.Double(stop_.getWorldX() - rs,stop_.getWorldY() - rs,rs * 2,rs * 2);
  Path2D p=new Path2D.Double(e);
  p.transform(canvas.getCoordinates().getScaleTransform());
  p.transform(canvas.getCoordinates().getTranslateTransform());
  p.transform(AffineTransform.getTranslateInstance(stop_.getScreenOffset().getX(),-stop_.getScreenOffset().getY()));
  g2d.setColor(template_.getFillColor());
  g2d.fill(p);
  g2d.setColor(template_.getBorderColor());
  g2d.setStroke(new BasicStroke(template_.getBorderWeight()));
  g2d.draw(p);
}
Program: 6700
Project: 6700
Buggy source:
@Override public void drawHighlight(TSCanvas canvas,Color color){
  Graphics2D g2d=canvas.getGraphics2D();
  double rs=canvas.getCoordinates().dxToWorld(radius_ + 5);
  Ellipse2D e=new Ellipse2D.Double(stop_.getWorldX() - rs,stop_.getWorldY() - rs,rs * 2,rs * 2);
  Path2D p=new Path2D.Double(e);
  p.transform(canvas.getCoordinates().getScaleTransform());
  p.transform(canvas.getCoordinates().getTranslateTransform());
  Point2D offset=stop_.getScreenOffset();
  if (offset != null) {
    p.transform(AffineTransform.getTranslateInstance(offset.getX(),-offset.getY()));
  }
  g2d.setColor(color);
  g2d.fill(p);
}

Fixed version (ground truth):
@Override public void drawHighlight(TSCanvas canvas,Color color){
  Graphics2D g2d=canvas.getGraphics2D();
  double rs=canvas.getCoordinates().dxToWorld(radius_ + 5);
  Ellipse2D e=new Ellipse2D.Double(stop_.getWorldX() - rs,stop_.getWorldY() - rs,rs * 2,rs * 2);
  Path2D p=new Path2D.Double(e);
  p.transform(canvas.getCoordinates().getScaleTransform());
  p.transform(canvas.getCoordinates().getTranslateTransform());
  p.transform(AffineTransform.getTranslateInstance(stop_.getScreenOffset().getX(),-stop_.getScreenOffset().getY()));
  g2d.setColor(color);
  g2d.fill(p);
}
Program: 6701
Project: 6701
Buggy source:
public Bundler(TSNetwork network){
  network.clearBundlerData();
  initBundles(network);
  initComparisons(network);
  assignOffsets(network);
  constructStraightaways(network);
  processStraightaways(network);
  processAnchors(network);
}

Fixed version (ground truth):
public Bundler(TSNetwork network){
  network.clearBundlerData();
  initBundles(network);
  initComparisons(network);
  assignOffsets(network);
  constructStraightaways(network);
  processStraightaways(network);
  processAnchors(network);
  processCorridors(network);
}
Program: 6702
Project: 6702
Buggy source:
public void print(){
}

Fixed version (ground truth):
public void print(TSNetwork network){
  for (  Line line : network.getLines()) {
    System.out.println("String_Node_Str" + line.getName());
    for (    Corridor corr : line.getCorridors()) {
      System.out.println("String_Node_Str" + corr.getID() + "String_Node_Str"+ line.getCorridorInfo(corr).offsetFrom_+ "String_Node_Str"+ line.getCorridorInfo(corr).offsetTo_);
    }
  }
}
Program: 6707
Project: 6707
Buggy source:
public void giveItemName(String item,String amount,Player player){
  ItemStack itemstack;
  String clone=item;
  PlayerInventory inventory=player.getInventory();
  if (item.contains("String_Node_Str")) {
    String[] split=clone.split("String_Node_Str");
    itemstack=new ItemStack(items.get(split[0].toLowerCase()));
    itemstack.setDurability(Short.parseShort(split[1]));
    player.sendMessage("String_Node_Str");
    itemstack.setAmount(Integer.parseInt(amount));
    inventory.addItem(itemstack);
  }
 else {
    itemstack=new ItemStack(items.get(item.toLowerCase()));
    itemstack.setAmount(Integer.parseInt(amount));
    player.sendMessage("String_Node_Str");
    inventory.addItem(itemstack);
  }
}

Fixed version (ground truth):
public void giveItemName(String item,String amount,Player player){
  ItemStack itemstack;
  String clone=item;
  PlayerInventory inventory=player.getInventory();
  if (item.contains("String_Node_Str")) {
    String[] split=clone.split("String_Node_Str");
    if (!items.containsKey(split[0].toLowerCase())) {
      itemstack=new ItemStack(items.get(split[0].toLowerCase()));
      itemstack.setDurability(Short.parseShort(split[1]));
      player.sendMessage("String_Node_Str");
      itemstack.setAmount(Integer.parseInt(amount));
      inventory.addItem(itemstack);
    }
 else {
      player.sendMessage("String_Node_Str" + split[0]);
    }
  }
 else {
    if (!items.containsKey(item.toLowerCase())) {
      itemstack=new ItemStack(items.get(item.toLowerCase()));
      itemstack.setAmount(Integer.parseInt(amount));
      player.sendMessage("String_Node_Str");
      inventory.addItem(itemstack);
    }
 else {
      player.sendMessage("String_Node_Str" + item);
    }
  }
}
Program: 6709
Project: 6709
Buggy source:
public void giveItemName(String item,String amount,Player player){
  ItemStack itemstack;
  String clone=item;
  PlayerInventory inventory=player.getInventory();
  if (item.contains("String_Node_Str")) {
    String[] split=clone.split("String_Node_Str");
    itemstack=new ItemStack(items.get(strip(split[0]).toLowerCase()));
    itemstack.setDurability(Short.parseShort(split[1]));
    player.sendMessage("String_Node_Str");
    itemstack.setAmount(Integer.parseInt(amount));
    inventory.addItem(itemstack);
  }
 else {
    itemstack=new ItemStack(items.get(item.toLowerCase()));
    itemstack.setAmount(Integer.parseInt(amount));
    player.sendMessage("String_Node_Str");
    inventory.addItem(itemstack);
  }
}

Fixed version (ground truth):
public void giveItemName(String item,String amount,Player player){
  ItemStack itemstack;
  String clone=item;
  PlayerInventory inventory=player.getInventory();
  if (item.contains("String_Node_Str")) {
    String[] split=clone.split("String_Node_Str");
    itemstack=new ItemStack(items.get(split[0].toLowerCase()));
    itemstack.setDurability(Short.parseShort(split[1]));
    player.sendMessage("String_Node_Str");
    itemstack.setAmount(Integer.parseInt(amount));
    inventory.addItem(itemstack);
  }
 else {
    itemstack=new ItemStack(items.get(item.toLowerCase()));
    itemstack.setAmount(Integer.parseInt(amount));
    player.sendMessage("String_Node_Str");
    inventory.addItem(itemstack);
  }
}
Program: 6712
Project: 6712
Buggy source:
public boolean itemAllow(int args){
  gimme.config.load();
  String x=gimme.config.getProperty("String_Node_Str").toString();
  String[] whitelist=x.split("String_Node_Str");
  String arg=Integer.toString(args);
  if (arg.contains("String_Node_Str")) {
    String clone=arg;
    String[] split=clone.split("String_Node_Str");
    int item=Integer.parseInt(split[0]);
    for (    String s : whitelist) {
      String white=strip(s);
      if (!(Integer.parseInt(white) == item)) {
        return true;
      }
    }
    return false;
  }
 else {
    for (    String s : whitelist) {
      String white=strip(s);
      if (!(Integer.parseInt(white) == args)) {
        return true;
      }
    }
    return false;
  }
}

Fixed version (ground truth):
public boolean itemAllow(int args){
  gimme.config.load();
  String x=gimme.config.getProperty("String_Node_Str").toString();
  String[] whitelist=x.split("String_Node_Str");
  String arg=Integer.toString(args);
  if (arg.contains("String_Node_Str")) {
    String clone=arg;
    String[] split=clone.split("String_Node_Str");
    int item=Integer.parseInt(split[0]);
    for (    String s : whitelist) {
      String white=strip(s);
      if (Integer.parseInt(white) == item) {
        return true;
      }
    }
    return false;
  }
 else {
    for (    String s : whitelist) {
      String white=strip(s);
      if (Integer.parseInt(white) == args) {
        return true;
      }
    }
    return false;
  }
}
Program: 6714
Project: 6714
Buggy source:
public boolean onCommand(CommandSender sender,Command commandArg,String commandLabel,String[] arg){
  Player player=(Player)sender;
  PlayerInventory inventory=player.getInventory();
  String command=commandArg.getName().toLowerCase();
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || gimme.Permissions.has(player,"String_Node_Str") || (gimme.Permissions.has(player,"String_Node_Str") || gimme.Permissions.has(player,"String_Node_Str"))) {
      ItemStack itemstack=new ItemStack(Integer.valueOf(arg[0]));
      @SuppressWarnings("String_Node_Str") boolean check=itemdeny(Integer.valueOf(arg[0]));
      if (arg.length >= 1 && arg.length <= 2) {
        if (!(itemdeny(Integer.valueOf(arg[0])))) {
          if (arg.length == 1) {
            itemstack.setAmount(amount);
          }
          if (arg.length == 2) {
            itemstack.setAmount(Integer.parseInt(arg[1]));
          }
          player.sendMessage("String_Node_Str");
          inventory.addItem(itemstack);
        }
      }
 else {
        player.sendMessage("String_Node_Str");
      }
    }
 else {
      player.sendMessage("String_Node_Str");
      log.info(logPrefix + "String_Node_Str" + player.getDisplayName()+ "String_Node_Str"+ command+ "String_Node_Str");
    }
    return true;
  }
  return true;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command commandArg,String commandLabel,String[] arg){
  Player player=(Player)sender;
  PlayerInventory inventory=player.getInventory();
  String command=commandArg.getName().toLowerCase();
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || gimme.Permissions.has(player,"String_Node_Str") || (gimme.Permissions.has(player,"String_Node_Str") || gimme.Permissions.has(player,"String_Node_Str"))) {
      if (arg.length >= 1 && arg.length <= 2) {
        ItemStack itemstack=new ItemStack(Integer.parseInt(arg[0]));
        @SuppressWarnings("String_Node_Str") boolean check=itemdeny(Integer.valueOf(arg[0]));
        if (!(itemdeny(Integer.valueOf(arg[0])))) {
          if (arg.length == 1) {
            itemstack.setAmount(amount);
          }
          if (arg.length == 2) {
            itemstack.setAmount(Integer.parseInt(arg[1]));
          }
          log.info(logPrefix + "String_Node_Str" + player+ "String_Node_Str"+ itemstack.toString());
          player.sendMessage("String_Node_Str");
          inventory.addItem(itemstack);
        }
 else {
          player.sendMessage(logPrefix + "String_Node_Str");
          log.info(logPrefix + player + "String_Node_Str"+ itemstack.toString());
        }
      }
 else {
        player.sendMessage("String_Node_Str");
      }
    }
 else {
      player.sendMessage("String_Node_Str");
      log.info(logPrefix + "String_Node_Str" + player.getDisplayName()+ "String_Node_Str"+ command+ "String_Node_Str");
    }
    return true;
  }
  return true;
}
Program: 6715
Project: 6715
Buggy source:
public boolean itemdeny(int args){
  gimme.config.load();
  String x=gimme.config.getNodeList("String_Node_Str",null).toString();
  log.info(logPrefix + "String_Node_Str" + Integer.toString(args));
  if (x.contains(Integer.toString(args))) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean itemdeny(int args){
  gimme.config.load();
  String x=gimme.config.getProperty("String_Node_Str").toString();
  if (x.contains(Integer.toString(args))) {
    return true;
  }
  return false;
}
Program: 6716
Project: 6716
Buggy source:
public void setupConfigs(){
  File config=new File(this.folder,"String_Node_Str");
  if (!config.exists()) {
    try {
      log.info(logPrefix + "String_Node_Str");
      log.info(logPrefix + "String_Node_Str");
      config.createNewFile();
      FileWriter fstream=new FileWriter(config);
      BufferedWriter out=new BufferedWriter(fstream);
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.close();
      fstream.close();
      log.info(logPrefix + "String_Node_Str");
    }
 catch (    IOException ex) {
      log.severe(logPrefix + "String_Node_Str");
      log.severe(logPrefix + "String_Node_Str" + ex);
      this.plugin.getServer().getPluginManager().disablePlugin((Plugin)this);
    }
  }
}

Fixed version (ground truth):
public void setupConfigs(){
  File config=new File(this.folder,"String_Node_Str");
  if (!config.exists()) {
    try {
      log.info(logPrefix + "String_Node_Str");
      log.info(logPrefix + "String_Node_Str");
      config.createNewFile();
      FileWriter fstream=new FileWriter(config);
      BufferedWriter out=new BufferedWriter(fstream);
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.close();
      fstream.close();
      log.info(logPrefix + "String_Node_Str");
    }
 catch (    IOException ex) {
      log.severe(logPrefix + "String_Node_Str");
      log.severe(logPrefix + "String_Node_Str" + ex);
      this.plugin.getServer().getPluginManager().disablePlugin((Plugin)this);
    }
  }
}
Program: 6718
Project: 6718
Buggy source:
/** 
 * Update things that need to be updated on playlists containing this track we're now sharing 
 */
public void checkPlaylistsForNewShare(SharedTrack sh){
  final List<Playlist> affectedPs=new ArrayList<Playlist>();
synchronized (this) {
    for (    Playlist p : playlists.values()) {
      if (p.getStreamIds().contains(sh.getStream().getStreamId()))       affectedPs.add(p);
    }
  }
  if (affectedPs.size() > 0 && Platform.getPlatform().iTunesAvailable()) {
    rbnb.getExecutor().execute(new CatchingRunnable(){
      public void doRun() throws Exception {
        for (        Playlist p : affectedPs) {
          PlaylistConfig pc=rbnb.getDbService().getPlaylistConfig(p.getPlaylistId());
          if (shouldITunesSync(pc))           syncITunesIfNecessary(p);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Update things that need to be updated on playlists containing this track we're now sharing 
 */
public void checkPlaylistsForNewShare(SharedTrack sh){
  final List<Playlist> affectedPs=new ArrayList<Playlist>();
synchronized (this) {
    for (    Playlist p : playlists.values()) {
      if (p.getStreamIds().contains(sh.getStream().getStreamId()))       affectedPs.add(p);
    }
  }
  if (affectedPs.size() > 0 && Platform.getPlatform().iTunesAvailable()) {
    rbnb.getExecutor().execute(new CatchingRunnable(){
      public void doRun() throws Exception {
        for (        Playlist p : affectedPs) {
          PlaylistConfig pc=rbnb.getDbService().getPlaylistConfig(p.getPlaylistId());
          if (shouldITunesSync(pc))           syncITunes(p);
        }
      }
    }
);
  }
}
Program: 6719
Project: 6719
Buggy source:
private void finishedFetchingPlaylist(Playlist p){
  long plId=p.getPlaylistId();
  log.warn("String_Node_Str" + plId);
  events.firePlaylistChanged(p);
  downloadTracksIfNecessary(p);
  comments.fetchCommentsForPlaylist(plId);
}

Fixed version (ground truth):
private void finishedFetchingPlaylist(Playlist p){
  long plId=p.getPlaylistId();
  log.warn("String_Node_Str" + plId);
  events.firePlaylistChanged(p);
  PlaylistConfig pc=db.getPlaylistConfig(p.getPlaylistId());
  downloadTracksIfNecessary(p,pc);
  if (shouldITunesSync(pc))   syncITunes(p);
  comments.fetchCommentsForPlaylist(plId);
}
Program: 6720
Project: 6720
Buggy source:
public void playlistConfigUpdated(PlaylistConfig oldPc,PlaylistConfig newPc){
  long plId=newPc.getPlaylistId();
  Playlist p;
synchronized (this) {
    p=playlists.get(plId);
  }
  if (p == null) {
    log.error("String_Node_Str" + plId + "String_Node_Str");
    return;
  }
  downloadTracksIfNecessary(p);
  if (shouldITunesSync(newPc) && !shouldITunesSync(oldPc))   syncITunesIfNecessary(p);
}

Fixed version (ground truth):
public void playlistConfigUpdated(PlaylistConfig oldPc,PlaylistConfig newPc){
  long plId=newPc.getPlaylistId();
  Playlist p;
synchronized (this) {
    p=playlists.get(plId);
  }
  if (p == null) {
    log.error("String_Node_Str" + plId + "String_Node_Str");
    return;
  }
  downloadTracksIfNecessary(p,newPc);
  if (shouldITunesSync(newPc) && !shouldITunesSync(oldPc))   syncITunes(p);
}
Program: 6721
Project: 6721
Buggy source:
private void downloadTracksIfNecessary(Playlist p){
  PlaylistConfig pc=db.getPlaylistConfig(p.getPlaylistId());
  if (((pc != null) && "String_Node_Str".equalsIgnoreCase(pc.getItem("String_Node_Str")))) {
    for (    String sid : p.getStreamIds()) {
      Track t=tracks.getTrack(sid);
      try {
        if (t instanceof CloudTrack)         rbnb.getDownloadService().addDownload(sid);
      }
 catch (      RobonoboException e) {
        log.error("String_Node_Str" + sid,e);
      }
    }
  }
}

Fixed version (ground truth):
private void downloadTracksIfNecessary(Playlist p,PlaylistConfig pc){
  if (((pc != null) && "String_Node_Str".equalsIgnoreCase(pc.getItem("String_Node_Str")))) {
    for (    String sid : p.getStreamIds()) {
      Track t=tracks.getTrack(sid);
      try {
        if (t instanceof CloudTrack)         rbnb.getDownloadService().addDownload(sid);
      }
 catch (      RobonoboException e) {
        log.error("String_Node_Str" + sid,e);
      }
    }
  }
}
Program: 6722
Project: 6722
Buggy source:
public void doRun() throws Exception {
  for (  Playlist p : affectedPs) {
    PlaylistConfig pc=rbnb.getDbService().getPlaylistConfig(p.getPlaylistId());
    if (shouldITunesSync(pc))     syncITunesIfNecessary(p);
  }
}

Fixed version (ground truth):
public void doRun() throws Exception {
  for (  Playlist p : affectedPs) {
    PlaylistConfig pc=rbnb.getDbService().getPlaylistConfig(p.getPlaylistId());
    if (shouldITunesSync(pc))     syncITunes(p);
  }
}