nus-yam/ex-repair huggingface dataset:
Program: 18426
Project: 18426
Buggy source:
private void bindComponent(ConfigurationHelper componentConf,AliasMapping aliasMapping,ComponentMapping compMapping){
  String name=componentConf.getAttribute("String_Node_Str");
  compMapping.setName(name);
  String refAlias=componentConf.getAttribute("String_Node_Str",null);
  compMapping.setRefAliases(getAliases(refAlias));
  compMapping.setDefinedInAlias(aliasMapping.getAlias());
  int maxDepth=componentConf.getAttributeAsInteger("String_Node_Str",1);
  compMapping.setMaxDepth(maxDepth);
  bindConverter(componentConf,compMapping);
  compMapping.setAccessor(componentConf.getAttribute("String_Node_Str",null));
  if (aliasMapping instanceof ClassMapping) {
    compMapping.setObjClass(((ClassMapping)aliasMapping).getClazz());
  }
  compMapping.setPropertyName(name);
  boolean override=componentConf.getAttributeAsBoolean("String_Node_Str",true);
  compMapping.setOverrideByName(override);
}

Fixed version (ground truth):
private void bindComponent(ConfigurationHelper componentConf,AliasMapping aliasMapping,ComponentMapping compMapping){
  String name=componentConf.getAttribute("String_Node_Str");
  compMapping.setName(name);
  String refAlias=componentConf.getAttribute("String_Node_Str",null);
  compMapping.setRefAliases(getAliases(refAlias));
  compMapping.setDefinedInAlias(aliasMapping.getAlias());
  int maxDepth=componentConf.getAttributeAsInteger("String_Node_Str",1);
  compMapping.setMaxDepth(maxDepth);
  bindConverter(componentConf,compMapping);
  compMapping.setAccessor(componentConf.getAttribute("String_Node_Str",null));
  compMapping.setPropertyName(name);
  boolean override=componentConf.getAttributeAsBoolean("String_Node_Str",true);
  compMapping.setOverrideByName(override);
}
Program: 18429
Project: 18429
Buggy source:
private void processMapping(Mapping mapping,Object fatherObject,PropertyAccessorFactory propertyAccessorFactory) throws MappingException {
  if (!(mapping instanceof ObjectMapping)) {
    return;
  }
  ObjectMapping objectMapping=(ObjectMapping)mapping;
  Class clazz=objectMapping.getObjClass();
  if (clazz == null) {
    if (fatherObject instanceof ObjectMapping) {
      clazz=((ObjectMapping)fatherObject).getObjClass();
    }
 else {
      clazz=(Class)fatherObject;
    }
    objectMapping.setObjClass(clazz);
  }
  PropertyAccessor pAccessor=propertyAccessorFactory.getPropertyAccessor(objectMapping.getAccessor());
  objectMapping.setGetter(pAccessor.getGetter(clazz,objectMapping.getPropertyName()));
  objectMapping.setSetter(pAccessor.getSetter(clazz,objectMapping.getPropertyName()));
  if (mapping instanceof MultipleMapping) {
    MultipleMapping multipleMapping=(MultipleMapping)mapping;
    for (Iterator it=multipleMapping.mappingsIt(); it.hasNext(); ) {
      processMapping((Mapping)it.next(),objectMapping,propertyAccessorFactory);
    }
  }
}

Fixed version (ground truth):
private void processMapping(Mapping mapping,Class clazz,PropertyAccessorFactory propertyAccessorFactory) throws MappingException {
  if (!(mapping instanceof ObjectMapping)) {
    return;
  }
  ObjectMapping objectMapping=(ObjectMapping)mapping;
  objectMapping.setObjClass(clazz);
  PropertyAccessor pAccessor=propertyAccessorFactory.getPropertyAccessor(objectMapping.getAccessor());
  objectMapping.setGetter(pAccessor.getGetter(clazz,objectMapping.getPropertyName()));
  objectMapping.setSetter(pAccessor.getSetter(clazz,objectMapping.getPropertyName()));
  if (mapping instanceof MultipleMapping) {
    MultipleMapping multipleMapping=(MultipleMapping)mapping;
    for (Iterator it=multipleMapping.mappingsIt(); it.hasNext(); ) {
      processMapping((Mapping)it.next(),clazz,propertyAccessorFactory);
    }
  }
}
Program: 18430
Project: 18430
Buggy source:
/** 
 * Since we did not process duplicate mappings, we need to replace them with the original mappings that were processed (for example, we added intenral ids to it where needed).
 */
protected void onDuplicateMapping(ClassMapping classMapping,ObjectMapping actualMapping,ObjectMapping duplicateMapping){
  Assert.isTrue(actualMapping.getName().equals(duplicateMapping.getName()),"String_Node_Str" + duplicateMapping + "String_Node_Str"+ actualMapping.getName()+ "String_Node_Str");
  classMapping.mappingsByNameMap.put(duplicateMapping.getName(),actualMapping);
  int index=classMapping.mappings.indexOf(duplicateMapping);
  if (index < 0) {
    for (int i=0; i < classMapping.mappings.size(); i++) {
      Object o=classMapping.mappings.get(i);
      if (o instanceof AbstractCollectionMapping) {
        AbstractCollectionMapping temp=(AbstractCollectionMapping)o;
        if (temp.getElementMapping() == duplicateMapping) {
          temp.setElementMapping(actualMapping);
          index=i;
          break;
        }
      }
    }
  }
  if (index < 0) {
    throw new IllegalStateException("String_Node_Str" + duplicateMapping.getName() + "String_Node_Str");
  }
 else {
    classMapping.mappings.set(index,actualMapping);
  }
}

Fixed version (ground truth):
/** 
 * <p>Since we did not process duplicate mappings, we need to replace them with the original mappings that were processed (for example, we added intenral ids to it where needed).
 */
