nus-yam/ex-repair huggingface dataset:
Program: 20516
Project: 20516
Buggy source:
private void createMethodWithBody(TypeSpec.Builder typeSpec,GMethod gMethod,Multimap<String,String> ramlTypeToMediaType,String methodName,GRequest gRequest,Map<String,TypeSpec.Builder> responseSpec){
  MethodSpec.Builder methodSpec=createMethodBuilder(gMethod,methodName,new HashSet<String>(),responseSpec);
  createParamteter(methodSpec,gRequest,gMethod);
  handleMethodConsumer(methodSpec,ramlTypeToMediaType,gRequest.type());
  methodSpec=build.pluginsForResourceMethod(new Function<Collection<ResourceMethodExtension<GMethod>>,ResourceMethodExtension<GMethod>>(){
    @Nullable @Override public ResourceMethodExtension<GMethod> apply(    @Nullable Collection<ResourceMethodExtension<GMethod>> resourceMethodExtensions){
      return new ResourceMethodExtension.Composite(resourceMethodExtensions);
    }
  }
,gMethod).onMethod(new ResourceContextImpl(build),gMethod,gRequest,methodSpec);
  if (methodSpec != null) {
    typeSpec.addMethod(methodSpec.build());
  }
}

Fixed version (ground truth):
private void createMethodWithBody(TypeSpec.Builder typeSpec,GMethod gMethod,Multimap<String,String> ramlTypeToMediaType,String methodName,GRequest gRequest,Map<String,TypeSpec.Builder> responseSpec,Set<String> mediaTypesForMethod){
  MethodSpec.Builder methodSpec=createMethodBuilder(gMethod,methodName,mediaTypesForMethod,responseSpec);
  createParamteter(methodSpec,gRequest,gMethod);
  handleMethodConsumer(methodSpec,ramlTypeToMediaType,gRequest.type());
  methodSpec=build.pluginsForResourceMethod(new Function<Collection<ResourceMethodExtension<GMethod>>,ResourceMethodExtension<GMethod>>(){
    @Nullable @Override public ResourceMethodExtension<GMethod> apply(    @Nullable Collection<ResourceMethodExtension<GMethod>> resourceMethodExtensions){
      return new ResourceMethodExtension.Composite(resourceMethodExtensions);
    }
  }
,gMethod).onMethod(new ResourceContextImpl(build),gMethod,gRequest,methodSpec);
  if (methodSpec != null) {
    typeSpec.addMethod(methodSpec.build());
  }
}
Program: 20517
Project: 20517
Buggy source:
private void buildResource(TypeSpec.Builder typeSpec,GResource currentResource){
  Multimap<GMethod,GRequest> incomingBodies=ArrayListMultimap.create();
  Multimap<GMethod,GResponse> responses=ArrayListMultimap.create();
  ResourceUtils.fillInBodiesAndResponses(currentResource,incomingBodies,responses);
  Map<String,TypeSpec.Builder> responseSpecs=createResponseClass(typeSpec,incomingBodies,responses);
  for (  GMethod gMethod : currentResource.methods()) {
    String methodName=Names.resourceMethodName(gMethod.resource(),gMethod);
    Set<String> mediaTypesForMethod=fetchAllMediaTypesForMethodResponses(gMethod);
    if (gMethod.body().size() == 0) {
      createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,HashMultimap.<String,String>create(),methodName,responseSpecs);
    }
 else {
      Multimap<String,String> ramlTypeToMediaType=accumulateMediaTypesPerType(incomingBodies,gMethod);
      for (      GRequest gRequest : gMethod.body()) {
        if (gRequest.type() == null) {
          createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,ramlTypeToMediaType,methodName,responseSpecs);
          continue;
        }
        if (ramlTypeToMediaType.containsKey(gRequest.type().name())) {
          createMethodWithBody(typeSpec,gMethod,ramlTypeToMediaType,methodName,gRequest,responseSpecs);
          ramlTypeToMediaType.removeAll(gRequest.type().name());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void buildResource(TypeSpec.Builder typeSpec,GResource currentResource){
  Multimap<GMethod,GRequest> incomingBodies=ArrayListMultimap.create();
  Multimap<GMethod,GResponse> responses=ArrayListMultimap.create();
  ResourceUtils.fillInBodiesAndResponses(currentResource,incomingBodies,responses);
  Map<String,TypeSpec.Builder> responseSpecs=createResponseClass(typeSpec,incomingBodies,responses);
  for (  GMethod gMethod : currentResource.methods()) {
    String methodName=Names.resourceMethodName(gMethod.resource(),gMethod);
    Set<String> mediaTypesForMethod=fetchAllMediaTypesForMethodResponses(gMethod);
    if (gMethod.body().size() == 0) {
      createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,HashMultimap.<String,String>create(),methodName,responseSpecs);
    }
 else {
      Multimap<String,String> ramlTypeToMediaType=accumulateMediaTypesPerType(incomingBodies,gMethod);
      for (      GRequest gRequest : gMethod.body()) {
        if (gRequest.type() == null) {
          createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,ramlTypeToMediaType,methodName,responseSpecs);
          continue;
        }
        if (ramlTypeToMediaType.containsKey(gRequest.type().name())) {
          createMethodWithBody(typeSpec,gMethod,ramlTypeToMediaType,methodName,gRequest,responseSpecs,mediaTypesForMethod);
          ramlTypeToMediaType.removeAll(gRequest.type().name());
        }
      }
    }
  }
}
Program: 20519
Project: 20519
Buggy source:
@Override public void scanType(TypeRegistry typeRegistry,RamlEntity type,RamlType ramlType){
  Class c=(Class)type.getType();
  for (  Field field : c.getDeclaredFields()) {
    Type genericType=field.getGenericType();
    RamlType fieldRamlType;
    fieldRamlType=PluginUtilities.getRamlType(typeRegistry,this,c.getSimpleName(),type.createDependent(genericType));
    XmlElement elem=field.getAnnotation(XmlElement.class);
    if (elem != null) {
      String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
      ramlType.addProperty(RamlProperty.createProperty(new FieldAnnotable(field),name,fieldRamlType));
    }
 else {
      XmlAttribute attribute=field.getAnnotation(XmlAttribute.class);
      if (attribute != null) {
        String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
        ramlType.addProperty(RamlProperty.createProperty(new FieldAnnotable(field),name,fieldRamlType));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void scanType(TypeRegistry typeRegistry,RamlEntity type,RamlType ramlType){
  Class c=(Class)type.getType();
  for (  Field field : c.getDeclaredFields()) {
    Type genericType=field.getGenericType();
    RamlType fieldRamlType;
    fieldRamlType=PluginUtilities.getRamlType(typeRegistry,this,field.getType().getSimpleName(),type.createDependent(genericType));
    XmlElement elem=field.getAnnotation(XmlElement.class);
    if (elem != null) {
      String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
      ramlType.addProperty(RamlProperty.createProperty(new FieldAnnotable(field),name,fieldRamlType));
    }
 else {
      XmlAttribute attribute=field.getAnnotation(XmlAttribute.class);
      if (attribute != null) {
        String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
        ramlType.addProperty(RamlProperty.createProperty(new FieldAnnotable(field),name,fieldRamlType));
      }
    }
  }
}
Program: 20520
Project: 20520
Buggy source:
public void writeExample(IndentedAppendable writer) throws IOException {
  Optional<Example> e=source.getAnnotation(Example.class);
  if (!e.isPresent()) {
    return;
  }
  writer.appendLine(name + "String_Node_Str" + e.get().value());
}

Fixed version (ground truth):
public void writeExample(IndentedAppendable writer) throws IOException {
  if (!ramlType.isRamlType()) {
    writer.appendLine(name + "String_Node_Str");
    writer.indent();
    ramlType.writeExample(writer);
    writer.outdent();
  }
 else {
    Optional<Example> e=source.getAnnotation(Example.class);
    if (!e.isPresent()) {
      return;
    }
    writer.appendLine(name + "String_Node_Str" + e.get().value());
  }
}
Program: 20521
Project: 20521
Buggy source:
public void write(AnnotationInstanceEmitter emitter,IndentedAppendable writer) throws IOException {
  Class c=(Class)type.getType();
  writer.appendLine(c.getSimpleName() + "String_Node_Str");
  writer.indent();
  if (superTypes != null && superTypes.size() > 0) {
    writer.appendList("String_Node_Str",Collections2.transform(superTypes,new Function<RamlType,String>(){
      @Override public String apply(      RamlType input){
        return input.getTypeName();
      }
    }
).toArray(new String[]{}));
  }
  emitter.emitAnnotations(type);
  emitExample(writer);
  if (type.getDescription().isPresent()) {
    writer.appendLine("String_Node_Str" + type.getDescription().get());
  }
  writer.appendLine("String_Node_Str");
  writer.indent();
  for (  RamlProperty ramlProperty : properties.values()) {
    ramlProperty.write(emitter,writer);
  }
  writer.outdent();
  writer.outdent();
}

Fixed version (ground truth):
public void write(AnnotationInstanceEmitter emitter,IndentedAppendable writer) throws IOException {
  Class c=(Class)type.getType();
  writer.appendLine(c.getSimpleName() + "String_Node_Str");
  writer.indent();
  if (superTypes != null && superTypes.size() > 0) {
    writer.appendList("String_Node_Str",Collections2.transform(superTypes,new Function<RamlType,String>(){
      @Override public String apply(      RamlType input){
        return input.getTypeName();
      }
    }
).toArray(new String[]{}));
  }
  emitter.emitAnnotations(type);
  writeExample(writer);
  if (type.getDescription().isPresent()) {
    writer.appendLine("String_Node_Str" + type.getDescription().get());
  }
  writer.appendLine("String_Node_Str");
  writer.indent();
  for (  RamlProperty ramlProperty : properties.values()) {
    ramlProperty.write(emitter,writer);
  }
  writer.outdent();
  writer.outdent();
}
Program: 20524
Project: 20524
Buggy source:
@Test @Listed(one={1,2,3},two={AnnotationInstanceEmitter.class,AnnotationInstanceEmitterTest.class},three={"String_Node_Str","String_Node_Str","String_Node_Str"}) public void listed() throws Exception {
  Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Listed.class);
  ramlAnnotationOfType(Listed.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(wrap(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}

Fixed version (ground truth):
@Test @Listed(one={1,2,3},two={AnnotationInstanceEmitter.class,AnnotationInstanceEmitterTest.class},three={"String_Node_Str","String_Node_Str","String_Node_Str"}) public void listed() throws Exception {
  Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Listed.class);
  ramlAnnotationOfType(Listed.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(wrap(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}
Program: 20525
Project: 20525
Buggy source:
@Test @Classed(one=AnnotationInstanceEmitterTest.class) public void classed() throws Exception {
  Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Classed.class);
  ramlAnnotationOfType(Classed.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(wrap(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}

Fixed version (ground truth):
@Test @Classed(one=AnnotationInstanceEmitterTest.class) public void classed() throws Exception {
  Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Classed.class);
  ramlAnnotationOfType(Classed.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(wrap(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}
Program: 20526
Project: 20526
Buggy source:
@Test @Simple(one="String_Node_Str") public void simple() throws Exception {
  final Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Simple.class);
  ramlAnnotationOfType(Simple.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(new SimpleAnnotable(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}

Fixed version (ground truth):
@Test @Simple(one="String_Node_Str") public void simple() throws Exception {
  final Annotation annotation=AnnotationInstanceEmitterTest.class.getDeclaredMethod("String_Node_Str").getAnnotation(Simple.class);
  ramlAnnotationOfType(Simple.class,annotation);
  AnnotationInstanceEmitter emitter=new AnnotationInstanceEmitter(writer,Collections.singletonList(ramlAnnotation));
  emitter.emitAnnotations(new SimpleAnnotable(annotation));
  verify(writer).appendLine("String_Node_Str");
  verify(writer).appendLine("String_Node_Str");
}
Program: 20527
Project: 20527
Buggy source:
private void writeMethod(RamlResourceMethod method) throws IOException {
  writer.appendLine(format("String_Node_Str",method.getHttpMethod()));
  writer.indent();
  Optional<String> description=method.getDescription();
  if (description.isPresent()) {
    writeDescription(description.get());
  }
  if (!method.getConsumedMediaTypes().isEmpty() && method.getConsumedType().isPresent()) {
    Type type=method.getConsumedType().get().getType();
    writer.appendLine("String_Node_Str");
    writer.indent();
    for (    RamlMediaType ramlMediaType : method.getConsumedMediaTypes()) {
      TypeHandler typeHandler=pickTypeHandler(method,ramlMediaType,type);
      typeHandler.writeType(typeRegistry,writer,ramlMediaType,method,method.getConsumedType().get());
    }
  }
  ResponseHandler handler=pickResponseHandler(method);
  TypeSelector selector=new TypeSelector(){
    @Override public TypeHandler pickTypeWriter(    RamlResourceMethod method,    RamlMediaType producedMediaType){
      return pickTypeHandler(method,producedMediaType,method.getProducedType().get().getType());
    }
  }
;
  if (!method.getProducedMediaTypes().isEmpty()) {
    writer.appendLine("String_Node_Str");
    writer.indent();
    handler.writeResponses(typeRegistry,writer,method,selector);
  }
  if (!method.getHeaderParameters().isEmpty()) {
    writeHeaderParameters(method.getHeaderParameters());
  }
  if (!method.getQueryParameters().isEmpty()) {
    writeQueryParameters(method.getQueryParameters());
  }
  writer.outdent();
}

Fixed version (ground truth):
private void writeMethod(RamlResourceMethod method) throws IOException {
  writer.appendLine(format("String_Node_Str",method.getHttpMethod()));
  writer.indent();
  Optional<String> description=method.getDescription();
  if (description.isPresent()) {
    writeDescription(description.get());
  }
  if (!method.getConsumedMediaTypes().isEmpty() && method.getConsumedType().isPresent()) {
    Type type=method.getConsumedType().get().getType();
    writer.appendLine("String_Node_Str");
    writer.indent();
    for (    RamlMediaType ramlMediaType : method.getConsumedMediaTypes()) {
      TypeHandler typeHandler=pickTypeHandler(method,ramlMediaType,type);
      typeHandler.writeType(typeRegistry,writer,ramlMediaType,method,method.getConsumedType().get());
    }
    writer.outdent();
  }
  ResponseHandler handler=pickResponseHandler(method);
  TypeSelector selector=new TypeSelector(){
    @Override public TypeHandler pickTypeWriter(    RamlResourceMethod method,    RamlMediaType producedMediaType){
      return pickTypeHandler(method,producedMediaType,method.getProducedType().get().getType());
    }
  }
;
  if (!method.getProducedMediaTypes().isEmpty()) {
    writer.appendLine("String_Node_Str");
    writer.indent();
    handler.writeResponses(typeRegistry,writer,method,selector);
    writer.outdent();
  }
  if (!method.getHeaderParameters().isEmpty()) {
    writeHeaderParameters(method.getHeaderParameters());
  }
  if (!method.getQueryParameters().isEmpty()) {
    writeQueryParameters(method.getQueryParameters());
  }
  writer.outdent();
}
Program: 20528
Project: 20528
Buggy source:
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity type) throws IOException {
  List<RamlMediaType> mediaTypes=method.getConsumedMediaTypes();
  writeBody(registry,writer,mediaTypes,type);
}

Fixed version (ground truth):
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity type) throws IOException {
  writeBody(registry,writer,ramlMediaType,type);
}
Program: 20529
Project: 20529
Buggy source:
private void writeBody(final TypeRegistry registry,IndentedAppendable writer,List<RamlMediaType> mediaTypes,final RamlEntity bodyType) throws IOException {
  final Class topInterface=(Class)bodyType.getType();
  writer.appendLine("String_Node_Str" + topInterface.getSimpleName());
  writer.outdent();
  TypeScanner scanner=new TypeScanner(){
    @Override public void scanType(    TypeRegistry typeRegistry,    RamlEntity typeClass,    RamlType ramlType){
      rebuildType(typeRegistry,typeClass,this);
    }
  }
;
  scanner.scanType(registry,bodyType,null);
}

Fixed version (ground truth):
private void writeBody(final TypeRegistry registry,IndentedAppendable writer,RamlMediaType mediaTypes,final RamlEntity bodyType) throws IOException {
  final Class topInterface=(Class)bodyType.getType();
  writer.appendLine("String_Node_Str" + topInterface.getSimpleName());
  TypeScanner scanner=new TypeScanner(){
    @Override public void scanType(    TypeRegistry typeRegistry,    RamlEntity typeClass,    RamlType ramlType){
      rebuildType(typeRegistry,typeClass,this);
    }
  }
;
  scanner.scanType(registry,bodyType,null);
}
Program: 20530
Project: 20530
Buggy source:
@Override public void writeResponses(TypeRegistry typeRegistry,IndentedAppendable writer,RamlResourceMethod method,TypeSelector selector) throws IOException {
  if (!method.getProducedType().isPresent()) {
    return;
  }
  writer.appendLine("String_Node_Str");
  writer.indent();
  writer.appendLine("String_Node_Str");
  for (  RamlMediaType producedMediaType : method.getProducedMediaTypes()) {
    writer.indent();
    TypeHandler typeHandler=selector.pickTypeWriter(method,producedMediaType);
    typeHandler.writeType(typeRegistry,writer,producedMediaType,method,method.getProducedType().get());
    writer.outdent();
  }
  writer.outdent();
}

Fixed version (ground truth):
@Override public void writeResponses(TypeRegistry typeRegistry,IndentedAppendable writer,RamlResourceMethod method,TypeSelector selector) throws IOException {
  if (!method.getProducedType().isPresent()) {
    return;
  }
  writer.appendLine("String_Node_Str");
  writer.indent();
  writer.appendLine("String_Node_Str");
  for (  RamlMediaType producedMediaType : method.getProducedMediaTypes()) {
    writer.indent();
    writer.appendLine(producedMediaType.toStringRepresentation() + "String_Node_Str");
    writer.indent();
    TypeHandler typeHandler=selector.pickTypeWriter(method,producedMediaType);
    typeHandler.writeType(typeRegistry,writer,producedMediaType,method,method.getProducedType().get());
    writer.outdent();
    writer.outdent();
  }
  writer.outdent();
}
Program: 20531
Project: 20531
Buggy source:
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity bodyType) throws IOException {
  writer.appendLine(format("String_Node_Str",ramlMediaType.toStringRepresentation()));
  if (ScalarType.fromType(bodyType.getType()).isPresent()) {
    writer.indent();
    writer.appendLine("String_Node_Str" + ScalarType.fromType(bodyType.getType()).get().getRamlSyntax());
    writer.outdent();
  }
 else {
    throw new IOException(bodyType + "String_Node_Str");
  }
  writer.outdent();
}

Fixed version (ground truth):
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity bodyType) throws IOException {
  if (ScalarType.fromType(bodyType.getType()).isPresent()) {
    writer.appendLine("String_Node_Str" + ScalarType.fromType(bodyType.getType()).get().getRamlSyntax());
  }
 else {
    throw new IOException(bodyType + "String_Node_Str");
  }
}
Program: 20532
Project: 20532
Buggy source:
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity type) throws IOException {
  List<RamlMediaType> mediaTypes=method.getConsumedMediaTypes();
  writeBody(registry,writer,mediaTypes,type);
}

Fixed version (ground truth):
@Override public void writeType(TypeRegistry registry,IndentedAppendable writer,RamlMediaType ramlMediaType,RamlResourceMethod method,RamlEntity type) throws IOException {
  writeBody(registry,writer,ramlMediaType,type);
}
Program: 20533
Project: 20533
Buggy source:
private void writeBody(TypeRegistry registry,IndentedAppendable writer,List<RamlMediaType> mediaTypes,RamlEntity bodyType) throws IOException {
  Class type=(Class)bodyType.getType();
  for (  RamlMediaType mediaType : mediaTypes) {
    writer.appendLine(format("String_Node_Str",mediaType.toStringRepresentation()));
    writer.indent();
    writer.appendLine("String_Node_Str" + type.getSimpleName());
    writer.outdent();
    registry.registerType(type.getSimpleName(),bodyType,new TypeScanner(){
      @Override public void scanType(      TypeRegistry typeRegistry,      RamlEntity type,      RamlType ramlType){
        Class c=(Class)type.getType();
        for (        Field field : c.getDeclaredFields()) {
          Type genericType=field.getGenericType();
          RamlType fieldRamlType;
          fieldRamlType=PluginUtilities.getRamlType(c.getSimpleName(),typeRegistry,type.createDependent(genericType),this);
          XmlElement elem=field.getAnnotation(XmlElement.class);
          if (elem != null) {
            String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
            ramlType.addProperty(RamlProperty.createProperty(name,fieldRamlType));
          }
 else {
            XmlAttribute attribute=field.getAnnotation(XmlAttribute.class);
            if (attribute != null) {
              String name=elem.name().equals("String_Node_Str") ? field.getName() : elem.name();
              ramlType.addProperty(RamlProperty.createProperty(name,fieldRamlType));
            }
          }
        }
      }
    }
);
  }
  writer.outdent();
}

Fixed version (ground truth):
private void writeBody(TypeRegistry registry,IndentedAppendable writer,RamlMediaType mediaTypes,RamlEntity bodyType) throws IOException {
  Class type=(Class)bodyType.getType();
  writer.appendLine("String_Node_Str" + type.getSimpleName());
  registry.registerType(type.getSimpleName(),bodyType,new SimpleJaxbTypeScanner());
}
Program: 20534
Project: 20534
Buggy source:
private void handleMethodConsumer(MethodSpec.Builder methodSpec,Multimap<String,String> ramlTypeToMediaType,GType typeDeclaration){
  Collection<String> mediaTypes=ramlTypeToMediaType.get(typeDeclaration.type());
  AnnotationSpec.Builder ann=buildAnnotation(mediaTypes,Consumes.class);
  methodSpec.addAnnotation(ann.build());
}

Fixed version (ground truth):
private void handleMethodConsumer(MethodSpec.Builder methodSpec,Multimap<String,String> ramlTypeToMediaType,GType typeDeclaration){
  Collection<String> mediaTypes=ramlTypeToMediaType.get(typeDeclaration.name());
  AnnotationSpec.Builder ann=buildAnnotation(mediaTypes,Consumes.class);
  methodSpec.addAnnotation(ann.build());
}
Program: 20536
Project: 20536
Buggy source:
private static Map<String,String> parseString(String configString){
  Map<String,String> props=new HashMap<>();
  String[] propArray=configString.split("String_Node_Str");
  for (  String prop : propArray) {
    String[] pair=prop.split("String_Node_Str");
    if (pair.length == 1) {
      props.put(pair[0],"String_Node_Str");
    }
 else {
      props.put(pair[0],pair[1]);
    }
  }
  return props;
}

Fixed version (ground truth):
private static Map<String,String> parseString(String configString){
  Map<String,String> props=new HashMap<>();
  if (configString == null) {
    return props;
  }
  String[] propArray=configString.split("String_Node_Str");
  for (  String prop : propArray) {
    String[] pair=prop.split("String_Node_Str");
    if (pair.length == 1) {
      props.put(pair[0],"String_Node_Str");
    }
 else {
      props.put(pair[0],pair[1]);
    }
  }
  return props;
}
Program: 20537
Project: 20537
Buggy source:
private void buildResource(TypeSpec.Builder typeSpec,GResource currentResource){
  Multimap<GMethod,GRequest> incomingBodies=ArrayListMultimap.create();
  Multimap<GMethod,GResponse> responses=ArrayListMultimap.create();
  ResourceUtils.fillInBodiesAndResponses(currentResource,incomingBodies,responses);
  createResponseClass(typeSpec,incomingBodies,responses);
  for (  GMethod gMethod : incomingBodies.keySet()) {
    Set<String> mediaTypesForMethod=fetchAllMediaTypesForMethodResponses(gMethod);
    Multimap<String,String> ramlTypeToMediaType=accumulateMediaTypesPerType(incomingBodies,gMethod);
    String methodName=Names.resourceMethodName(gMethod.resource(),gMethod);
    if (gMethod.body().size() == 0) {
      createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,methodName);
    }
 else {
      for (      GRequest gRequest : gMethod.body()) {
        if (gRequest.type() == null) {
          createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,methodName);
        }
 else {
          createMethodWithBody(typeSpec,gMethod,ramlTypeToMediaType,methodName,gRequest);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void buildResource(TypeSpec.Builder typeSpec,GResource currentResource){
  Multimap<GMethod,GRequest> incomingBodies=ArrayListMultimap.create();
  Multimap<GMethod,GResponse> responses=ArrayListMultimap.create();
  ResourceUtils.fillInBodiesAndResponses(currentResource,incomingBodies,responses);
  createResponseClass(typeSpec,incomingBodies,responses);
  for (  GMethod gMethod : currentResource.methods()) {
    String methodName=Names.resourceMethodName(gMethod.resource(),gMethod);
    Set<String> mediaTypesForMethod=fetchAllMediaTypesForMethodResponses(gMethod);
    if (gMethod.body().size() == 0) {
      createMethodWithoutBody(typeSpec,gMethod,mediaTypesForMethod,methodName);
    }
 else {
      Multimap<String,String> ramlTypeToMediaType=accumulateMediaTypesPerType(incomingBodies,gMethod);
      for (      GRequest gRequest : gMethod.body()) {
        if (ramlTypeToMediaType.containsKey(gRequest.type().name())) {
          createMethodWithBody(typeSpec,gMethod,ramlTypeToMediaType,methodName,gRequest);
          ramlTypeToMediaType.removeAll(gRequest.type().name());
        }
      }
    }
  }
}
Program: 20538
Project: 20538
Buggy source:
/** 
 * <p>getFullyQualifiedName.</p>
 * @return a {@link java.lang.String} object.
 */
public String getFullyQualifiedName(){
  return null;
}

Fixed version (ground truth):
/** 
 * <p>getFullyQualifiedName.</p>
 * @return a {@link java.lang.String} object.
 */
public String getFullyQualifiedName(){
  return this.element.getQualifiedName().toString();
}
Program: 20540
Project: 20540
Buggy source:
private void visitType(IType q){
  if (!types.add(q)) {
    return;
  }
  IFile file=container.getFile(new Path(q.getElementName() + "String_Node_Str"));
  if (separateFiles) {
    visitor=new JDTResourceVisitor(file.getLocation().toFile(),classLoader).createResourceVisitor();
    visitor.clear();
  }
  visitor.visit(new JDTType(q));
  if (separateFiles && !visitor.isEmpty()) {
    if (isSingle()) {
      String raml=visitor.getRaml();
      Raml2 build=build(new ByteArrayInputStream(raml.getBytes()),new FileResourceLoader(container.getLocation().toFile()));
      RamlEmitterV2 emmitter=new RamlEmitterV2();
      emmitter.setSingle(true);
      String dump=emmitter.dump(build);
      try {
        save(dump,file);
      }
 catch (      Exception e) {
        MessageDialog.openError(shell,e.getMessage(),e.getMessage());
      }
      return;
    }
 else {
      saveResult(visitor,file);
    }
  }
}

Fixed version (ground truth):
private void visitType(IType q){
  if (!types.add(q)) {
    return;
  }
  IFile file=container.getFile(new Path(q.getElementName() + "String_Node_Str"));
  if (separateFiles) {
    visitor=new JDTResourceVisitor(file.getLocation().toFile(),classLoader).createResourceVisitor();
    visitor.clear();
  }
  visitor.visit(new JDTType(q));
  if (separateFiles && !visitor.isEmpty()) {
    if (isSingle()) {
      String raml=visitor.getRaml();
      Raml2 build=build(new ByteArrayInputStream(raml.getBytes()),new FileResourceLoader(container.getLocation().toFile()));
      RamlEmitterV2 emmitter=new RamlEmitterV2();
      emmitter.setSingle(true);
      String dump=emmitter.dump(build);
      try {
        save(dump,file);
      }
 catch (      Exception e) {
        MessageDialog.openError(shell,e.getMessage(),e.getMessage());
      }
      return;
    }
 else {
      saveResult(visitor,file);
    }
  }
  this.monitor.worked(1);
}
Program: 20541
Project: 20541
Buggy source:
/** 
 * <p>gatherNamespaces.</p>
 * @return a {@link java.util.HashMap} object.
 */
public HashMap<String,String> gatherNamespaces(){
  int n=0;
  HashMap<String,String> map=new HashMap<String,String>();
  fillNamespaceMap(map,n);
  return map;
}

Fixed version (ground truth):
/** 
 * <p>gatherNamespaces.</p>
 * @return a {@link java.util.HashMap} object.
 */
public HashMap<String,String> gatherNamespaces(){
  int n=0;
  HashMap<String,String> map=new HashMap<String,String>();
  fillNamespaceMap(map,n,null);
  return map;
}
Program: 20542
Project: 20542
Buggy source:
private int fillNamespaceMap(HashMap<String,String> map,int n){
  for (  JAXBProperty p : properties) {
    if (p.namespace != null) {
      map.put(p.namespace,"String_Node_Str" + (n++));
    }
    JAXBType type=p.getType();
    if (type != null) {
      n=type.fillNamespaceMap(map,n);
    }
  }
  return n;
}

Fixed version (ground truth):
private int fillNamespaceMap(HashMap<String,String> map,int n,Set<String> processed){
  if (processed == null) {
    processed=new HashSet<String>();
  }
  for (  JAXBProperty p : properties) {
    if (p.namespace != null) {
      map.put(p.namespace,"String_Node_Str" + (n++));
    }
    JAXBType type=p.getType();
    String qName=((ITypeModel)type.originalType).getFullyQualifiedName();
    if (!processed.contains(qName)) {
      processed.add(qName);
      if (type != null) {
        n=type.fillNamespaceMap(map,n,processed);
      }
      processed.remove(qName);
    }
  }
  return n;
}
Program: 20544
Project: 20544
Buggy source:
@Override public void processProperty(ISchemaType type,ISchemaProperty prop,ISerializationNode childNode){
  if (this.structureType == StructureType.COLLECTION) {
    int l=this.array.length();
    for (int i=0; i < l; i++) {
      JSONObject item;
      try {
        item=(JSONObject)this.array.get(i);
        appendProperty(item,type,prop,childNode);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
  }
 else   if (this.structureType == StructureType.MAP) {
    try {
      for (Iterator<?> iter=this.object.keys(); iter.hasNext(); ) {
        String key=iter.next().toString();
        JSONObject value=this.object.getJSONObject(key);
        appendProperty(value,type,prop,childNode);
      }
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
 else {
    appendProperty(this.object,type,prop,childNode);
  }
}

Fixed version (ground truth):
@Override public void processProperty(ISchemaType type,ISchemaProperty prop,ISerializationNode childNode,Set<String> processedTypes){
  if (this.structureType == StructureType.COLLECTION) {
    int l=this.array.length();
    for (int i=0; i < l; i++) {
      JSONObject item;
      try {
        item=(JSONObject)this.array.get(i);
        appendProperty(item,type,prop,childNode);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
  }
 else   if (this.structureType == StructureType.MAP) {
    try {
      for (Iterator<?> iter=this.object.keys(); iter.hasNext(); ) {
        String key=iter.next().toString();
        JSONObject value=this.object.getJSONObject(key);
        appendProperty(value,type,prop,childNode);
      }
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
 else {
    appendProperty(this.object,type,prop,childNode);
  }
}
Program: 20546
Project: 20546
Buggy source:
void processProperty(ISchemaType type,ISchemaProperty prop,ISerializationNode childNode);

Fixed version (ground truth):
void processProperty(ISchemaType type,ISchemaProperty prop,ISerializationNode childNode,Set<String> processedTypes);
Program: 20547
Project: 20547
Buggy source:
@Override public String serialize(ISchemaType type){
  if (type.isSimple()) {
    return null;
  }
  ISerializationNode node=createNode(type,null,null);
  process(type,node);
  return node.getStringValue();
}

Fixed version (ground truth):
@Override public String serialize(ISchemaType type){
  if (type.isSimple()) {
    return null;
  }
  ISerializationNode node=createNode(type,null,null);
  process(type,node,null);
  return node.getStringValue();
}
Program: 20548
Project: 20548
Buggy source:
public void process(ISchemaType type,ISerializationNode node){
  List<ISchemaProperty> properties=type.getProperties();
  if (properties == null) {
    return;
  }
  for (  ISchemaProperty prop : properties) {
    ISchemaType childType=prop instanceof IMapSchemaProperty ? ((IMapSchemaProperty)prop).getValueType() : prop.getType();
    ISerializationNode childNode=createNode(childType,prop,node);
    if (childNode != null) {
      process(childType,childNode);
    }
    node.processProperty(type,prop,childNode);
  }
}

Fixed version (ground truth):
protected void process(ISchemaType type,ISerializationNode node,Set<String> processedTypes){
  List<ISchemaProperty> properties=type.getProperties();
  if (properties == null) {
    return;
  }
  if (processedTypes == null) {
    processedTypes=new HashSet<String>();
  }
  for (  ISchemaProperty prop : properties) {
    ISchemaType childType=prop instanceof IMapSchemaProperty ? ((IMapSchemaProperty)prop).getValueType() : prop.getType();
    String qName=childType.getClassQualifiedName();
    ISerializationNode childNode=createNode(childType,prop,node);
    if (!processedTypes.contains(qName)) {
      processedTypes.add(qName);
      if (childNode != null) {
        process(childType,childNode,processedTypes);
      }
      processedTypes.remove(qName);
    }
    node.processProperty(type,prop,childNode,processedTypes);
  }
}
Program: 20549
Project: 20549
Buggy source:
public boolean AddParameterFilter(String name,AbstractParam parameter,Class<? extends Annotation> annotationClass,JMethod method){
  return false;
}

Fixed version (ground truth):
public boolean AddParameterFilter(String name,AbstractParam parameter,Class<? extends Annotation> annotationClass,JMethod method){
  return true;
}
Program: 20550
Project: 20550
Buggy source:
private ITypeModel getJAXBType(String typeName,IType ownerType) throws JavaModelException {
  Class<?> basicJavaType=getBasicJavaType(typeName);
  if (basicJavaType != null) {
    return new ReflectionType(getClass());
  }
  IType resolveType=resolveType(ownerType,typeName);
  if (resolveType == null) {
    return null;
  }
  return new JDTType(resolveType);
}

Fixed version (ground truth):
private ITypeModel getJAXBType(String typeName,IType ownerType) throws JavaModelException {
  Class<?> basicJavaType=getBasicJavaType(typeName);
  if (basicJavaType != null) {
    return new ReflectionType(basicJavaType);
  }
  IType resolveType=resolveType(ownerType,typeName);
  if (resolveType == null) {
    return null;
  }
  return new JDTType(resolveType);
}
Program: 20552
Project: 20552
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.PUBLIC_MEMBER;
  this.className=model.getFullyQualifiedName();
  if (value != null) {
    type=extractType(value);
  }
  if (this.className.equals("String_Node_Str")) {
    return;
  }
  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);
  }
  if (this.className.equals("String_Node_Str")) {
    return;
  }
  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) {
      String methodName=get ? m.getName().substring(3) : m.getName().substring(2);
      if (!methodName.isEmpty()) {
        properties.add(createProperty(methodName,m));
      }
    }
  }
  for (  IFieldModel f : model.getFields()) {
    if (!f.isStatic()) {
      boolean needToConsume=needToConsume(type,f);
      if (!needToConsume) {
        continue;
      }
      properties.add(createProperty(f.getName(),f));
    }
  }
}
Program: 20553
Project: 20553
Buggy source:
private int fillNamespaceMap(HashMap<String,String> map,int n,Set<String> processed){
  if (processed == null) {
    processed=new HashSet<String>();
  }
  for (  JAXBProperty p : properties) {
    if (p.namespace != null) {
      map.put(p.namespace,"String_Node_Str" + (n++));
    }
    JAXBType type=p.getType();
    String qName=((ITypeModel)type.originalType).getFullyQualifiedName();
    if (!processed.contains(qName)) {
      processed.add(qName);
      if (type != null) {
        n=type.fillNamespaceMap(map,n,processed);
      }
      processed.remove(qName);
    }
  }
  return n;
}

Fixed version (ground truth):
private int fillNamespaceMap(HashMap<String,String> map,int n,Set<String> processed){
  if (processed == null) {
    processed=new HashSet<String>();
  }
  for (  JAXBProperty p : properties) {
    if (p.namespace != null) {
      map.put(p.namespace,"String_Node_Str" + (n++));
    }
    JAXBType type=p.getType();
    String qName=type.getClassName();
    if (!processed.contains(qName)) {
      processed.add(qName);
      if (type != null) {
        n=type.fillNamespaceMap(map,n,processed);
      }
      processed.remove(qName);
    }
  }
  return n;
}
Program: 20554
Project: 20554
Buggy source:
/** 
 * <p>afterSchemaGen.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @param st 
 * @param gotXSD 
 */
protected void afterSchemaGen(ITypeModel t,StructureType st){
  JAXBRegistry rs=new JAXBRegistry();
  JAXBType jaxbModel=rs.getJAXBModel(t);
  if (jaxbModel == null) {
    return;
  }
  ISchemaType schemaModel=null;
  try {
    schemaModel=new SchemaModelBuilder().buildSchemaModel(jaxbModel,st);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (schemaModel == null) {
    return;
  }
  try {
    if (st == null || st == StructureType.COMMON) {
      String xmlExample=new XMLModelSerializer().serialize(schemaModel);
      writeString(xmlExample,constructFileLocation(t.getName(),EXAMPLE,XML,st));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    String jsonExample=new JsonModelSerializer().serialize(schemaModel);
    writeString(jsonExample,constructFileLocation(t.getName(),EXAMPLE,JSON,st));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    String jsonSchema=new JsonSchemaModelSerializer().serialize(schemaModel);
    spec.getCoreRaml().addGlobalSchema(firstLetterToLowerCase(t.getName()),jsonSchema,true,true);
    writeString(jsonSchema,constructFileLocation(t.getName(),SCHEMA,JSON,st));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * <p>afterSchemaGen.</p>
 * @param t a {@link com.mulesoft.jaxrs.raml.annotation.model.ITypeModel} object.
 * @param st 
 * @param gotXSD 
 */
protected void afterSchemaGen(ITypeModel t,StructureType st){
  JAXBRegistry rs=new JAXBRegistry();
  JAXBType jaxbModel=rs.getJAXBModel(t);
  if (jaxbModel == null) {
    return;
  }
  ISchemaType schemaModel=null;
  try {
    schemaModel=new SchemaModelBuilder(rs).buildSchemaModel(jaxbModel,st);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (schemaModel == null) {
    return;
  }
  try {
    if (st == null || st == StructureType.COMMON) {
      String xmlExample=new XMLModelSerializer().serialize(schemaModel);
      writeString(xmlExample,constructFileLocation(t.getName(),EXAMPLE,XML,st));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    String jsonExample=new JsonModelSerializer().serialize(schemaModel);
    writeString(jsonExample,constructFileLocation(t.getName(),EXAMPLE,JSON,st));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    String jsonSchema=new JsonSchemaModelSerializer().serialize(schemaModel);
    spec.getCoreRaml().addGlobalSchema(firstLetterToLowerCase(t.getName()),jsonSchema,true,true);
    writeString(jsonSchema,constructFileLocation(t.getName(),SCHEMA,JSON,st));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 20555
Project: 20555
Buggy source:
/** 
 * <p>Constructor for JAXBAttributeProperty.</p>
 * @param model a {@link com.mulesoft.jaxrs.raml.annotation.model.IBasicModel} object.
 * @param r a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBRegistry} object.
 * @param name a {@link java.lang.String} object.
 */
public JAXBAttributeProperty(IMember model,JAXBRegistry r,String name){
  super(model,r,name);
}

Fixed version (ground truth):
/** 
 * <p>Constructor for JAXBAttributeProperty.</p>
 * @param model a {@link com.mulesoft.jaxrs.raml.annotation.model.IBasicModel} object.
 * @param r a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBRegistry} object.
 * @param name a {@link java.lang.String} object.
 */
public JAXBAttributeProperty(IMember model,JAXBRegistry r,String name){
  super(model,r,name);
  this.isAnyAttribute=model.hasAnnotation(XmlAnyAttribute.class.getSimpleName());
}
Program: 20556
Project: 20556
Buggy source:
/** 
 * <p>getJAXBType.</p>
 * @return a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBType} object.
 */
public List<JAXBType> getJAXBTypes(){
  if (this.originalType.hasAnnotation(XmlJavaTypeAdapter.class.getSimpleName())) {
    ArrayList<JAXBType> list=new ArrayList<JAXBType>();
    if (this.getStructureType() == StructureType.MAP) {
      list.add(registry.getJAXBModel(new ReflectionType(String.class)));
      list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    }
 else {
      list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    }
    return list;
  }
 else   if (this.originalType.hasAnnotation(XmlAnyAttribute.class.getSimpleName())) {
    ArrayList<JAXBType> list=new ArrayList<JAXBType>();
    list.add(registry.getJAXBModel(new ReflectionType(String.class)));
    list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    return list;
  }
 else   if (this.originalType.hasAnnotation(XmlAnyElement.class.getSimpleName())) {
    ArrayList<JAXBType> list=new ArrayList<JAXBType>();
    list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    return list;
  }
  return registry.getJAXBModels(((IMember)originalType).getJAXBTypes());
}

Fixed version (ground truth):
/** 
 * <p>getJAXBType.</p>
 * @return a {@link com.mulesoft.jaxrs.raml.jaxb.JAXBType} object.
 */
public List<JAXBType> getJAXBTypes(){
  if (this.originalType.hasAnnotation(XmlJavaTypeAdapter.class.getSimpleName())) {
    ArrayList<JAXBType> list=new ArrayList<JAXBType>();
    if (this.getStructureType() == StructureType.MAP) {
      list.add(registry.getJAXBModel(new ReflectionType(String.class)));
      list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    }
 else {
      list.add(registry.getJAXBModel(new ReflectionType(Object.class)));
    }
    return list;
  }
  return registry.getJAXBModels(((IMember)originalType).getJAXBTypes());
}
Program: 20557
Project: 20557
Buggy source:
private JAXBProperty createProperty(String string,IMember m){
  boolean isElement=m.hasAnnotation(XmlElement.class.getSimpleName());
  boolean isAttribute=m.hasAnnotation(XmlAttribute.class.getSimpleName());
  boolean isValue=m.hasAnnotation(javax.xml.bind.annotation.XmlValue.class.getSimpleName());
  if (isElement) {
    return new JAXBElementProperty(m,registry,string);
  }
  if (isAttribute) {
    return new JAXBAttributeProperty(m,registry,string);
  }
  if (isValue) {
    return new JAXBAttributeProperty(m,registry,string);
  }
  return new JAXBElementProperty(m,registry,string);
}

Fixed version (ground truth):
private JAXBProperty createProperty(String string,IMember m){
  boolean isElement=m.hasAnnotation(XmlElement.class.getSimpleName());
  boolean isAttribute=m.hasAnnotation(XmlAttribute.class.getSimpleName()) || m.hasAnnotation(XmlAnyAttribute.class.getSimpleName());
  ;
  boolean isValue=m.hasAnnotation(javax.xml.bind.annotation.XmlValue.class.getSimpleName());
  if (isElement) {
    return new JAXBElementProperty(m,registry,string);
  }
  if (isAttribute) {
    return new JAXBAttributeProperty(m,registry,string);
  }
  if (isValue) {
    return new JAXBAttributeProperty(m,registry,string);
  }
  return new JAXBElementProperty(m,registry,string);
}
Program: 20559
Project: 20559
Buggy source:
public SchemaModelBuilder(){
  super();
}

Fixed version (ground truth):
public SchemaModelBuilder(JAXBRegistry registry){
  super();
  this.registry=registry;
}