nus-yam/ex-repair huggingface dataset:
Program: 20561
Project: 20561
Buggy source:
private void appendProperty(JSONObject item,ISchemaType type,ISchemaProperty prop,ISerializationNode childNode){
  Node n=(Node)childNode;
  ISchemaType propType=prop.getType();
  String propName=type.getQualifiedPropertyName(prop);
  try {
    if (prop.getStructureType() == StructureType.COLLECTION) {
      item.put(propName,n.array);
    }
 else     if (propType == null || propType.isComplex()) {
      item.put(propName,n.object);
    }
 else {
      if (prop.isAttribute()) {
        propName="String_Node_Str" + propName;
      }
      item.put(propName,DefaultValueFactory.getDefaultValue(prop));
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void appendProperty(JSONObject item,ISchemaType type,ISchemaProperty prop,ISerializationNode childNode){
  Node n=(Node)childNode;
  ISchemaType propType=prop.getType();
  String propName=type.getQualifiedPropertyName(prop);
  try {
    if (prop.isAttribute()) {
      propName="String_Node_Str" + propName;
      Object defaultValue=DefaultValueFactory.DEFAULT_STRING_VALUE;
      if (prop.getStructureType() == StructureType.MAP) {
        item.put(propName + "String_Node_Str",defaultValue + "String_Node_Str");
        item.put(propName + "String_Node_Str",defaultValue + "String_Node_Str");
      }
 else {
        item.put(propName,defaultValue);
      }
    }
 else     if (prop.getStructureType() == StructureType.COLLECTION) {
      item.put(propName,n.array);
    }
 else     if (propType == null || propType.isComplex()) {
      item.put(propName,n.object);
    }
 else {
      Object defaultValue=DefaultValueFactory.getDefaultValue(prop);
      item.put(propName,defaultValue);
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
}
Program: 20563
Project: 20563
Buggy source:
public MapPropertyImpl(String name,List<ISchemaType> types,boolean required,boolean isAttribute,StructureType structureType,String namespace){
  super(name,null,required,isAttribute,structureType,namespace);
  if (types != null) {
    if (types.size() > 0) {
      this.keyType=types.get(0);
    }
    if (types.size() > 1) {
      this.valueType=types.get(1);
    }
  }
}

Fixed version (ground truth):
public MapPropertyImpl(String name,List<ISchemaType> types,boolean required,boolean isAttribute,String namespace){
  super(name,null,required,isAttribute,StructureType.MAP,namespace);
  if (types != null) {
    if (types.size() > 0) {
      this.keyType=types.get(0);
    }
    if (types.size() > 1) {
      this.valueType=types.get(1);
    }
  }
}
Program: 20565
Project: 20565
Buggy source:
private void save(String raml,IFile file) throws CoreException, UnsupportedEncodingException {
  if (!file.exists()) {
    file.create(new ByteArrayInputStream(raml.getBytes("String_Node_Str")),true,new NullProgressMonitor());
  }
 else {
    file.setContents(new ByteArrayInputStream(raml.getBytes("String_Node_Str")),0,new NullProgressMonitor());
  }
}

Fixed version (ground truth):
private void save(String raml,IFile file) throws CoreException, UnsupportedEncodingException {
  if (!file.exists()) {
    createFolder(file.getParent());
    file.create(new ByteArrayInputStream(raml.getBytes("String_Node_Str")),true,new NullProgressMonitor());
  }
 else {
    file.setContents(new ByteArrayInputStream(raml.getBytes("String_Node_Str")),0,new NullProgressMonitor());
  }
}
Program: 20566
Project: 20566
Buggy source:
private IFile getNewRAMLFile(IProject project){
  container=project;
  InputDialog inputDialog=new RAMLConfigurationDialog(shell,"String_Node_Str","String_Node_Str","String_Node_Str",null);
  int open=inputDialog.open();
  if (open == Dialog.OK) {
    return container.getFile(new Path(inputDialog.getValue()));
  }
  return null;
}

Fixed version (ground truth):
private IFile getNewRAMLFile(IProject project){
  container=project.getFolder(new Path("String_Node_Str"));
  InputDialog inputDialog=new RAMLConfigurationDialog(shell,"String_Node_Str","String_Node_Str","String_Node_Str",null);
  int open=inputDialog.open();
  if (open == Dialog.OK) {
    return container.getFile(new Path(inputDialog.getValue()));
  }
  return null;
}
Program: 20567
Project: 20567
Buggy source:
private void fillJAXBType(BasicModel fm,CtTypeReference<?> type){
  if (type == null) {
    return;
  }
  Class<?> actualClass=type.getActualClass();
  fm.setJavaClass(actualClass);
  if (actualClass != null && Collection.class.isAssignableFrom(actualClass)) {
    List<CtTypeReference<?>> actualTypeArguments=type.getActualTypeArguments();
    if (actualTypeArguments.size() == 1) {
      CtTypeReference<?> ctTypeReference=actualTypeArguments.get(0);
      ITypeModel processTypeReference=processTypeReference(ctTypeReference);
      fm.setJaxbType(processTypeReference);
    }
  }
}

Fixed version (ground truth):
private void fillJAXBType(BasicModel fm,CtTypeReference<?> type){
  if (type == null) {
    return;
  }
  CtTypeReference<?> actualType=type;
  Class<?> actualClass=type.getActualClass();
  fm.setJavaClass(actualClass);
  if (actualClass != null && Collection.class.isAssignableFrom(actualClass)) {
    List<CtTypeReference<?>> actualTypeArguments=type.getActualTypeArguments();
    if (actualTypeArguments.size() == 1) {
      actualType=actualTypeArguments.get(0);
    }
  }
  ITypeModel processTypeReference=processTypeReference(actualType);
  fm.setJaxbType(processTypeReference);
}
Program: 20569
Project: 20569
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public ITypeModel getJAXBType(){
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public ITypeModel getJAXBType(){
  Class<?> type=null;
  if (Utils.isCollection(element.getReturnType())) {
    Type gType=element.getGenericReturnType();
    if (gType instanceof ParameterizedType) {
      Type[] args=((ParameterizedType)gType).getActualTypeArguments();
      if (args != null && args.length != 0) {
        type=(Class<?>)args[0];
      }
    }
  }
 else {
    type=element.getReturnType();
  }
  if (type == null) {
    return null;
  }
  ITypeModel model=new ReflectionType(type);
  if (Utils.isJAXBType(model)) {
    return model;
  }
  return null;
}
Program: 20570
Project: 20570
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void generateXMLSchema(ITypeModel t){
  super.generateXMLSchema(t);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void generateXMLSchema(ITypeModel t,String collectionTag){
  super.generateXMLSchema(t,collectionTag);
}
Program: 20571
Project: 20571
Buggy source:
private IMethodModel processMethod(CtMethod<?> m){
  MethodModel methodModel=new MethodModel();
  fillBasic(methodModel,m);
  CtTypeReference<?> returnedType=m.getType();
  ITypeModel returnedTypeModel=processTypeReference(returnedType);
  methodModel.setReturnedType(returnedTypeModel);
  List<CtParameter<?>> parameters=m.getParameters();
  for (  CtParameter<?> p : parameters) {
    IParameterModel parameterModel=processParameter(p);
    methodModel.addParameter(parameterModel);
  }
  return methodModel;
}

Fixed version (ground truth):
private IMethodModel processMethod(CtMethod<?> m){
  MethodModel methodModel=new MethodModel();
  fillBasic(methodModel,m);
  CtTypeReference<?> returnedType=m.getType();
  ITypeModel returnedTypeModel=processTypeReference(returnedType);
  methodModel.setReturnedType(returnedTypeModel);
  fillJAXBType(methodModel,returnedType);
  List<CtParameter<?>> parameters=m.getParameters();
  for (  CtParameter<?> p : parameters) {
    IParameterModel parameterModel=processParameter(p);
    methodModel.addParameter(parameterModel);
  }
  return methodModel;
}
Program: 20572
Project: 20572
Buggy source:
@Override protected void generateXMLSchema(ITypeModel t){
  super.generateXMLSchema(t);
  String generateXMLExampleJAXB=generateXMLExampleJAXB(t);
  if (generateXMLExampleJAXB != null) {
    File file=outputFile;
    File parentDir=file.getParentFile();
    File examplesDir=new File(parentDir,"String_Node_Str");
    if (!examplesDir.exists()) {
      examplesDir.mkdir();
    }
    writeString(generateXMLExampleJAXB,new File(examplesDir,t.getName() + "String_Node_Str"));
    String jsonText=getProperJSONExampleFromXML(generateXMLExampleJAXB);
    writeString(jsonText,new File(examplesDir,t.getName() + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override protected void generateXMLSchema(ITypeModel t,String collectionTag){
  super.generateXMLSchema(t,collectionTag);
  String generateXMLExampleJAXB=generateXMLExampleJAXB(t);
  if (generateXMLExampleJAXB != null) {
    File file=outputFile;
    File parentDir=file.getParentFile();
    File examplesDir=new File(parentDir,"String_Node_Str");
    if (!examplesDir.exists()) {
      examplesDir.mkdir();
    }
    writeString(generateXMLExampleJAXB,new File(examplesDir,t.getName() + "String_Node_Str"));
    String jsonText=getProperJSONExampleFromXML(generateXMLExampleJAXB);
    writeString(jsonText,new File(examplesDir,t.getName() + "String_Node_Str"));
  }
}
Program: 20574
Project: 20574
Buggy source:
/** 
 * <p>generateXMLSchema.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 */
protected void generateXMLSchema(ITypeModel t){
}

Fixed version (ground truth):
/** 
 * <p>generateXMLSchema.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 */
protected void generateXMLSchema(ITypeModel t,String collectionTag){
}
Program: 20576
Project: 20576
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public ITypeModel getJAXBType(){
  ITypeModel type=getType();
  if (ResourceVisitor.isJAXBType(type)) {
    return type;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public ITypeModel getJAXBType(){
  Class<?> type=null;
  if (Utils.isCollection(element.getType())) {
    Type gType=element.getGenericType();
    if (gType instanceof ParameterizedType) {
      Type[] args=((ParameterizedType)gType).getActualTypeArguments();
      if (args != null && args.length != 0) {
        type=(Class<?>)args[0];
      }
    }
  }
 else {
    type=element.getType();
  }
  if (type == null) {
    return null;
  }
  ITypeModel model=new ReflectionType(type);
  if (Utils.isJAXBType(model)) {
    return model;
  }
  return null;
}
Program: 20577
Project: 20577
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void generateXMLSchema(ITypeModel t){
  if (t instanceof ReflectionType) {
    Class<?> element=((ReflectionType)t).getElement();
    generateXSDForClass(element);
  }
 else   if (t.getFullyQualifiedName() != null && classLoader != null) {
    try {
      Class<?> element=classLoader.loadClass(t.getFullyQualifiedName());
      generateXSDForClass(element);
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  afterSchemaGen(t);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected void generateXMLSchema(ITypeModel t,String collectionTag){
  if (t instanceof ReflectionType) {
    Class<?> element=((ReflectionType)t).getElement();
    generateXSDForClass(element);
  }
 else   if (t.getFullyQualifiedName() != null && classLoader != null) {
    try {
      Class<?> element=classLoader.loadClass(t.getFullyQualifiedName());
      generateXSDForClass(element);
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  afterSchemaGen(t,collectionTag);
}
Program: 20578
Project: 20578
Buggy source:
/** 
 * <p>afterSchemaGen.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 */
protected void afterSchemaGen(ITypeModel t){
  String generateXMLExampleJAXB=generateXMLExampleJAXB(t);
  if (generateXMLExampleJAXB != null) {
    File file=outputFile;
    File parentDir=file.getParentFile();
    File examplesDir=new File(parentDir,"String_Node_Str");
    File schemaFile=new File(parentDir,"String_Node_Str");
    if (!examplesDir.exists()) {
      examplesDir.mkdir();
    }
    writeString(generateXMLExampleJAXB,new File(examplesDir,t.getName() + "String_Node_Str"));
    String jsonText=getProperJSONExampleFromXML(generateXMLExampleJAXB);
    writeString(jsonText,new File(examplesDir,t.getName().toLowerCase() + "String_Node_Str"));
    String generatedSchema=jsonText != null ? new SchemaGenerator().generateSchema(jsonText) : null;
    generatedSchema=generatedSchema != null ? JsonFormatter.format(generatedSchema) : null;
    if (generatedSchema != null) {
      String schemaName=t.getName().toLowerCase() + "String_Node_Str";
      spec.getCoreRaml().addGlobalSchema(schemaName,generatedSchema,true,false);
      writeString(generatedSchema,new File(schemaFile,schemaName + "String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
/** 
 * <p>afterSchemaGen.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @param collectionTag 
 */
protected void afterSchemaGen(ITypeModel t,String collectionTag){
  String generateXMLExampleJAXB=generateXMLExampleJAXB(t);
  if (generateXMLExampleJAXB != null) {
    File file=outputFile;
    File parentDir=file.getParentFile();
    File examplesDir=new File(parentDir,"String_Node_Str");
    File schemaFile=new File(parentDir,"String_Node_Str");
    if (!examplesDir.exists()) {
      examplesDir.mkdir();
    }
    writeString(generateXMLExampleJAXB,new File(examplesDir,t.getName() + "String_Node_Str"));
    String jsonText=getProperJSONExampleFromXML(generateXMLExampleJAXB);
    writeString(jsonText,new File(examplesDir,t.getName().toLowerCase() + "String_Node_Str"));
    String generatedSchema=jsonText != null ? new SchemaGenerator().generateSchema(jsonText) : null;
    generatedSchema=generatedSchema != null ? JsonFormatter.format(generatedSchema) : null;
    if (generatedSchema != null) {
      String schemaName=t.getName().toLowerCase() + "String_Node_Str";
      spec.getCoreRaml().addGlobalSchema(schemaName,generatedSchema,true,false);
      writeString(generatedSchema,new File(schemaFile,schemaName + "String_Node_Str"));
    }
  }
}
Program: 20579
Project: 20579
Buggy source:
/** 
 * <p>generateXSDForClass.</p>
 * @param element a {@link java.lang.Class} object.
 */
protected void generateXSDForClass(Class<?> element){
  try {
    String name=element.getSimpleName().toLowerCase();
    String fileName=name + "String_Node_Str";
    JAXBContext jaxbContext=JAXBContext.newInstance(element);
    CustomSchemaOutputResolver sor=new CustomSchemaOutputResolver(fileName);
    jaxbContext.generateSchema(sor);
    File file=sor.getFile();
    String content=FileUtil.fileToString(file);
    generateExamle(file,content);
    spec.getCoreRaml().addGlobalSchema(name,content,false,false);
  }
 catch (  JAXBException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * <p>generateXSDForClass.</p>
 * @param element a {@link java.lang.Class} object.
 */
protected void generateXSDForClass(Class<?> element){
  try {
    String name=element.getSimpleName().toLowerCase();
    String fileName=name + "String_Node_Str";
    JAXBContext jaxbContext=JAXBContext.newInstance(element);
    CustomSchemaOutputResolver sor=new CustomSchemaOutputResolver(fileName);
    jaxbContext.generateSchema(sor);
    File file=sor.getFile();
    if (file != null) {
      String content=FileUtil.fileToString(file);
      generateExamle(file,content);
      spec.getCoreRaml().addGlobalSchema(name,content,false,false);
    }
  }
 catch (  JAXBException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 20580
Project: 20580
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void generateXMLSchema(ITypeModel t,String collectionTag){
  APTType type=(APTType)t;
  TypeElement element=(TypeElement)type.element();
  Class<?> clazz;
  try {
    clazz=Class.forName(processingEnv.getElementUtils().getBinaryName(element).toString());
    generateXSDForClass(clazz);
    afterSchemaGen(type,collectionTag);
    return;
  }
 catch (  ClassNotFoundException e1) {
  }
  if (classLoader != null) {
    try {
      clazz=classLoader.loadClass(processingEnv.getElementUtils().getBinaryName(element).toString());
      generateXSDForClass(clazz);
      afterSchemaGen(type,collectionTag);
    }
 catch (    ClassNotFoundException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected boolean generateXMLSchema(ITypeModel t,String collectionTag){
  APTType type=(APTType)t;
  TypeElement element=(TypeElement)type.element();
  Class<?> clazz;
  String xsdSchema=null;
  try {
    clazz=Class.forName(processingEnv.getElementUtils().getBinaryName(element).toString());
    xsdSchema=generateXSDForClass(clazz);
  }
 catch (  ClassNotFoundException e1) {
  }
  if (classLoader != null) {
    try {
      clazz=classLoader.loadClass(processingEnv.getElementUtils().getBinaryName(element).toString());
      xsdSchema=generateXSDForClass(clazz);
    }
 catch (    ClassNotFoundException e) {
    }
  }
  if (xsdSchema == null) {
    return false;
  }
  afterSchemaGen(type,collectionTag);
  return true;
}
Program: 20583
Project: 20583
Buggy source:
/** 
 * <p>generateXMLSchema.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 */
protected void generateXMLSchema(ITypeModel t,String collectionTag){
}

Fixed version (ground truth):
/** 
 * <p>generateXMLSchema.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @return if schema is correctly generated and can be used inside RAML
 */
protected boolean generateXMLSchema(ITypeModel t,String collectionTag){
  return false;
}
Program: 20585
Project: 20585
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void generateXMLSchema(ITypeModel t,String collectionTag){
  if (t instanceof ReflectionType) {
    Class<?> element=((ReflectionType)t).getElement();
    generateXSDForClass(element);
  }
 else   if (t.getFullyQualifiedName() != null && classLoader != null) {
    try {
      Class<?> element=classLoader.loadClass(t.getFullyQualifiedName());
      generateXSDForClass(element);
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  afterSchemaGen(t,collectionTag);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected boolean generateXMLSchema(ITypeModel t,String collectionTag){
  String xsdSchema=null;
  if (t instanceof ReflectionType) {
    Class<?> element=((ReflectionType)t).getElement();
    xsdSchema=generateXSDForClass(element);
  }
 else   if (t.getFullyQualifiedName() != null && classLoader != null) {
    try {
      Class<?> element=classLoader.loadClass(t.getFullyQualifiedName());
      xsdSchema=generateXSDForClass(element);
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  if (xsdSchema == null) {
    return false;
  }
  afterSchemaGen(t,collectionTag);
  return true;
}
Program: 20586
Project: 20586
Buggy source:
/** 
 * <p>Constructor for JAXBType.</p>
 * @param model a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @param r a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBRegistry} object.
 */
public JAXBType(ITypeModel model,JAXBRegistry r){
  super(model,r);
  IMethodModel[] methods=model.getMethods();
  String value=value(XmlAccessorType.class,"String_Node_Str");
  XmlAccessType type=XmlAccessType.FIELD;
  this.className=model.getFullyQualifiedName();
  if (value != null) {
    type=extractType(value);
  }
  for (  IMethodModel m : methods) {
    boolean needToConsume=needToConsume(type,m);
    if (!needToConsume) {
      continue;
    }
    boolean get=m.getName().startsWith("String_Node_Str");
    boolean is=m.getName().startsWith("String_Node_Str");
    if (get || is) {
      properties.add(createProperty(get ? m.getName().substring(3) : m.getName().substring(2),m));
    }
  }
  for (  IFieldModel f : model.getFields()) {
    if (!f.isStatic()) {
      boolean needToConsume=needToConsume(type,f);
      if (!needToConsume) {
        continue;
      }
      properties.add(createProperty(f.getName(),f));
    }
  }
}

Fixed version (ground truth):
/** 
 * <p>Constructor for JAXBType.</p>
 * @param model a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @param r a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBRegistry} object.
 */
public JAXBType(ITypeModel model,JAXBRegistry r){
  super(model,r);
  IMethodModel[] methods=model.getMethods();
  String value=value(XmlAccessorType.class,"String_Node_Str");
  XmlAccessType type=XmlAccessType.PUBLIC_MEMBER;
  this.className=model.getFullyQualifiedName();
  if (value != null) {
    type=extractType(value);
  }
  for (  IMethodModel m : methods) {
    boolean needToConsume=needToConsume(type,m);
    if (!needToConsume) {
      continue;
    }
    boolean get=m.getName().startsWith("String_Node_Str");
    boolean is=m.getName().startsWith("String_Node_Str");
    if (get || is) {
      properties.add(createProperty(get ? m.getName().substring(3) : m.getName().substring(2),m));
    }
  }
  for (  IFieldModel f : model.getFields()) {
    if (!f.isStatic()) {
      boolean needToConsume=needToConsume(type,f);
      if (!needToConsume) {
        continue;
      }
      properties.add(createProperty(f.getName(),f));
    }
  }
}
Program: 20587
Project: 20587
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void generateXMLSchema(ITypeModel t,String collectionTag){
  super.generateXMLSchema(t,collectionTag);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected boolean generateXMLSchema(ITypeModel t,String collectionTag){
  return super.generateXMLSchema(t,collectionTag);
}
Program: 20588
Project: 20588
Buggy source:
private void addCatchAllFormParametersArgument(final MimeType bodyMimeType,final JMethod method,final JDocComment javadoc,final JType argumentType){
  method.param(argumentType,GENERIC_PAYLOAD_ARGUMENT_NAME);
  for (  final Entry<String,List<FormParameter>> namedFormParameters : bodyMimeType.getFormParameters().entrySet()) {
    final StringBuilder sb=new StringBuilder();
    sb.append(namedFormParameters.getKey()).append("String_Node_Str");
    for (    final FormParameter formParameter : namedFormParameters.getValue()) {
      appendParameterJavadocDescription(formParameter,sb);
    }
    javadoc.addParam(GENERIC_PAYLOAD_ARGUMENT_NAME).add(sb.toString());
  }
}

Fixed version (ground truth):
private void addCatchAllFormParametersArgument(final MimeType bodyMimeType,final JMethod method,final JDocComment javadoc,final JType argumentType){
  method.param(argumentType,GENERIC_PAYLOAD_ARGUMENT_NAME);
  Map<String,List<FormParameter>> formParameters=bodyMimeType.getFormParameters();
  if (formParameters != null) {
    for (    final Entry<String,List<FormParameter>> namedFormParameters : formParameters.entrySet()) {
      final StringBuilder sb=new StringBuilder();
      sb.append(namedFormParameters.getKey()).append("String_Node_Str");
      for (      final FormParameter formParameter : namedFormParameters.getValue()) {
        appendParameterJavadocDescription(formParameter,sb);
      }
      javadoc.addParam(GENERIC_PAYLOAD_ARGUMENT_NAME).add(sb.toString());
    }
  }
}
Program: 20589
Project: 20589
Buggy source:
private void generateType(JAXBType type,String xmlName){
  HashMap<String,String> prefixes=type.gatherNamespaces();
  writer.startEntityAndDeclareNamespaces(xmlName,prefixes);
  for (  JAXBProperty p : type.properties) {
    writeProperty(p,prefixes);
  }
  writer.endEntity(xmlName);
}

Fixed version (ground truth):
private void generateType(JAXBType type,String xmlName){
  if (!onStack.add(type)) {
    return;
  }
  HashMap<String,String> prefixes=type.gatherNamespaces();
  writer.startEntityAndDeclareNamespaces(xmlName,prefixes);
  for (  JAXBProperty p : type.properties) {
    writeProperty(p,prefixes);
  }
  writer.endEntity(xmlName);
  onStack.remove(type);
}
Program: 20590
Project: 20590
Buggy source:
private void writeProperty(JAXBProperty p,HashMap<String,String> prefixes){
  String name=p.name();
  if (p.namespace != null) {
    String string=prefixes.get(p.namespace);
    if (string != null) {
      name=string + "String_Node_Str" + name;
    }
  }
  if (p instanceof JAXBAttributeProperty) {
    JAXBAttributeProperty ap=(JAXBAttributeProperty)p;
    writer.generateAttribute(name,ap.asJavaType(),ap.required);
  }
  if (p instanceof JAXBElementProperty) {
    JAXBElementProperty el=(JAXBElementProperty)p;
    JAXBType jaxbType=el.getJAXBType();
    if (jaxbType != null) {
      generateType(jaxbType,name);
      if (p.isCollection()) {
        generateType(jaxbType,name);
      }
    }
 else {
      writer.generateElement(name,el.asJavaType(),el.required);
      if (p.isCollection()) {
        writer.generateElement(name,el.asJavaType(),el.required);
      }
    }
  }
  if (p instanceof JAXBValueProperty) {
    writer.addValueSample(p.asJavaType(),p.required);
  }
}

Fixed version (ground truth):
private void writeProperty(JAXBProperty p,HashMap<String,String> prefixes){
  String name=p.name();
  if (name == null || name.length() == 0) {
    return;
  }
  if (p.namespace != null) {
    String string=prefixes.get(p.namespace);
    if (string != null) {
      name=string + "String_Node_Str" + name;
    }
  }
  if (p instanceof JAXBAttributeProperty) {
    JAXBAttributeProperty ap=(JAXBAttributeProperty)p;
    writer.generateAttribute(name,ap.asJavaType(),ap.required);
  }
  if (p instanceof JAXBElementProperty) {
    JAXBElementProperty el=(JAXBElementProperty)p;
    JAXBType jaxbType=el.getJAXBType();
    if (jaxbType != null) {
      generateType(jaxbType,name);
      if (p.isCollection()) {
        generateType(jaxbType,name);
      }
    }
 else {
      writer.generateElement(name,el.asJavaType(),el.required);
      if (p.isCollection()) {
        writer.generateElement(name,el.asJavaType(),el.required);
      }
    }
  }
  if (p instanceof JAXBValueProperty) {
    writer.addValueSample(p.asJavaType(),p.required);
  }
}
Program: 20592
Project: 20592
Buggy source:
public JDefinedClass createResourceEnum(final JDefinedClass resourceInterface,final String name,final List<String> values) throws Exception {
  final JDefinedClass _enum=resourceInterface._enum(name);
  for (  final String value : values) {
    _enum.enumConstant(value);
  }
  return _enum;
}

Fixed version (ground truth):
public JDefinedClass createResourceEnum(final JDefinedClass resourceInterface,final String name,final List<String> values) throws Exception {
  JClass[] listClasses=resourceInterface.listClasses();
  for (  JClass c : listClasses) {
    if (c.name().equals(name)) {
      return (JDefinedClass)c;
    }
  }
  final JDefinedClass _enum=resourceInterface._enum(name);
  for (  final String value : values) {
    _enum.enumConstant(value);
  }
  return _enum;
}
Program: 20593
Project: 20593
Buggy source:
public ITypeModel getReturnedType(){
  IMethod iMethod=(IMethod)tm;
  try {
    String returnType=iMethod.getReturnType();
    if (returnType.startsWith("String_Node_Str") && returnType.endsWith("String_Node_Str")) {
      IType ownerType=(IType)iMethod.getAncestor(IJavaElement.TYPE);
      String[][] resolveType=ownerType.resolveType(returnType.substring(1,returnType.length() - 1));
      if (resolveType.length == 1) {
        IType findType=ownerType.getJavaProject().findType(resolveType[0][0] + '.' + resolveType[0][1]);
        if (findType != null && findType instanceof SourceType) {
          return new JDTType(findType);
        }
      }
    }
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  return null;
}

Fixed version (ground truth):
public ITypeModel getReturnedType(){
  IMethod iMethod=(IMethod)tm;
  try {
    String returnType=iMethod.getReturnType();
    if (returnType.startsWith("String_Node_Str") && returnType.endsWith("String_Node_Str")) {
      IType ownerType=(IType)iMethod.getAncestor(IJavaElement.TYPE);
      String typeName=returnType.substring(1,returnType.length() - 1);
      String[][] resolveType=ownerType.resolveType(typeName);
      if (resolveType == null) {
        throw new GenerationException("String_Node_Str" + typeName + "String_Node_Str","String_Node_Str" + typeName + "String_Node_Str");
      }
      if (resolveType.length == 1) {
        IType findType=ownerType.getJavaProject().findType(resolveType[0][0] + '.' + resolveType[0][1]);
        if (findType != null && findType instanceof SourceType) {
          return new JDTType(findType);
        }
      }
    }
  }
 catch (  Exception e) {
    if (e instanceof GenerationException) {
      throw (GenerationException)e;
    }
    throw new IllegalStateException(e);
  }
  return null;
}
Program: 20595
Project: 20595
Buggy source:
private static String doCleanup(String relativeUri){
  StringBuilder bld=new StringBuilder();
  char pc=0;
  for (int a=0; a < relativeUri.length(); a++) {
    char c=relativeUri.charAt(a);
    if (c == '/' && pc == '/') {
      continue;
    }
 else {
      bld.append(c);
      pc=c;
    }
  }
  String string=bld.toString();
  if (!string.startsWith("String_Node_Str")) {
    string="String_Node_Str" + string;
  }
  return string;
}

Fixed version (ground truth):
private static String doCleanup(String relativeUri){
  relativeUri=PathCleanuper.cleanupPath(relativeUri);
  StringBuilder bld=new StringBuilder();
  char pc=0;
  for (int a=0; a < relativeUri.length(); a++) {
    char c=relativeUri.charAt(a);
    if (c == '/' && pc == '/') {
      continue;
    }
 else {
      bld.append(c);
      pc=c;
    }
  }
  String string=bld.toString();
  if (!string.startsWith("String_Node_Str")) {
    string="String_Node_Str" + string;
  }
  return string;
}
Program: 20596
Project: 20596
Buggy source:
protected static File uriToFile(String uri){
  String filePrefix=getFilePrefix();
  if (!uri.startsWith(filePrefix)) {
    return null;
  }
  String filePath=uri.substring(filePrefix.length(),uri.length());
  return new File(filePath);
}

Fixed version (ground truth):
protected static File uriToFile(String uri){
  return new File(uri);
}
Program: 20597
Project: 20597
Buggy source:
String generateDummyXmlFor(String uri){
  HrefSchemaHandler hrefHandler=new HrefSchemaHandler(uri);
  uri=hrefHandler.getEnhancedSchemaURI();
  SchemaCdataHandler cdataHandler=new SchemaCdataHandler(uri);
  try {
    String enhancedUri=cdataHandler.getEnhancedSchemaURI();
    if (enhancedUri != null) {
      uri=enhancedUri;
    }
    String[] errorInfo=new String[2];
    IPath sl=new Path("String_Node_Str");
    CMDocument cmDocument=ContentModelManager.getInstance().createCMDocument(uri,null);
    NewXMLGenerator generator=new NewXMLGenerator(uri,cmDocument);
    String rootElementName=getRootElementName(generator);
    if (rootElementName == null) {
      return "String_Node_Str";
    }
    generator.setRootElementName(rootElementName);
    try {
      CMNamedNodeMap nameNodeMap=generator.getCMDocument().getElements();
      ByteArrayOutputStream result=generator.createXMLDocument("String_Node_Str",null);
      return cdataHandler.enhanceGeneratedXML(result.toString());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return "String_Node_Str";
  }
  finally {
    cdataHandler.cleanup();
  }
}

Fixed version (ground truth):
String generateDummyXmlFor(String uri){
  SchemaCdataHandler cdataHandler=new SchemaCdataHandler(uri);
  try {
    String enhancedUri=cdataHandler.getEnhancedSchemaURI();
    if (enhancedUri != null) {
      uri=enhancedUri;
    }
    String[] errorInfo=new String[2];
    IPath sl=new Path("String_Node_Str");
    CMDocument cmDocument=ContentModelManager.getInstance().createCMDocument(uri,null);
    NewXMLGenerator generator=new NewXMLGenerator(uri,cmDocument);
    String rootElementName=getRootElementName(generator);
    if (rootElementName == null) {
      return "String_Node_Str";
    }
    generator.setRootElementName(rootElementName);
    try {
      CMNamedNodeMap nameNodeMap=generator.getCMDocument().getElements();
      ByteArrayOutputStream result=generator.createXMLDocument("String_Node_Str",null);
      return cdataHandler.enhanceGeneratedXML(result.toString());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return "String_Node_Str";
  }
  finally {
    cdataHandler.cleanup();
  }
}
Program: 20600
Project: 20600
Buggy source:
public void addResource(Resource res){
  cleanupUrl(res);
  String relativeUri=res.getRelativeUri();
  int c=0;
  for (int a=0; a < relativeUri.length(); a++) {
    if (relativeUri.charAt(a) == '/') {
      c++;
    }
  }
  Map<String,Resource> resources=getCoreRaml().getResources();
  if (c == 1) {
    resources.put(relativeUri,res);
    return;
  }
  if (res.getRelativeUri().length() == 0 && res.getActions().isEmpty()) {
    return;
  }
  placeResource(resources,res);
}

Fixed version (ground truth):
public void addResource(Resource res){
  cleanupUrl(res);
  String relativeUri=res.getRelativeUri();
  int c=0;
  for (int a=0; a < relativeUri.length(); a++) {
    if (relativeUri.charAt(a) == '/') {
      c++;
    }
  }
  Map<String,Resource> resources=getCoreRaml().getResources();
  if (c == 1) {
    Resource put=resources.put(relativeUri,res);
    if (put != null) {
      merge(res,put);
    }
    if (relativeUri.length() > 0) {
      Path ps=new Path(relativeUri);
      for (      String s : new HashSet<String>(resources.keySet())) {
        Path anotherPath=new Path(s);
        if (ps.isPrefixOf(anotherPath) && !ps.equals(anotherPath)) {
          Resource remove=resources.remove(s);
          Path removeFirstSegments=anotherPath.removeFirstSegments(ps.segmentCount());
          String portableString=removeFirstSegments.toPortableString();
          String doCleanup=doCleanup("String_Node_Str" + portableString);
          res.getResources().put(doCleanup,remove);
          remove.setRelativeUri(doCleanup);
        }
      }
    }
    return;
  }
  if (res.getRelativeUri().length() == 0 && res.getActions().isEmpty()) {
    return;
  }
  placeResource(resources,res);
}
Program: 20603
Project: 20603
Buggy source:
@Override public String[] getValues(String value){
  IMemberValuePair[] memberValuePairs;
  try {
    memberValuePairs=annotation.getMemberValuePairs();
    for (    IMemberValuePair pair : memberValuePairs) {
      if (pair.getMemberName().equals(value)) {
        Object value2=pair.getValue();
        if (value2 instanceof String) {
          return new String[]{(String)value2};
        }
        if (value2 instanceof Object[]) {
          String[] vv=new String[((Object[])value2).length];
          for (int a=0; a < vv.length; a++) {
            vv[a]=(String)((Object[])value2)[a];
          }
          return vv;
        }
      }
    }
  }
 catch (  JavaModelException e) {
    throw new IllegalStateException(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public String[] getValues(String value){
  IMemberValuePair[] memberValuePairs;
  try {
    memberValuePairs=annotation.getMemberValuePairs();
    for (    IMemberValuePair pair : memberValuePairs) {
      if (pair.getMemberName().equals(value)) {
        int valueKind=pair.getValueKind();
        if (valueKind == IMemberValuePair.K_UNKNOWN) {
          ISourceRange sourceRange=annotation.getSourceRange();
          ICompilationUnit unit=(ICompilationUnit)annotation.getAncestor(IJavaElement.COMPILATION_UNIT);
          String source=unit.getSource();
          String substring=source.substring(sourceRange.getOffset(),sourceRange.getOffset() + sourceRange.getLength());
          ArrayList<String> mT=new ArrayList<String>();
          if (substring.toLowerCase().indexOf("String_Node_Str") != -1) {
            mT.add("String_Node_Str");
          }
          if (substring.toLowerCase().indexOf("String_Node_Str") != -1) {
            mT.add("String_Node_Str");
          }
          return mT.toArray(new String[mT.size()]);
        }
        Object value2=pair.getValue();
        if (value2 instanceof String) {
          return new String[]{(String)value2};
        }
        if (value2 instanceof Object[]) {
          String[] vv=new String[((Object[])value2).length];
          for (int a=0; a < vv.length; a++) {
            Object object=((Object[])value2)[a];
            if (object == null) {
              return null;
            }
            vv[a]=(String)object;
          }
          return vv;
        }
      }
    }
  }
 catch (  JavaModelException e) {
    throw new IllegalStateException(e);
  }
  return null;
}
Program: 20605
Project: 20605
Buggy source:
@Override public String getDocumentation(){
  return bld.toString().trim();
}

Fixed version (ground truth):
@Override public String getDocumentation(){
  return "String_Node_Str";
}
Program: 20606
Project: 20606
Buggy source:
@Override public String getReturnInfo(){
  return mmq.get(RETURN);
}

Fixed version (ground truth):
@Override public String getReturnInfo(){
  return "String_Node_Str";
}
Program: 20608
Project: 20608
Buggy source:
private void visit(IMethodModel m,String annotationValue){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    annotationValue+=m.getAnnotationValue(PATH);
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=m.getBasicDocInfo();
    res.setDescription(documentation.getDocumentation());
    res.setRelativeUri(annotationValue);
    spec.addResource(res);
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation);
      }
    }
  }
}

Fixed version (ground truth):
private void visit(IMethodModel m,String annotationValue){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    String annotationValue2=m.getAnnotationValue(PATH);
    if (annotationValue.endsWith("String_Node_Str")) {
      if (annotationValue2.startsWith("String_Node_Str")) {
        annotationValue2=annotationValue2.substring(1);
      }
    }
    annotationValue+=annotationValue2;
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=m.getBasicDocInfo();
    res.setDescription(documentation.getDocumentation());
    res.setRelativeUri(annotationValue);
    spec.addResource(res);
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation);
      }
    }
  }
}
Program: 20611
Project: 20611
Buggy source:
private void visit(IMethodModel m,String annotationValue){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    String annotationValue2=m.getAnnotationValue(PATH);
    if (annotationValue.endsWith("String_Node_Str")) {
      if (annotationValue2.startsWith("String_Node_Str")) {
        annotationValue2=annotationValue2.substring(1);
      }
    }
    annotationValue+=annotationValue2;
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=m.getBasicDocInfo();
    res.setDescription(documentation.getDocumentation());
    res.setRelativeUri(annotationValue);
    spec.addResource(res);
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation);
      }
    }
  }
}

Fixed version (ground truth):
private void visit(IMethodModel m,String annotationValue){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    String annotationValue2=m.getAnnotationValue(PATH);
    if (annotationValue.endsWith("String_Node_Str")) {
      if (annotationValue2.startsWith("String_Node_Str")) {
        annotationValue2=annotationValue2.substring(1);
      }
    }
    annotationValue+=annotationValue2;
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=m.getBasicDocInfo();
    res.setDescription(documentation.getDocumentation());
    if (hasPath) {
      ITypeModel returnedType=m.getReturnedType();
      if (returnedType != null) {
        if (consumedTypes.add(returnedType)) {
          ResourceVisitor resourceVisitor=new ResourceVisitor();
          resourceVisitor.consumedTypes.addAll(this.consumedTypes);
          resourceVisitor.basePath=annotationValue;
          resourceVisitor.spec=this.spec;
          resourceVisitor.visit(returnedType);
        }
      }
    }
    if (annotationValue.endsWith("String_Node_Str")) {
      res.setRelativeUri(annotationValue.substring(0,annotationValue.length() - 1));
    }
 else {
      res.setRelativeUri(annotationValue);
    }
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation);
      }
    }
    spec.addResource(res);
  }
}
Program: 20613
Project: 20613
Buggy source:
private static String getFormat(int integerDigits,int fractionDigits,int maxFractionDigits){
  int width=integerDigits + (fractionDigits > 0 ? 1 : 0) + fractionDigits;
  int padding=maxFractionDigits - fractionDigits + (fractionDigits == 0 ? 1 : 0);
  return "String_Node_Str" + width + "String_Node_Str"+ fractionDigits+ "String_Node_Str"+ repeat(' ',padding);
}

Fixed version (ground truth):
private static String getFormat(int integerDigits,int fractionDigits,int maxFractionDigits){
  int width=integerDigits + (fractionDigits > 0 ? 1 : 0) + fractionDigits;
  int padding=maxFractionDigits - fractionDigits;
  if (maxFractionDigits > 0 && fractionDigits == 0)   padding+=1;
  return "String_Node_Str" + width + "String_Node_Str"+ fractionDigits+ "String_Node_Str"+ repeat(' ',padding);
}
Program: 20614
Project: 20614
Buggy source:
private Instruments(List<Instrument> values,int priceIntegerDigits,int maxPriceFractionDigits,int sizeIntegerDigits,int maxSizeFractionDigits){
  this.valuesByString=new HashMap<>();
  this.valuesByLong=new Long2ObjectOpenHashMap<>();
  for (  Instrument value : values) {
    valuesByString.put(value.asString(),value);
    valuesByLong.put(value.asLong(),value);
  }
  this.maxPriceFractionDigits=maxPriceFractionDigits;
  this.maxSizeFractionDigits=maxSizeFractionDigits;
  this.priceWidth=priceIntegerDigits + 1 + maxPriceFractionDigits;
  this.sizeWidth=sizeIntegerDigits + 1 + maxSizeFractionDigits;
  this.pricePlaceholder=placeholder(priceIntegerDigits,maxPriceFractionDigits);
  this.sizePlaceholder=placeholder(sizeIntegerDigits,maxSizeFractionDigits);
}

Fixed version (ground truth):
private Instruments(List<Instrument> values,int priceIntegerDigits,int maxPriceFractionDigits,int sizeIntegerDigits,int maxSizeFractionDigits){
  this.valuesByString=new HashMap<>();
  this.valuesByLong=new Long2ObjectOpenHashMap<>();
  for (  Instrument value : values) {
    valuesByString.put(value.asString(),value);
    valuesByLong.put(value.asLong(),value);
  }
  this.maxPriceFractionDigits=maxPriceFractionDigits;
  this.maxSizeFractionDigits=maxSizeFractionDigits;
  this.priceWidth=priceIntegerDigits + (maxPriceFractionDigits > 0 ? 1 : 0) + maxPriceFractionDigits;
  this.sizeWidth=sizeIntegerDigits + (maxSizeFractionDigits > 0 ? 1 : 0) + maxSizeFractionDigits;
  this.pricePlaceholder=placeholder(priceIntegerDigits,maxPriceFractionDigits);
  this.sizePlaceholder=placeholder(sizeIntegerDigits,maxSizeFractionDigits);
}
Program: 20615
Project: 20615
Buggy source:
@Test public void priceFractionDigits(){
  assertEquals(2,INSTRUMENTS.get("String_Node_Str").getPriceFractionDigits());
}

Fixed version (ground truth):
@Test public void priceFractionDigits(){
  assertEquals(2,FRACTIONS.get("String_Node_Str").getPriceFractionDigits());
}
Program: 20616
Project: 20616
Buggy source:
@Test public void priceFormat(){
  assertEquals("String_Node_Str",INSTRUMENTS.get("String_Node_Str").getPriceFormat());
}

Fixed version (ground truth):
@Test public void priceFormat(){
  assertEquals("String_Node_Str",FRACTIONS.get("String_Node_Str").getPriceFormat());
}
Program: 20617
Project: 20617
Buggy source:
@Test public void sizeWidth(){
  assertEquals(17,INSTRUMENTS.getSizeWidth());
}

Fixed version (ground truth):
@Test public void sizeWidth(){
  assertEquals(17,FRACTIONS.getSizeWidth());
}
Program: 20618
Project: 20618
Buggy source:
@Test public void maxPriceFractionDigits(){
  assertEquals(6,INSTRUMENTS.getMaxPriceFractionDigits());
}

Fixed version (ground truth):
@Test public void maxPriceFractionDigits(){
  assertEquals(6,FRACTIONS.getMaxPriceFractionDigits());
}
Program: 20619
Project: 20619
Buggy source:
@Test public void maxSizeFractionDigits(){
  assertEquals(8,INSTRUMENTS.getMaxSizeFractionDigits());
}

Fixed version (ground truth):
@Test public void maxSizeFractionDigits(){
  assertEquals(8,FRACTIONS.getMaxSizeFractionDigits());
}
Program: 20620
Project: 20620
Buggy source:
@Test public void priceWidth(){
  assertEquals(11,INSTRUMENTS.getPriceWidth());
}

Fixed version (ground truth):
@Test public void priceWidth(){
  assertEquals(11,FRACTIONS.getPriceWidth());
}
Program: 20621
Project: 20621
Buggy source:
@Test public void priceFactor(){
  assertEquals(100.0,INSTRUMENTS.get("String_Node_Str").getPriceFactor(),0.0);
}

Fixed version (ground truth):
@Test public void priceFactor(){
  assertEquals(100.0,FRACTIONS.get("String_Node_Str").getPriceFactor(),0.0);
}
Program: 20622
Project: 20622
Buggy source:
@Test public void sizePlaceholder(){
  assertEquals("String_Node_Str",INSTRUMENTS.getSizePlaceholder());
}

Fixed version (ground truth):
@Test public void sizePlaceholder(){
  assertEquals("String_Node_Str",FRACTIONS.getSizePlaceholder());
}
Program: 20623
Project: 20623
Buggy source:
@Test public void pricePlaceholder(){
  assertEquals("String_Node_Str",INSTRUMENTS.getPricePlaceholder());
}

Fixed version (ground truth):
@Test public void pricePlaceholder(){
  assertEquals("String_Node_Str",FRACTIONS.getPricePlaceholder());
}
Program: 20624
Project: 20624
Buggy source:
public static void main(String[] args){
  if (args.length < 1)   usage();
  Command command=COMMANDS.get(args[0]);
  if (command == null)   error("String_Node_Str" + command);
  List<String> arguments=asList(args).subList(1,args.length);
  try {
    command.execute(arguments);
  }
 catch (  IOException e) {
    fatal(e);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length < 1)   usage();
  Command command=COMMANDS.get(args[0]);
  if (command == null)   error("String_Node_Str" + args[0]);
  List<String> arguments=asList(args).subList(1,args.length);
  try {
    command.execute(arguments);
  }
 catch (  IOException e) {
    fatal(e);
  }
}
Program: 20626
Project: 20626
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  mWidth=w;
  mHeight=h;
  mCenterX=mWidth / 2;
  mCenterY=mHeight / 2;
  mRadius=mCenterX > mCenterY ? mCenterY : mCenterX;
  float r=mRadius * middleRate;
  middleOval.left=mCenterX - r;
  middleOval.right=mCenterX + r;
  middleOval.top=mCenterY - r;
  middleOval.bottom=mCenterY + r;
  arrowDistance=(int)(mRadius * arrowDistanceRate);
  int length=(int)(mRadius * arrowRate);
  arrow.reset();
  arrow.moveTo(mCenterX - length,mCenterY + length - arrowDistance);
  arrow.lineTo(mCenterX,mCenterY - arrowDistance);
  arrow.lineTo(mCenterX + length,mCenterY + length - arrowDistance);
  arrow.close();
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  mWidth=w;
  mHeight=h;
  mCenterX=mWidth / 2;
  mCenterY=mHeight / 2;
  mRadius=mCenterX > mCenterY ? mCenterY : mCenterX;
  float r=mRadius * middleRate;
  middleOval.left=mCenterX - r;
  middleOval.right=mCenterX + r;
  middleOval.top=mCenterY - r;
  middleOval.bottom=mCenterY + r;
  arrowDistance=(int)(mRadius * arrowDistanceRate);
  int length=(int)(mRadius * arrowRate);
  arrow.reset();
  arrow.moveTo(mCenterX - length,mCenterY + length - arrowDistance);
  arrow.lineTo(mCenterX,mCenterY - arrowDistance);
  arrow.lineTo(mCenterX + length,mCenterY + length - arrowDistance);
  arrow.close();
}