protected void onDuplicateMapping(ClassMapping classMapping,ObjectMapping actualMapping,ObjectMapping duplicateMapping){
  Assert.isTrue(actualMapping.getName().equals(duplicateMapping.getName()),"String_Node_Str" + duplicateMapping.getName() + "String_Node_Str"+ actualMapping.getName()+ "String_Node_Str");
  int index=classMapping.mappings.indexOf(duplicateMapping);
  if (index < 0) {
    for (int i=0; i < classMapping.mappings.size(); i++) {
      Object o=classMapping.mappings.get(i);
      if (o instanceof AbstractCollectionMapping) {
        AbstractCollectionMapping temp=(AbstractCollectionMapping)o;
        if (temp.getElementMapping() == duplicateMapping) {
          temp.setElementMapping(actualMapping);
          index=i;
          break;
        }
      }
    }
  }
 else {
    classMapping.mappingsByNameMap.put(duplicateMapping.getName(),actualMapping);
    classMapping.mappings.set(index,actualMapping);
  }
  if (index < 0) {
    throw new IllegalStateException("String_Node_Str" + duplicateMapping.getName() + "String_Node_Str");
  }
}
Program: 18431
Project: 18431
Buggy source:
public void testPersons() throws Exception {
  CompassSession session=openSession();
  CompassTransaction tr=session.beginTransaction();
  Person person=new SpecialPerson();
  person.id=1;
  person.description="String_Node_Str";
  person.names=new ArrayList();
  PersonName personName=new PersonName();
  personName.names=new ArrayList();
  personName.names.add("String_Node_Str");
  personName.names.add("String_Node_Str");
  person.names.add(personName);
  session.save(person);
  person=(Person)session.load(SpecialPerson.class,new Integer(1));
  assertEquals("String_Node_Str",person.description);
  assertEquals(1,person.names.size());
  tr.commit();
  session.close();
}

Fixed version (ground truth):
public void testPersons() throws Exception {
  CompassSession session=openSession();
  CompassTransaction tr=session.beginTransaction();
  Person person=new SpecialPerson();
  person.id=1;
  person.description="String_Node_Str";
  person.names=new ArrayList();
  PersonName personName=new PersonName();
  personName.names=new ArrayList();
  personName.names.add("String_Node_Str");
  personName.names.add("String_Node_Str");
  person.names.add(personName);
  session.save(person);
  User user=new User();
  user.id=1;
  user.description="String_Node_Str";
  user.identity=person;
  session.save(user);
  person=(Person)session.load(SpecialPerson.class,new Integer(1));
  assertEquals("String_Node_Str",person.description);
  assertEquals(1,person.names.size());
  personName=(PersonName)person.names.get(0);
  assertEquals(2,personName.names.size());
  user=(User)session.load(User.class,"String_Node_Str");
  assertEquals("String_Node_Str",user.description);
  person=user.identity;
  assertEquals("String_Node_Str",person.description);
  assertEquals(1,person.names.size());
  personName=(PersonName)person.names.get(0);
  assertEquals(2,personName.names.size());
  tr.commit();
  session.close();
}
Program: 18432
Project: 18432
Buggy source:
/** 
 * <p>Since we did not process duplicate mappings, we need to replace them with the original mappings that were processed (for example, we added intenral ids to it where needed).
 */
protected void onDuplicateMapping(ClassMapping classMapping,ObjectMapping actualMapping,ObjectMapping duplicateMapping){
  Assert.isTrue(actualMapping.getName().equals(duplicateMapping.getName()),"String_Node_Str" + duplicateMapping.getName() + "String_Node_Str"+ actualMapping.getName()+ "String_Node_Str");
  int index=classMapping.mappings.indexOf(duplicateMapping);
  if (index < 0) {
    for (int i=0; i < classMapping.mappings.size(); i++) {
      Object o=classMapping.mappings.get(i);
      if (o instanceof AbstractCollectionMapping) {
        AbstractCollectionMapping temp=(AbstractCollectionMapping)o;
        if (temp.getElementMapping() == duplicateMapping) {
          temp.setElementMapping(actualMapping);
          index=i;
          break;
        }
      }
    }
  }
 else {
    classMapping.mappingsByNameMap.put(duplicateMapping.getName(),actualMapping);
    classMapping.mappings.set(index,actualMapping);
  }
  if (index < 0) {
    throw new IllegalStateException("String_Node_Str" + duplicateMapping.getName() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * <p>Since we did not process duplicate mappings, we need to replace them with the original mappings that were processed (for example, we added intenral ids to it where needed).
 */
protected void onDuplicateMapping(ClassMapping classMapping,ObjectMapping actualMapping,ObjectMapping duplicateMapping){
  Assert.isTrue(actualMapping.getPropertyName().equals(duplicateMapping.getPropertyName()),"String_Node_Str" + duplicateMapping.getName() + "String_Node_Str"+ actualMapping.getName()+ "String_Node_Str");
  int index=classMapping.mappings.indexOf(duplicateMapping);
  if (index < 0) {
    for (int i=0; i < classMapping.mappings.size(); i++) {
      Object o=classMapping.mappings.get(i);
      if (o instanceof AbstractCollectionMapping) {
        AbstractCollectionMapping temp=(AbstractCollectionMapping)o;
        if (temp.getElementMapping() == duplicateMapping) {
          temp.setElementMapping(actualMapping);
          index=i;
          break;
        }
      }
    }
  }
 else {
    classMapping.mappingsByNameMap.put(duplicateMapping.getName(),actualMapping);
    classMapping.mappings.set(index,actualMapping);
  }
  if (index < 0) {
    throw new IllegalStateException("String_Node_Str" + duplicateMapping.getName() + "String_Node_Str");
  }
}
Program: 18433
Project: 18433
Buggy source:
void setAccessor(String accessor);

Fixed version (ground truth):
/** 
 * Sets the accessor type for this mapping. The accessor type can be field, property or a custom implementation of   {@link org.compass.core.accessor.PropertyAccessor}(this can be either the FQN of the class name or a regsitered type in the configuration, see  {@link org.compass.core.accessor.PropertyAccessorFactory}.
 */
void setAccessor(String accessor);
Program: 18434
Project: 18434
Buggy source:
void setPropertyName(String propertyName);

Fixed version (ground truth):
/** 
 * Sets the class property name of the object mapping.
 */
void setPropertyName(String propertyName);
Program: 18435
Project: 18435
Buggy source:
Class getObjClass();

Fixed version (ground truth):
/** 
 * Returns the class of the class mapping this object belongs to.
 */
Class getObjClass();
Program: 18436
Project: 18436
Buggy source:
String getAccessor();

Fixed version (ground truth):
/** 
 * Returns the accessor type for this mapping. The accessor type can be field, property or a custom implementation of   {@link org.compass.core.accessor.PropertyAccessor}(this can be either the FQN of the class name or a regsitered type in the configuration, see  {@link org.compass.core.accessor.PropertyAccessorFactory}.
 */
String getAccessor();
Program: 18437
Project: 18437
Buggy source:
boolean canBeCollectionWrapped();

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if this object mapping can be wrapped with a Collection or an Array.
 */
boolean canBeCollectionWrapped();
Program: 18438
Project: 18438
Buggy source:
void setDefinedInAlias(String alias);

Fixed version (ground truth):
/** 
 * Sets which alias (or if not present, the FQN of the class name) this object property is defined at.
 */
void setDefinedInAlias(String alias);
Program: 18439
Project: 18439
Buggy source:
String getPropertyName();

Fixed version (ground truth):
/** 
 * Returns the class property name of the object mapping.
 */
String getPropertyName();
Program: 18440
Project: 18440
Buggy source:
void setObjClass(Class objClass);

Fixed version (ground truth):
/** 
 * Sets the class of the class mapping this object belongs to.
 */
void setObjClass(Class objClass);
Program: 18441
Project: 18441
Buggy source:
/** 
 * Returns which alias (or if not present, the FQN of the class name) this object property is defined.
 */
String getDefinedInAlias();

Fixed version (ground truth):
/** 
 * Returns which alias (or if not present, the FQN of the class name) this object property is defined at.
 */
String getDefinedInAlias();
Program: 18443
Project: 18443
Buggy source:
private void bindObjectMapping(ObjectMapping objectMapping,String actualAccessor,String name,String annotationAccessor,Class<?> searchableClass){
  if (!StringUtils.hasLength(annotationAccessor)) {
    objectMapping.setAccessor(actualAccessor);
  }
 else {
    objectMapping.setAccessor(annotationAccessor);
  }
  objectMapping.setName(name);
  objectMapping.setObjClass(classMapping.getClazz());
  objectMapping.setPropertyName(name);
  if (searchableClass.isAnnotationPresent(Searchable.class)) {
    Searchable searchable=searchableClass.getAnnotation(Searchable.class);
    if (StringUtils.hasLength(searchable.alias())) {
      objectMapping.setDefinedInAlias(searchable.alias());
    }
 else {
      objectMapping.setDefinedInAlias(searchableClass.getName());
    }
  }
 else {
    objectMapping.setDefinedInAlias(searchableClass.getName());
  }
}

Fixed version (ground truth):
private void bindObjectMapping(ObjectMapping objectMapping,String actualAccessor,String name,String annotationAccessor,Class<?> searchableClass){
  if (!StringUtils.hasLength(annotationAccessor)) {
    objectMapping.setAccessor(actualAccessor);
  }
 else {
    objectMapping.setAccessor(annotationAccessor);
  }
  objectMapping.setName(name);
  objectMapping.setPropertyName(name);
  if (searchableClass.isAnnotationPresent(Searchable.class)) {
    Searchable searchable=searchableClass.getAnnotation(Searchable.class);
    if (StringUtils.hasLength(searchable.alias())) {
      objectMapping.setDefinedInAlias(searchable.alias());
    }
 else {
      objectMapping.setDefinedInAlias(searchableClass.getName());
    }
  }
 else {
    objectMapping.setDefinedInAlias(searchableClass.getName());
  }
}
Program: 18444
Project: 18444
Buggy source:
private void bindMetaData(SearchableMetaData searchableMetaData,ClassPropertyMapping classPropertyMapping,Class<?> clazz,Type type){
  ClassPropertyMetaDataMapping mdMapping=new ClassPropertyMetaDataMapping();
  String name=searchableMetaData.name();
  mdMapping.setName(valueLookup.lookupMetaDataName(name));
  mdMapping.setPath(new StaticPropertyPath(mdMapping.getName()));
  if (searchableMetaData.boost() == 1.0f) {
    mdMapping.setBoost(classPropertyMapping.getBoost());
  }
 else {
    mdMapping.setBoost(searchableMetaData.boost());
  }
  bindConverter(mdMapping,searchableMetaData.converter(),clazz,type);
  mdMapping.setAccessor(classPropertyMapping.getAccessor());
  mdMapping.setObjClass(classPropertyMapping.getObjClass());
  mdMapping.setPropertyName(classPropertyMapping.getPropertyName());
  mdMapping.setStore(AnnotationsBindingUtils.convert(searchableMetaData.store()));
  mdMapping.setIndex(AnnotationsBindingUtils.convert(searchableMetaData.index()));
  mdMapping.setTermVector(AnnotationsBindingUtils.convert(searchableMetaData.termVector()));
  mdMapping.setReverse(AnnotationsBindingUtils.convert(searchableMetaData.reverse()));
  handleFormat(mdMapping,name,searchableMetaData.format());
  mdMapping.setInternal(false);
  if (StringUtils.hasLength(searchableMetaData.analyzer())) {
    mdMapping.setAnalyzer(searchableMetaData.analyzer());
  }
  mdMapping.setExcludeFromAll(searchableMetaData.excludeFromAll());
  classPropertyMapping.addMapping(mdMapping);
}

Fixed version (ground truth):
private void bindMetaData(SearchableMetaData searchableMetaData,ClassPropertyMapping classPropertyMapping,Class<?> clazz,Type type){
  ClassPropertyMetaDataMapping mdMapping=new ClassPropertyMetaDataMapping();
  String name=searchableMetaData.name();
  mdMapping.setName(valueLookup.lookupMetaDataName(name));
  mdMapping.setPath(new StaticPropertyPath(mdMapping.getName()));
  if (searchableMetaData.boost() == 1.0f) {
    mdMapping.setBoost(classPropertyMapping.getBoost());
  }
 else {
    mdMapping.setBoost(searchableMetaData.boost());
  }
  bindConverter(mdMapping,searchableMetaData.converter(),clazz,type);
  mdMapping.setAccessor(classPropertyMapping.getAccessor());
  mdMapping.setPropertyName(classPropertyMapping.getPropertyName());
  mdMapping.setStore(AnnotationsBindingUtils.convert(searchableMetaData.store()));
  mdMapping.setIndex(AnnotationsBindingUtils.convert(searchableMetaData.index()));
  mdMapping.setTermVector(AnnotationsBindingUtils.convert(searchableMetaData.termVector()));
  mdMapping.setReverse(AnnotationsBindingUtils.convert(searchableMetaData.reverse()));
  handleFormat(mdMapping,name,searchableMetaData.format());
  mdMapping.setInternal(false);
  if (StringUtils.hasLength(searchableMetaData.analyzer())) {
    mdMapping.setAnalyzer(searchableMetaData.analyzer());
  }
  mdMapping.setExcludeFromAll(searchableMetaData.excludeFromAll());
  classPropertyMapping.addMapping(mdMapping);
}
Program: 18446
Project: 18446
Buggy source:
public CompassMapping process(CompassMapping compassMapping,PropertyNamingStrategy namingStrategy,ConverterLookup converterLookup,CompassSettings settings) throws MappingException {
  PropertyAccessorFactory propertyAccessorFactory=new PropertyAccessorFactory();
  propertyAccessorFactory.configure(settings);
  for (Iterator rIt=compassMapping.mappingsIt(); rIt.hasNext(); ) {
    Mapping mapping=(Mapping)rIt.next();
    if (mapping instanceof ClassMapping) {
      ClassMapping classMapping=(ClassMapping)mapping;
      classMapping.setConstructor(ClassUtils.getDefaultConstructor(classMapping.getClazz()));
      if (!Modifier.isAbstract(classMapping.getClazz().getModifiers()) && !Modifier.isInterface(classMapping.getClazz().getModifiers())) {
        if (classMapping.getConstructor() == null) {
          throw new MappingException("String_Node_Str" + classMapping.getName() + "String_Node_Str");
        }
      }
      if (classMapping.getPolyClass() != null) {
        classMapping.setPolyConstructor(ClassUtils.getDefaultConstructor(classMapping.getPolyClass()));
      }
      for (Iterator it=classMapping.mappingsIt(); it.hasNext(); ) {
        processMapping((Mapping)it.next(),classMapping.getClazz(),propertyAccessorFactory);
      }
    }
  }
  return compassMapping;
}

Fixed version (ground truth):
public CompassMapping process(CompassMapping compassMapping,PropertyNamingStrategy namingStrategy,ConverterLookup converterLookup,CompassSettings settings) throws MappingException {
  propertyAccessorFactory=new PropertyAccessorFactory();
  propertyAccessorFactory.configure(settings);
  for (Iterator rIt=compassMapping.mappingsIt(); rIt.hasNext(); ) {
    Mapping mapping=(Mapping)rIt.next();
    if (mapping instanceof ClassMapping) {
      ClassMapping classMapping=(ClassMapping)mapping;
      classMapping.setConstructor(ClassUtils.getDefaultConstructor(classMapping.getClazz()));
      if (!Modifier.isAbstract(classMapping.getClazz().getModifiers()) && !Modifier.isInterface(classMapping.getClazz().getModifiers())) {
        if (classMapping.getConstructor() == null) {
          throw new MappingException("String_Node_Str" + classMapping.getName() + "String_Node_Str");
        }
      }
      if (classMapping.getPolyClass() != null) {
        classMapping.setPolyConstructor(ClassUtils.getDefaultConstructor(classMapping.getPolyClass()));
      }
      Class clazz=classMapping.getClazz();
      if (classMapping.isPoly() && classMapping.getPolyClass() != null) {
        clazz=classMapping.getPolyClass();
      }
      for (Iterator it=classMapping.mappingsIt(); it.hasNext(); ) {
        processMapping((Mapping)it.next(),clazz);
      }
    }
  }
  return compassMapping;
}
Program: 18447
Project: 18447
Buggy source:
private void processMapping(Mapping mapping,Class clazz,PropertyAccessorFactory propertyAccessorFactory) throws MappingException {
  if (!(mapping instanceof ObjectMapping)) {
    return;
  }
  ObjectMapping objectMapping=(ObjectMapping)mapping;
  objectMapping.setObjClass(clazz);
  PropertyAccessor pAccessor=propertyAccessorFactory.getPropertyAccessor(objectMapping.getAccessor());
  objectMapping.setGetter(pAccessor.getGetter(clazz,objectMapping.getPropertyName()));
  objectMapping.setSetter(pAccessor.getSetter(clazz,objectMapping.getPropertyName()));
  if (mapping instanceof MultipleMapping) {
    MultipleMapping multipleMapping=(MultipleMapping)mapping;
    for (Iterator it=multipleMapping.mappingsIt(); it.hasNext(); ) {
      processMapping((Mapping)it.next(),clazz,propertyAccessorFactory);
    }
  }
}

Fixed version (ground truth):
private void processMapping(Mapping mapping,Class clazz) throws MappingException {
  if (!(mapping instanceof ObjectMapping)) {
    return;
  }
  ObjectMapping objectMapping=(ObjectMapping)mapping;
  PropertyAccessor pAccessor=propertyAccessorFactory.getPropertyAccessor(objectMapping.getAccessor());
  objectMapping.setGetter(pAccessor.getGetter(clazz,objectMapping.getPropertyName()));
  objectMapping.setSetter(pAccessor.getSetter(clazz,objectMapping.getPropertyName()));
  if (mapping instanceof MultipleMapping) {
    MultipleMapping multipleMapping=(MultipleMapping)mapping;
    for (Iterator it=multipleMapping.mappingsIt(); it.hasNext(); ) {
      processMapping((Mapping)it.next(),clazz);
    }
  }
}
Program: 18448
Project: 18448
Buggy source:
protected void copy(AbstractAccessorMapping copy){
  super.copy(copy);
  copy.setGetter(getGetter());
  copy.setSetter(getSetter());
  copy.setAccessor(getAccessor());
  copy.setObjClass(getObjClass());
  copy.setPropertyName(getPropertyName());
  copy.setDefinedInAlias(getDefinedInAlias());
}

Fixed version (ground truth):
protected void copy(AbstractAccessorMapping copy){
  super.copy(copy);
  copy.setGetter(getGetter());
  copy.setSetter(getSetter());
  copy.setAccessor(getAccessor());
  copy.setPropertyName(getPropertyName());
  copy.setDefinedInAlias(getDefinedInAlias());
}
Program: 18449
Project: 18449
Buggy source:
public Mapping copy(){
  ClassPropertyMetaDataMapping copy=new ClassPropertyMetaDataMapping();
  super.copy(copy);
  copy.setSetter(getSetter());
  copy.setGetter(getGetter());
  copy.setAccessor(getAccessor());
  copy.setObjClass(getObjClass());
  copy.setPropertyName(getPropertyName());
  return copy;
}

Fixed version (ground truth):
public Mapping copy(){
  ClassPropertyMetaDataMapping copy=new ClassPropertyMetaDataMapping();
  super.copy(copy);
  copy.setSetter(getSetter());
  copy.setGetter(getGetter());
  copy.setAccessor(getAccessor());
  copy.setPropertyName(getPropertyName());
  return copy;
}
Program: 18450
Project: 18450
Buggy source:
protected void doParse(Element element,BeanDefinitionBuilder beanDefinitionBuilder){
  if (element.getLocalName().equals("String_Node_Str")) {
    String id=element.getAttribute("String_Node_Str");
    element.setAttribute(ID_ATTRIBUTE,id);
    SchemaConfigurationBuilder schemaConfigurationBuilder=new SchemaConfigurationBuilder();
    CompassConfiguration config=CompassConfigurationFactory.newConfiguration();
    schemaConfigurationBuilder.processCompass(element,config);
    beanDefinitionBuilder.addPropertyValue("String_Node_Str",config);
    String txManagerRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (txManagerRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",txManagerRef);
    }
    String dataSourceRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (dataSourceRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",dataSourceRef);
    }
  }
 else   if (element.getLocalName().equals("String_Node_Str")) {
    element.setAttribute(ID_ATTRIBUTE,"String_Node_Str" + System.currentTimeMillis());
  }
 else   if (element.getLocalName().equals("String_Node_Str")) {
    String compassRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (compassRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",compassRef);
    }
  }
}

Fixed version (ground truth):
protected void doParse(Element element,BeanDefinitionBuilder beanDefinitionBuilder){
  if (element.getLocalName().equals("String_Node_Str")) {
    String id=element.getAttribute("String_Node_Str");
    element.setAttribute(ID_ATTRIBUTE,id);
    SchemaConfigurationBuilder schemaConfigurationBuilder=new SchemaConfigurationBuilder();
    CompassConfiguration config=CompassConfigurationFactory.newConfiguration();
    schemaConfigurationBuilder.processCompass(element,config);
    beanDefinitionBuilder.addPropertyValue("String_Node_Str",config);
    String txManagerRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (txManagerRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",txManagerRef);
    }
    String dataSourceRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (dataSourceRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",dataSourceRef);
    }
    String postProcessRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (postProcessRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",postProcessRef);
    }
  }
 else   if (element.getLocalName().equals("String_Node_Str")) {
    element.setAttribute(ID_ATTRIBUTE,"String_Node_Str" + System.currentTimeMillis());
  }
 else   if (element.getLocalName().equals("String_Node_Str")) {
    String compassRef=DomUtils.getElementAttribute(element,"String_Node_Str");
    if (compassRef != null) {
      beanDefinitionBuilder.addPropertyReference("String_Node_Str",compassRef);
    }
  }
}
Program: 18452
Project: 18452
Buggy source:
private void validateDuplicateExcludeFromAll(ResourceMapping resourceMapping,String propertyName,ResourcePropertyMapping[] resourcePropertyMapping) throws MappingException {
  if (resourcePropertyMapping.length == 1) {
    return;
  }
  boolean excludeFromAll=resourcePropertyMapping[0].isExcludeFromAll();
  for (int i=1; i < resourcePropertyMapping.length; i++) {
    if (excludeFromAll != resourcePropertyMapping[i].isExcludeFromAll()) {
      throw new InvalidMappingException("String_Node_Str" + propertyName + "String_Node_Str"+ resourceMapping.getAlias()+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void validateDuplicateExcludeFromAll(ResourceMapping resourceMapping,String propertyName,ResourcePropertyMapping[] resourcePropertyMapping) throws MappingException {
  if (resourcePropertyMapping.length == 1) {
    return;
  }
  boolean excludeFromAll=resourcePropertyMapping[0].isExcludeFromAll();
  for (int i=1; i < resourcePropertyMapping.length; i++) {
    if (resourcePropertyMapping[i].isInternal()) {
      continue;
    }
    if (excludeFromAll != resourcePropertyMapping[i].isExcludeFromAll()) {
      throw new InvalidMappingException("String_Node_Str" + propertyName + "String_Node_Str"+ resourceMapping.getAlias()+ "String_Node_Str");
    }
  }
}
Program: 18453
Project: 18453
Buggy source:
public CompassSettings copy(){
  return new CompassSettings((Properties)settings.clone());
}

Fixed version (ground truth):
public CompassSettings copy(){
  CompassSettings copySettings=new CompassSettings((Properties)settings.clone());
  copySettings.setRegistry(getRegistry());
  return copySettings;
}
Program: 18454
Project: 18454
Buggy source:
public void start(){
  indexManager.start();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + settings.getIndexManagerScheduleInterval() + "String_Node_Str");
  }
  scheduledExecutorService=Executors.newSingleThreadScheduledExecutor(new SingleThreadThreadFactory("String_Node_Str",true));
  ScheduledIndexManagerRunnable scheduledIndexManagerRunnable=new ScheduledIndexManagerRunnable(indexManager);
  long period=settings.getIndexManagerScheduleInterval();
  scheduledExecutorService.scheduleWithFixedDelay(scheduledIndexManagerRunnable,period,period,TimeUnit.MILLISECONDS);
  setWaitForCacheInvalidationBeforeSecondStep((long)(settings.getIndexManagerScheduleInterval() * 1.1));
}

Fixed version (ground truth):
public void start(){
  indexManager.start();
  if (settings.getIndexManagerScheduleInterval() < 0) {
    log.info("String_Node_Str");
    return;
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + settings.getIndexManagerScheduleInterval() + "String_Node_Str");
  }
  scheduledExecutorService=Executors.newSingleThreadScheduledExecutor(new SingleThreadThreadFactory("String_Node_Str",true));
  ScheduledIndexManagerRunnable scheduledIndexManagerRunnable=new ScheduledIndexManagerRunnable(indexManager);
  long period=settings.getIndexManagerScheduleInterval();
  scheduledExecutorService.scheduleWithFixedDelay(scheduledIndexManagerRunnable,period,period,TimeUnit.MILLISECONDS);
  setWaitForCacheInvalidationBeforeSecondStep((long)(settings.getIndexManagerScheduleInterval() * 1.1));
}
Program: 18455
Project: 18455
Buggy source:
protected Directory doGetDirectoryForPath(String path,boolean create) throws SearchEngineException {
  String totalPath=subContext + "String_Node_Str" + path;
  JdbcTable jdbcTable=(JdbcTable)cachedJdbcTables.get(totalPath);
  if (jdbcTable == null) {
    jdbcTable=new JdbcTable(jdbcSettings,dialect,totalPath);
    cachedJdbcTables.put(totalPath,jdbcTable);
  }
  JdbcDirectory dir=new JdbcDirectory(dataSource,jdbcTable);
  if (create) {
    try {
      createDirectory(dir);
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + path + "String_Node_Str",e);
    }
  }
  return dir;
}

Fixed version (ground truth):
protected Directory doGetDirectoryForPath(String path,boolean create) throws SearchEngineException {
  String totalPath=subContext + "String_Node_Str" + path;
  JdbcTable jdbcTable=(JdbcTable)cachedJdbcTables.get(totalPath);
  if (jdbcTable == null) {
    jdbcTable=new JdbcTable(jdbcSettings,dialect,totalPath);
    cachedJdbcTables.put(totalPath,jdbcTable);
  }
  JdbcDirectory dir=new JdbcDirectory(dataSource,jdbcTable);
  if (create) {
    try {
      createDirectory(dir);
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + totalPath + "String_Node_Str",e);
    }
  }
  return dir;
}
Program: 18456
Project: 18456
Buggy source:
public void closeDataSource(){
  dataSourceHolder.set(null);
}

Fixed version (ground truth):
public void closeDataSource(){
  dataSourceHolder.set(null);
  settings.getRegistry().put(dataSourceKey,null);
}
Program: 18457
Project: 18457
Buggy source:
protected DataSource doCreateDataSource(String url,CompassSettings settings) throws CompassException {
  DataSource dataSource=(DataSource)dataSourceHolder.get();
  return new UsernamePasswordDataSourceWrapper(dataSource,username,password,autoCommit);
}

Fixed version (ground truth):
protected DataSource doCreateDataSource(String url,CompassSettings settings) throws CompassException {
  this.settings=settings;
  DataSource dataSource=(DataSource)dataSourceHolder.get();
  if (dataSource == null) {
    dataSource=(DataSource)settings.getRegistry().get(dataSourceKey);
  }
  if (dataSource == null) {
    throw new CompassException("String_Node_Str");
  }
 else {
    settings.getRegistry().put(dataSourceKey,dataSource);
    dataSourceHolder.set(null);
  }
  return new UsernamePasswordDataSourceWrapper(dataSource,username,password,autoCommit);
}
Program: 18458
Project: 18458
Buggy source:
public LocalTransaction(InternalCompassSession session,TransactionIsolation transactionIsolation){
  state=UNKNOWN;
  this.session=session;
  this.transactionIsolation=transactionIsolation;
}

Fixed version (ground truth):
public LocalTransaction(InternalCompassSession session,TransactionIsolation transactionIsolation){
  state=UNKNOWN;
  this.session=session;
  this.compass=session.getCompass();
  this.transactionIsolation=transactionIsolation;
}
Program: 18459
Project: 18459
Buggy source:
protected void doRollback() throws CompassException {
  if (state == UNKNOWN) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + "String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
    }
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
    }
    CompassSessionHolder holder=TransactionSessionManager.getHolder(session.getCompass());
    holder.removeSession();
  }
  state=ROLLBACK;
  session.evictAll();
  session.getSearchEngine().rollback();
}

Fixed version (ground truth):
protected void doRollback() throws CompassException {
  if (state == UNKNOWN) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + "String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
    }
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
    }
    CompassSessionHolder holder=TransactionSessionManager.getHolder(session.getCompass());
    holder.removeSession();
  }
  state=ROLLBACK;
  session.evictAll();
  session.getSearchEngine().rollback();
}
Program: 18460
Project: 18460
Buggy source:
public void join() throws CompassException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void join() throws CompassException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
  }
}
Program: 18461
Project: 18461
Buggy source:
public void begin() throws CompassException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
  }
  session.getSearchEngine().begin(transactionIsolation);
  state=STARTED;
}

Fixed version (ground truth):
public void begin() throws CompassException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
  }
  session.getSearchEngine().begin(transactionIsolation);
  state=STARTED;
}
Program: 18462
Project: 18462
Buggy source:
protected void doCommit() throws CompassException {
  if (session.getSearchEngine().wasRolledBack()) {
  }
  if (state == UNKNOWN) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
    return;
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str");
  }
  CompassSessionHolder holder=TransactionSessionManager.getHolder(session.getCompass());
  holder.removeSession();
  session.evictAll();
  session.getSearchEngine().commit(true);
  state=COMMIT;
}

Fixed version (ground truth):
protected void doCommit() throws CompassException {
  if (session.getSearchEngine().wasRolledBack()) {
  }
  if (state == UNKNOWN) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
    return;
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + Thread.currentThread().getName() + "String_Node_Str"+ System.identityHashCode(compass)+ "String_Node_Str"+ System.identityHashCode(session)+ "String_Node_Str");
  }
  CompassSessionHolder holder=TransactionSessionManager.getHolder(session.getCompass());
  holder.removeSession();
  session.evictAll();
  session.getSearchEngine().commit(true);
  state=COMMIT;
}
Program: 18463
Project: 18463
Buggy source:
protected void doConfigure(CompassSettings settings){
  this.transactionManager=(PlatformTransactionManager)transactionManagerHolder.get();
  transactionManagerHolder.set(null);
}

Fixed version (ground truth):
protected void doConfigure(CompassSettings settings){
  this.transactionManager=(PlatformTransactionManager)transactionManagerHolder.get();
  if (transactionManager == null) {
    transactionManager=(PlatformTransactionManager)settings.getRegistry().get(transactionManagerKey);
  }
  if (transactionManager != null) {
    settings.getRegistry().put(transactionManagerKey,transactionManager);
  }
  transactionManagerHolder.set(null);
}
Program: 18465
Project: 18465
Buggy source:
public void testScheduledOptimizer(){
  MockOptimizer optimizer=(MockOptimizer)((DefaultCompass.TransactionalSearchEngineOptimizer)((ScheduledLuceneSearchEngineOptimizer)getCompass().getSearchEngineOptimizer()).getWrappedOptimizer()).getWrappedOptimizer();
  assertTrue(getCompass().getSearchEngineOptimizer().isRunning());
  optimizer.clear();
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertTrue(optimizer.isNeedOptimizingCalled());
  assertFalse(optimizer.isOptimizeCalled());
  optimizer.clear();
  optimizer.setNeedOptimizing(true);
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertTrue(optimizer.isNeedOptimizingCalled());
  assertTrue(optimizer.isOptimizeCalled());
  getCompass().getSearchEngineOptimizer().stop();
  assertFalse(getCompass().getSearchEngineOptimizer().isRunning());
  optimizer.clear();
  optimizer.setNeedOptimizing(true);
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertFalse(optimizer.isNeedOptimizingCalled());
  assertFalse(optimizer.isOptimizeCalled());
}

Fixed version (ground truth):
public void testScheduledOptimizer(){
  MockOptimizer optimizer=(MockOptimizer)((DefaultCompass.TransactionalSearchEngineOptimizer)((ScheduledLuceneSearchEngineOptimizer)getCompass().getSearchEngineOptimizer()).getWrappedOptimizer()).getWrappedOptimizer();
  assertTrue(getCompass().getSearchEngineOptimizer().isRunning());
  optimizer.clear();
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertTrue(optimizer.isNeedOptimizingCalled());
  assertFalse(optimizer.isOptimizeCalled());
  optimizer.clear();
  optimizer.setNeedOptimizing(true);
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertTrue(optimizer.isNeedOptimizingCalled());
  assertTrue(optimizer.isOptimizeCalled());
  getCompass().getSearchEngineOptimizer().stop();
  assertFalse(getCompass().getSearchEngineOptimizer().isRunning());
  try {
    Thread.sleep(100);
    optimizer.clear();
    optimizer.setNeedOptimizing(true);
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
  }
  assertFalse(optimizer.isNeedOptimizingCalled());
  assertFalse(optimizer.isOptimizeCalled());
}
Program: 18466
Project: 18466
Buggy source:
public T dequeue(){
  if (head == null) {
    return null;
  }
  if (head.equals(tail)) {
    Node<T> result=tail;
    tail=head;
    size--;
    return result.getValue();
  }
  Node<T> currNode=head;
  while (currNode.getNext() != null) {
    if (currNode.getNext().equals(tail)) {
      Node<T> result=currNode.getNext();
      tail=currNode;
      size--;
      return result.getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
public T dequeue(){
  if (head == null) {
    return null;
  }
  if (head.equals(tail)) {
    Node<T> result=tail;
    head=null;
    tail=null;
    size--;
    return result.getValue();
  }
  Node<T> currNode=head;
  while (currNode.getNext() != null) {
    if (currNode.getNext().equals(tail)) {
      Node<T> result=currNode.getNext();
      tail=currNode;
      size--;
      return result.getValue();
    }
    currNode=currNode.getNext();
  }
  return null;
}
Program: 18467
Project: 18467
Buggy source:
@Test public void testEnqueueAndDequeue(){
  Queue<Integer> queue=new Queue<Integer>();
  Assert.assertEquals(0,queue.getSize());
  queue.enqueue(12345);
  Assert.assertEquals(1,queue.getSize());
  int result=queue.dequeue();
  Assert.assertEquals(12345,result);
  Assert.assertEquals(0,queue.getSize());
}

Fixed version (ground truth):
@Test public void testEnqueueAndDequeue(){
  Queue<Integer> queue=new Queue<Integer>();
  Assert.assertEquals(0,queue.getSize());
  queue.enqueue(12345);
  Assert.assertEquals(1,queue.getSize());
  int result=queue.dequeue();
  Assert.assertEquals(12345,result);
  Assert.assertEquals(0,queue.getSize());
  queue.enqueue(1);
  queue.enqueue(2);
  queue.enqueue(3);
  queue.enqueue(4);
  queue.enqueue(5);
  Assert.assertEquals(5,queue.getSize());
  result=queue.dequeue();
  Assert.assertEquals(1,result);
  result=queue.dequeue();
  Assert.assertEquals(2,result);
  result=queue.dequeue();
  Assert.assertEquals(3,result);
  result=queue.dequeue();
  Assert.assertEquals(4,result);
  result=queue.dequeue();
  Assert.assertEquals(5,result);
}
Program: 18468
Project: 18468
Buggy source:
/** 
 * @see ActionListener#actionPerformed(ActionEvent)
 */
@Override public void actionPerformed(final ActionEvent e){
  final Sector sector=this.provider.getSector();
  final SelectSectorDialog dialog=sector.getGame().getSelectSectorDialog();
  dialog.setSelected(sector);
  if (dialog.open() == Result.OK)   this.provider.setSector(dialog.getSelected());
}

Fixed version (ground truth):
/** 
 * @see ActionListener#actionPerformed(ActionEvent)
 */
@Override public void actionPerformed(final ActionEvent e){
  final Sector sector=this.sectorProvider.getSector();
  final SelectSectorDialog dialog=this.gameProvider.getGame().getSelectSectorDialog();
  dialog.setSelected(sector);
  if (dialog.open() == Result.OK)   this.sectorProvider.setSector(dialog.getSelected());
}
Program: 18469
Project: 18469
Buggy source:
/** 
 * Constructor
 * @param provider The provider
 * @param context The context name (for having different action settings per context)
 */
public ChangeSectorAction(final SectorProvider provider,final String context){
  super("String_Node_Str",Icons.SECTOR,context);
  this.provider=provider;
  setEnabled(provider.canChangeSector());
  if (provider instanceof StateProvider)   ((StateProvider)provider).addStateListener(this);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param gameProvider The game provider.
 * @param sectorProvider The sector provider.
 * @param context The context name (for having different action settings per context)
 */
public ChangeSectorAction(final GameProvider gameProvider,final SectorProvider sectorProvider,final String context){
  super("String_Node_Str",Icons.SECTOR,context);
  if (gameProvider == null)   throw new IllegalArgumentException("String_Node_Str");
  this.gameProvider=gameProvider;
  this.sectorProvider=sectorProvider;
  setEnabled(sectorProvider.canChangeSector());
  if (sectorProvider instanceof StateProvider)   ((StateProvider)sectorProvider).addStateListener(this);
}
Program: 18470
Project: 18470
Buggy source:
/** 
 * @see de.ailis.xadrian.listeners.StateListener#stateChanged()
 */
@Override public void stateChanged(){
  setEnabled(this.provider.canChangeSector());
}

Fixed version (ground truth):
/** 
 * @see de.ailis.xadrian.listeners.StateListener#stateChanged()
 */
@Override public void stateChanged(){
  setEnabled(this.sectorProvider.canChangeSector());
}
Program: 18471
Project: 18471
Buggy source:
/** 
 * Constructor
 * @param complex The complex to edit
 */
public ComplexEditor(final Complex complex){
  super();
  setLayout(new BorderLayout());
  this.complex=complex;
  this.textPane=new JTextPane();
  this.textPane.setEditable(false);
  this.textPane.setBackground(Color.WHITE);
  this.textPane.setContentType("String_Node_Str");
  this.textPane.setDoubleBuffered(true);
  this.textPane.addHyperlinkListener(this);
  this.textPane.addCaretListener(this);
  final JPopupMenu popupMenu=new JPopupMenu();
  popupMenu.add(new CopyAction(this));
  popupMenu.add(new SelectAllAction(this));
  popupMenu.addSeparator();
  popupMenu.add(new AddFactoryAction(this));
  popupMenu.add(new ChangeSectorAction(this,"String_Node_Str"));
  popupMenu.add(new ChangeSunsAction(this));
  popupMenu.add(new ChangePricesAction(this));
  popupMenu.add(new JCheckBoxMenuItem(new ToggleBaseComplexAction(this)));
  SwingUtils.setPopupMenu(this.textPane,popupMenu);
  ((HTMLDocument)this.textPane.getDocument()).setBase(Main.class.getResource("String_Node_Str"));
  final JScrollPane scrollPane=new JScrollPane(this.textPane);
  add(scrollPane);
  redraw();
  fireComplexState();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param complex The complex to edit
 */
public ComplexEditor(final Complex complex){
  super();
  setLayout(new BorderLayout());
  this.complex=complex;
  this.textPane=new JTextPane();
  this.textPane.setEditable(false);
  this.textPane.setBackground(Color.WHITE);
  this.textPane.setContentType("String_Node_Str");
  this.textPane.setDoubleBuffered(true);
  this.textPane.addHyperlinkListener(this);
  this.textPane.addCaretListener(this);
  final JPopupMenu popupMenu=new JPopupMenu();
  popupMenu.add(new CopyAction(this));
  popupMenu.add(new SelectAllAction(this));
  popupMenu.addSeparator();
  popupMenu.add(new AddFactoryAction(this));
  popupMenu.add(new ChangeSectorAction(this.complex,this,"String_Node_Str"));
  popupMenu.add(new ChangeSunsAction(this));
  popupMenu.add(new ChangePricesAction(this));
  popupMenu.add(new JCheckBoxMenuItem(new ToggleBaseComplexAction(this)));
  SwingUtils.setPopupMenu(this.textPane,popupMenu);
  ((HTMLDocument)this.textPane.getDocument()).setBase(Main.class.getResource("String_Node_Str"));
  final JScrollPane scrollPane=new JScrollPane(this.textPane);
  add(scrollPane);
  redraw();
  fireComplexState();
}
Program: 18472
Project: 18472
Buggy source:
/** 
 * @see java.lang.Comparable#compareTo(java.lang.Object)
 */
@Override public int compareTo(final Asteroid o){
  int result=this.ware.compareTo(o.ware) * -1;
  if (result == 0)   result=Integer.valueOf(this.yield).compareTo(o.yield) * -1;
  if (result == 0)   result=this.id.compareTo(o.id);
  if (result == 0)   throw new RuntimeException();
  return result;
}

Fixed version (ground truth):
/** 
 * @see java.lang.Comparable#compareTo(java.lang.Object)
 */
@Override public int compareTo(final Asteroid o){
  if (this == o)   return 0;
  int result=this.ware.compareTo(o.ware) * -1;
  if (result == 0)   result=Integer.valueOf(this.yield).compareTo(o.yield) * -1;
  if (result == 0)   result=this.id.compareTo(o.id);
  return result;
}
Program: 18473
Project: 18473
Buggy source:
/** 
 * Returns the game this complex belongs to.
 * @return The game this complex belongs to
 */
public Game getGame(){
  return this.game;
}

Fixed version (ground truth):
/** 
 * @see de.ailis.xadrian.interfaces.GameProvider#getGame()
 */
@Override public Game getGame(){
  return this.game;
}