nus-yam/ex-repair huggingface dataset:
Program: 31587
Project: 31587
Buggy source:
public TreeContext getTreeContext(String xml){
  XMLInputFactory fact=XMLInputFactory.newInstance();
  TreeContext context=new TreeContext();
  try {
    Stack<ITree> trees=new Stack<>();
    XMLEventReader r=fact.createXMLEventReader(new StringReader(xml));
    while (r.hasNext()) {
      XMLEvent ev=r.nextEvent();
      if (ev.isStartElement()) {
        StartElement s=ev.asStartElement();
        String typeLabel=s.getName().getLocalPart();
        if (typeLabel.equals("String_Node_Str"))         setLength(trees.peek(),s);
 else {
          int type=typeLabel.hashCode();
          ITree t=context.createTree(type,"String_Node_Str",typeLabel);
          if (trees.isEmpty()) {
            context.setRoot(t);
            t.setPos(0);
          }
 else {
            t.setParentAndUpdateChildren(trees.peek());
            setPos(t,s);
          }
          trees.push(t);
        }
      }
 else       if (ev.isEndElement()) {
        EndElement end=ev.asEndElement();
        if (!end.getName().getLocalPart().equals("String_Node_Str"))         trees.pop();
      }
 else       if (ev.isCharacters()) {
        Characters chars=ev.asCharacters();
        if (!chars.isWhiteSpace() && trees.peek().getLabel().equals("String_Node_Str") && labeled.contains(context.getTypeLabel(trees.peek().getType())))         trees.peek().setLabel(chars.getData().trim());
      }
    }
    fixPos(context);
    context.validate();
    return context;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public TreeContext getTreeContext(String xml){
  XMLInputFactory fact=XMLInputFactory.newInstance();
  context=new TreeContext();
  currentLabel=new StringBuffer();
  try {
    Stack<ITree> trees=new Stack<>();
    XMLEventReader r=fact.createXMLEventReader(new StringReader(xml));
    while (r.hasNext()) {
      XMLEvent ev=r.nextEvent();
      if (ev.isStartElement()) {
        StartElement s=ev.asStartElement();
        String typeLabel=s.getName().getLocalPart();
        if (typeLabel.equals("String_Node_Str"))         setLength(trees.peek(),s);
 else {
          int type=typeLabel.hashCode();
          ITree t=context.createTree(type,"String_Node_Str",typeLabel);
          if (trees.isEmpty()) {
            context.setRoot(t);
            t.setPos(0);
          }
 else {
            t.setParentAndUpdateChildren(trees.peek());
            setPos(t,s);
          }
          trees.push(t);
        }
      }
 else       if (ev.isEndElement()) {
        EndElement end=ev.asEndElement();
        if (!end.getName().getLocalPart().equals("String_Node_Str")) {
          if (isLabeled(trees))           trees.peek().setLabel(currentLabel.toString());
          trees.pop();
          currentLabel=new StringBuffer();
        }
      }
 else       if (ev.isCharacters()) {
        Characters chars=ev.asCharacters();
        if (!chars.isWhiteSpace() && isLabeled(trees))         currentLabel.append(chars.getData().trim());
      }
    }
    fixPos(context);
    context.validate();
    return context;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 31588
Project: 31588
Buggy source:
public void load(ITree tree,String key,String value) throws Exception {
  MetadataUnserializer s=serializers.get(key);
  if (s != null)   tree.setMetadata(key,s.fromString(value));
}

Fixed version (ground truth):
public void load(ITree tree,String key,String value) throws Exception {
  MetadataUnserializer s=serializers.get(key);
  if (s != null) {
    if (key.equals("String_Node_Str"))     tree.setPos(Integer.parseInt(value));
 else     if (key.equals("String_Node_Str"))     tree.setLength(Integer.parseInt(value));
 else     tree.setMetadata(key,s.fromString(value));
  }
}
Program: 31589
Project: 31589
Buggy source:
private void lastChanceMatch(ITree src,ITree dst){
  Map<Integer,List<ITree>> srcKinds=new HashMap<>();
  Map<Integer,List<ITree>> dstKinds=new HashMap<>();
  for (  ITree c : src.getChildren()) {
    if (!srcKinds.containsKey(c.getType()))     srcKinds.put(c.getType(),new ArrayList<>());
    srcKinds.get(c.getType()).add(c);
  }
  for (  ITree c : dst.getChildren()) {
    if (!dstKinds.containsKey(c.getType()))     dstKinds.put(c.getType(),new ArrayList<>());
    dstKinds.get(c.getType()).add(c);
  }
  for (  int t : srcKinds.keySet())   if (srcKinds.get(t).size() == dstKinds.get(t).size() && srcKinds.get(t).size() == 1)   addMapping(srcKinds.get(t).get(0),dstKinds.get(t).get(0));
}

Fixed version (ground truth):
private void lastChanceMatch(ITree src,ITree dst){
  Map<Integer,List<ITree>> srcKinds=new HashMap<>();
  Map<Integer,List<ITree>> dstKinds=new HashMap<>();
  for (  ITree c : src.getChildren()) {
    if (!srcKinds.containsKey(c.getType()))     srcKinds.put(c.getType(),new ArrayList<>());
    srcKinds.get(c.getType()).add(c);
  }
  for (  ITree c : dst.getChildren()) {
    if (!dstKinds.containsKey(c.getType()))     dstKinds.put(c.getType(),new ArrayList<>());
    dstKinds.get(c.getType()).add(c);
  }
  for (  int t : srcKinds.keySet())   if (dstKinds.get(t) != null && srcKinds.get(t).size() == dstKinds.get(t).size() && srcKinds.get(t).size() == 1)   addMapping(srcKinds.get(t).get(0),dstKinds.get(t).get(0));
}
Program: 31590
Project: 31590
Buggy source:
@Override public void classify(){
  for (  Action a : actions) {
    if (a instanceof Insert) {
      dstAddTrees.add(a.getNode());
    }
 else     if (a instanceof Delete) {
      srcDelTrees.add(a.getNode());
    }
 else     if (a instanceof Update) {
      srcUpdTrees.add(a.getNode());
      dstUpdTrees.add(mappings.getDst(a.getNode()));
    }
 else     if (a instanceof Move) {
      srcMvTrees.add(a.getNode());
      dstMvTrees.add(mappings.getDst(a.getNode()));
    }
  }
  Set<Tree> fDstAddTrees=new HashSet<>();
  for (  Tree t : dstAddTrees)   if (!dstAddTrees.contains(t.getParent()))   fDstAddTrees.add(t);
  dstAddTrees=fDstAddTrees;
  Set<Tree> fSrcDelTrees=new HashSet<>();
  for (  Tree t : srcDelTrees) {
    if (!srcDelTrees.contains(t.getParent()))     fSrcDelTrees.add(t);
  }
  srcDelTrees=fSrcDelTrees;
  Set<Tree> fSrcMvTrees=new HashSet<>();
  for (  Tree t : srcDelTrees) {
    if (!srcDelTrees.contains(t.getParent()))     fSrcDelTrees.add(t);
  }
  srcDelTrees=fSrcDelTrees;
}

Fixed version (ground truth):
@Override public void classify(){
  for (  Action a : actions) {
    if (a instanceof Insert) {
      dstAddTrees.add(a.getNode());
    }
 else     if (a instanceof Delete) {
      srcDelTrees.add(a.getNode());
    }
 else     if (a instanceof Update) {
      srcUpdTrees.add(a.getNode());
      dstUpdTrees.add(mappings.getDst(a.getNode()));
    }
 else     if (a instanceof Move) {
      srcMvTrees.add(a.getNode());
      dstMvTrees.add(mappings.getDst(a.getNode()));
    }
  }
  Set<Tree> fDstAddTrees=new HashSet<>();
  for (  Tree t : dstAddTrees)   if (!dstAddTrees.contains(t.getParent()))   fDstAddTrees.add(t);
  dstAddTrees=fDstAddTrees;
  Set<Tree> fSrcDelTrees=new HashSet<>();
  for (  Tree t : srcDelTrees) {
    if (!srcDelTrees.contains(t.getParent()))     fSrcDelTrees.add(t);
  }
  srcDelTrees=fSrcDelTrees;
  Set<Tree> fSrcMvTrees=new HashSet<>();
  for (  Tree t : srcMvTrees) {
    if (!srcMvTrees.contains(t.getParent()))     fSrcMvTrees.add(t);
  }
  srcMvTrees=fSrcMvTrees;
}
Program: 31591
Project: 31591
Buggy source:
@SuppressWarnings("String_Node_Str") public PriorityTreeList(Tree tree){
  trees=(List<Tree>[])new ArrayList[tree.getHeight() - MIN_HEIGHT + 1];
  maxHeight=tree.getHeight();
  addTree(tree);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public PriorityTreeList(Tree tree){
  int listSize=tree.getHeight() - MIN_HEIGHT + 1;
  if (listSize < 0)   listSize=0;
  if (listSize == 0)   currentIdx=-1;
  trees=(List<Tree>[])new ArrayList[listSize];
  maxHeight=tree.getHeight();
  addTree(tree);
}
Program: 31592
Project: 31592
Buggy source:
private TreeGeneratorRegistry(){
  producers=new ArrayList<>();
  producers.add(new JdtTreeGenerator());
  producers.add(new CdJdtTreeGenerator());
  producers.add(new RhinoTreeGenerator());
  producers.add(new XMLTreeGenerator());
  producers.add(new CTreeGenerator());
}

Fixed version (ground truth):
private TreeGeneratorRegistry(){
  producers=new ArrayList<>();
  producers.add(new JdtTreeGenerator());
  producers.add(new CdJdtTreeGenerator());
  producers.add(new RhinoTreeGenerator());
  producers.add(new CTreeGenerator());
}
Program: 31593
Project: 31593
Buggy source:
public CloudFogView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  init();
}

Fixed version (ground truth):
public CloudFogView(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.custom_view);
  isStatic=a.getBoolean(R.styleable.custom_view_isStatic,this.isStatic);
  strokeColor=a.getColor(R.styleable.custom_view_strokeColor,this.strokeColor);
  if (strokeColor == 0) {
    strokeColor=Color.BLACK;
  }
  bgColor=a.getColor(R.styleable.custom_view_bgColor,this.bgColor);
  if (bgColor == 0) {
    bgColor=Color.WHITE;
  }
  init();
}
Program: 31594
Project: 31594
Buggy source:
public CloudThunderView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  init();
}

Fixed version (ground truth):
public CloudThunderView(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.custom_view);
  isStatic=a.getBoolean(R.styleable.custom_view_isStatic,this.isStatic);
  strokeColor=a.getColor(R.styleable.custom_view_strokeColor,this.strokeColor);
  if (strokeColor == 0) {
    strokeColor=Color.BLACK;
  }
  bgColor=a.getColor(R.styleable.custom_view_bgColor,this.bgColor);
  if (bgColor == 0) {
    bgColor=Color.WHITE;
  }
  init();
}
Program: 31595
Project: 31595
Buggy source:
public CloudHvRainView(Context context,AttributeSet attrs){
  super(context,attrs);
  String num1[]=attrs.getAttributeValue(0).split("String_Node_Str");
  String num2[]=attrs.getAttributeValue(1).split("String_Node_Str");
  screenW=Integer.valueOf(num1[0]);
  screenH=Integer.valueOf(num2[0]);
  X=screenW / 2;
  Y=(screenH / 2);
  radius1=90;
  radius2=50;
  init();
}

Fixed version (ground truth):
public CloudHvRainView(Context context,AttributeSet attrs){
  super(context,attrs);
  init();
}
Program: 31596
Project: 31596
Buggy source:
public CloudMoonView(Context context,AttributeSet attrs){
  super(context,attrs);
  String num1[]=attrs.getAttributeValue(0).split("String_Node_Str");
  String num2[]=attrs.getAttributeValue(1).split("String_Node_Str");
  screenW=Integer.valueOf(num1[0]);
  screenH=Integer.valueOf(num2[0]);
  X=screenW / 2;
  Y=(screenH / 2);
  X2=screenW * 0.75f;
  Y2=(screenH * 0.2f);
  radius=screenW / 7;
  init();
}

Fixed version (ground truth):
public CloudMoonView(Context context,AttributeSet attrs){
  super(context,attrs);
  init();
}
Program: 31597
Project: 31597
Buggy source:
private void init(){
  count=0;
  paint=new Paint();
  paint1=new Paint();
  paint.setColor(Color.BLACK);
  paint.setStrokeWidth(10);
  paint.setAntiAlias(true);
  paint.setStrokeCap(Paint.Cap.ROUND);
  paint.setStrokeJoin(Paint.Join.ROUND);
  paint.setStyle(Paint.Style.STROKE);
  paint.setShadowLayer(0,0,0,Color.BLACK);
  paint1.setColor(Color.BLACK);
  paint1.setStrokeWidth(8);
  paint1.setAntiAlias(true);
  paint1.setStrokeCap(Paint.Cap.ROUND);
  paint1.setStyle(Paint.Style.FILL_AND_STROKE);
  path=new Path();
}

Fixed version (ground truth):
private void init(){
  count=0;
  paint=new Paint();
  paint1=new Paint();
  paint.setColor(Color.BLACK);
  paint.setStrokeWidth(10);
  paint.setAntiAlias(true);
  paint.setStrokeCap(Paint.Cap.ROUND);
  paint.setStrokeJoin(Paint.Join.ROUND);
  paint.setStyle(Paint.Style.STROKE);
  paint.setShadowLayer(0,0,0,Color.BLACK);
  paint1.setColor(Color.BLACK);
  paint1.setStrokeWidth(8);
  paint1.setAntiAlias(true);
  paint1.setStrokeCap(Paint.Cap.ROUND);
  paint1.setStyle(Paint.Style.FILL);
  path=new Path();
}
Program: 31599
Project: 31599
Buggy source:
public CloudRainView(Context context,AttributeSet attrs){
  super(context,attrs);
  String num1[]=attrs.getAttributeValue(0).split("String_Node_Str");
  String num2[]=attrs.getAttributeValue(1).split("String_Node_Str");
  screenW=Integer.valueOf(num1[0]);
  screenH=Integer.valueOf(num2[0]);
  X=screenW / 2;
  Y=(screenH / 2);
  radius1=90;
  radius2=50;
  init();
}

Fixed version (ground truth):
public CloudRainView(Context context,AttributeSet attrs){
  super(context,attrs);
  String num1[]=attrs.getAttributeValue(0).split("String_Node_Str");
  String num2[]=attrs.getAttributeValue(1).split("String_Node_Str");
  screenW=Integer.valueOf(num1[0]);
  screenH=Integer.valueOf(num2[0]);
  X=screenW / 2;
  Y=(screenH / 2);
  init();
}
Program: 31600
Project: 31600
Buggy source:
@Override public void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  screenW=w;
  screenH=h;
  X=screenW / 2;
  Y=(screenH / 2);
}

Fixed version (ground truth):
@Override public void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  screenW=w;
  screenH=h;
  X=screenW / 2;
  Y=(screenH / 2);
  radius1=90;
  radius2=50;
}
Program: 31601
Project: 31601
Buggy source:
public CloudView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  X=screenW / 2;
  Y=(screenH / 2);
  init();
}

Fixed version (ground truth):
public CloudView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  init();
}
Program: 31603
Project: 31603
Buggy source:
private int parseInteger(int bufferIndex,Context context){
  boolean neg=(byteBuffer[bufferIndex] == '-');
  if (neg) {
    ++bufferIndex;
  }
  int limit=bufferLimit;
  long part=0;
  outer1:   while (true) {
    try {
      for (final byte[] buffer=byteBuffer; bufferIndex < limit; bufferIndex++) {
        final int b=buffer[bufferIndex];
        if (b >= '0' && b <= '9') {
          part=part * 10 + (b - '0');
        }
 else {
          break outer1;
        }
      }
    }
  finally {
      if (bufferIndex == limit) {
        if ((bufferIndex=fillBuffer()) == -1) {
          throw new RuntimeException("String_Node_Str");
        }
        limit=bufferLimit;
      }
    }
  }
  if (neg) {
    part*=-1;
  }
  context.longHolder=part;
  return bufferIndex;
}

Fixed version (ground truth):
private int parseInteger(int bufferIndex,Context context){
  boolean neg=(byteBuffer[bufferIndex] == '-');
  if (neg) {
    ++bufferIndex;
  }
  long part=0;
  outer1:   while (true) {
    final int limit=bufferLimit;
    try {
      for (final byte[] buffer=byteBuffer; bufferIndex < limit; bufferIndex++) {
        final int b=buffer[bufferIndex];
        if (b >= '0' && b <= '9') {
          part=part * 10 + (b - '0');
        }
 else {
          break outer1;
        }
      }
    }
  finally {
      if (bufferIndex == limit && ((bufferIndex=fillBuffer()) == -1)) {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  if (neg) {
    part*=-1;
  }
  context.longHolder=part;
  return bufferIndex;
}
Program: 31604
Project: 31604
Buggy source:
/** 
 * Gets the disc Count.
 * @return the Int16
 */
public Int16 getDiscCount(){
  return this.discCount;
}

Fixed version (ground truth):
/** 
 * Gets the disc Count.
 * @return the Integer
 */
public Integer getDiscCount(){
  return this.discCount;
}
Program: 31605
Project: 31605
Buggy source:
/** 
 * Sets the disc.
 * @param value the Int16
 */
public void setDisc(Int16 value){
  this.disc=value;
  valueChanged("String_Node_Str",value);
}

Fixed version (ground truth):
/** 
 * Sets the disc.
 * @param value the Integer
 */
public void setDisc(Integer value){
  this.disc=value;
  valueChanged("String_Node_Str",value);
}
Program: 31606
Project: 31606
Buggy source:
/** 
 * Sets the disc Count.
 * @param value the Int16
 */
public void setDiscCount(Int16 value){
  this.discCount=value;
  valueChanged("String_Node_Str",value);
}

Fixed version (ground truth):
/** 
 * Sets the disc Count.
 * @param value the Integer
 */
public void setDiscCount(Integer value){
  this.discCount=value;
  valueChanged("String_Node_Str",value);
}
Program: 31607
Project: 31607
Buggy source:
/** 
 * Gets the disc.
 * @return the Int16
 */
public Int16 getDisc(){
  return this.disc;
}

Fixed version (ground truth):
/** 
 * Gets the disc.
 * @return the Integer
 */
public Integer getDisc(){
  return this.disc;
}
Program: 31608
Project: 31608
Buggy source:
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  if (selectedId == null) {
    setPathForCollections(request.getUrl(),urlComponent,top,skip,select,expand,filter);
  }
 else {
    setSelectorUrl(request.getUrl(),urlComponent,selectedId);
  }
  addCustomParametersToODataURL(request.getUrl(),getParameters());
  return parent.oDataExecute(request);
}

Fixed version (ground truth):
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  if (selectedId == null) {
    setPathForCollections(request.getUrl(),urlComponent,top,skip,select,expand,filter);
  }
 else {
    setSelectorUrl(request.getUrl(),urlComponent,selectedId);
  }
  addCustomParametersToODataRequest(request,getParameters(),getHeaders());
  return parent.oDataExecute(request);
}
Program: 31609
Project: 31609
Buggy source:
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  ODataURL oDataURL=request.getUrl();
  oDataURL.prependPathComponent(urlComponent);
  addCustomParametersToODataURL(oDataURL,getParameters());
  return parent.oDataExecute(request);
}

Fixed version (ground truth):
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  ODataURL oDataURL=request.getUrl();
  oDataURL.prependPathComponent(urlComponent);
  addCustomParametersToODataRequest(request,getParameters(),getHeaders());
  return parent.oDataExecute(request);
}
Program: 31610
Project: 31610
Buggy source:
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  request.getUrl().prependPathComponent(urlComponent);
  addCustomParametersToODataURL(request.getUrl(),getParameters());
  return parent.oDataExecute(request);
}

Fixed version (ground truth):
@Override protected ListenableFuture<ODataResponse> oDataExecute(Request request){
  request.getUrl().prependPathComponent(urlComponent);
  addCustomParametersToODataRequest(request,getParameters(),getHeaders());
  return parent.oDataExecute(request);
}
Program: 31611
Project: 31611
Buggy source:
/** 
 * For internal use only. Opens a new transaction if necessary before running statements in case an explicit transaction does not exist. It is designed to be the central point for handling exceptions coming from the DB and apply commit / rollback rules.
 * @param function The callback to execute.
 * @param < T > The result type.
 * @param txType Transaction type, readonly or not.
 * @return The result of the transaction function.
 */
public <T>T doInTransaction(TransactionalUnitOfWork<T> function,Transaction.Type txType){
  Transaction transaction=txManager.getCurrentTransaction();
  if (!driver.requiresTransaction() || transaction != null) {
    return function.doInTransaction();
  }
  transaction=beginTransaction(txType);
  try {
    T result=function.doInTransaction();
    if (transactionManager().canCommit()) {
      transaction.commit();
    }
    return result;
  }
 catch (  CypherException e) {
    logger.warn("String_Node_Str",e.getCode(),e.getDescription());
    if (transactionManager().canRollback()) {
      transaction.rollback();
    }
    throw e;
  }
catch (  Throwable e) {
    logger.warn("String_Node_Str",e.getMessage());
    if (transactionManager().canRollback()) {
      transaction.rollback();
    }
    throw e;
  }
 finally {
    if (!transaction.status().equals(Transaction.Status.CLOSED)) {
      transaction.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * For internal use only. Opens a new transaction if necessary before running statements in case an explicit transaction does not exist. It is designed to be the central point for handling exceptions coming from the DB and apply commit / rollback rules.
 * @param function The callback to execute.
 * @param < T > The result type.
 * @param txType Transaction type, readonly or not.
 * @return The result of the transaction function.
 */
public <T>T doInTransaction(TransactionalUnitOfWork<T> function,boolean forceTx,Transaction.Type txType){
  Transaction transaction=txManager.getCurrentTransaction();
  if (!forceTx && (!driver.requiresTransaction() || transaction != null)) {
    return function.doInTransaction();
  }
  transaction=beginTransaction(txType);
  try {
    T result=function.doInTransaction();
    if (transactionManager().canCommit()) {
      transaction.commit();
    }
    return result;
  }
 catch (  CypherException e) {
    logger.warn("String_Node_Str",e.getCode(),e.getDescription());
    if (transactionManager().canRollback()) {
      transaction.rollback();
    }
    throw e;
  }
catch (  Throwable e) {
    logger.warn("String_Node_Str",e.getMessage());
    if (transactionManager().canRollback()) {
      transaction.rollback();
    }
    throw e;
  }
 finally {
    if (!transaction.status().equals(Transaction.Status.CLOSED)) {
      transaction.close();
    }
  }
}
Program: 31613
Project: 31613
Buggy source:
private Collection<CompositeIndex> compositeIndexes(){
  propertyFields();
  CompositeIndex[] annotations=cls.getDeclaredAnnotationsByType(CompositeIndex.class);
  ArrayList<CompositeIndex> result=new ArrayList<>(annotations.length);
  for (  CompositeIndex annotation : annotations) {
    String[] properties=annotation.value().length > 0 ? annotation.value() : annotation.properties();
    if (properties.length < 1) {
      throw new MetadataException("String_Node_Str" + className + "String_Node_Str");
    }
    for (    String property : properties) {
      FieldInfo fieldInfo=propertyFields.get(property);
      if (fieldInfo == null) {
        throw new MetadataException("String_Node_Str" + className + "String_Node_Str"+ property+ "String_Node_Str");
      }
    }
    result.add(annotation);
  }
  return result;
}

Fixed version (ground truth):
private Collection<CompositeIndex> compositeIndexes(){
  propertyFields();
  if (cls == null) {
    try {
      cls=Class.forName(className,false,Thread.currentThread().getContextClassLoader());
    }
 catch (    ClassNotFoundException e) {
      throw new RuntimeException("String_Node_Str" + className,e);
    }
  }
  CompositeIndex[] annotations=cls.getDeclaredAnnotationsByType(CompositeIndex.class);
  ArrayList<CompositeIndex> result=new ArrayList<>(annotations.length);
  for (  CompositeIndex annotation : annotations) {
    String[] properties=annotation.value().length > 0 ? annotation.value() : annotation.properties();
    if (properties.length < 1) {
      throw new MetadataException("String_Node_Str" + className + "String_Node_Str");
    }
    for (    String property : properties) {
      FieldInfo fieldInfo=propertyFields.get(property);
      if (fieldInfo == null) {
        throw new MetadataException("String_Node_Str" + className + "String_Node_Str"+ property+ "String_Node_Str");
      }
    }
    result.add(annotation);
  }
  return result;
}
Program: 31614
Project: 31614
Buggy source:
/** 
 * A property field is any field annotated with @Property, or any field that can be mapped to a node property. The identity field is not a property field.
 * @return A Collection of FieldInfo objects describing the classInfo's property fields
 */
public Collection<FieldInfo> propertyFields(){
  if (fieldInfos == null) {
    if (fieldInfos == null) {
      FieldInfo identityField=identityFieldOrNull();
      fieldInfos=new HashSet<>();
      for (      FieldInfo fieldInfo : fieldsInfo().fields()) {
        if (fieldInfo != identityField && !fieldInfo.isLabelField() && !fieldInfo.hasAnnotation(StartNode.class) && !fieldInfo.hasAnnotation(EndNode.class)) {
          AnnotationInfo annotationInfo=fieldInfo.getAnnotations().get(Property.class);
          if (annotationInfo == null) {
            if (fieldInfo.persistableAsProperty()) {
              fieldInfos.add(fieldInfo);
            }
          }
 else {
            fieldInfos.add(fieldInfo);
          }
        }
      }
    }
  }
  return fieldInfos;
}

Fixed version (ground truth):
/** 
 * A property field is any field annotated with @Property, or any field that can be mapped to a node property. The identity field is not a property field.
 * @return A Collection of FieldInfo objects describing the classInfo's property fields
 */
public Collection<FieldInfo> propertyFields(){
  if (fieldInfos == null) {
    initPropertyFields();
  }
  return fieldInfos;
}
Program: 31615
Project: 31615
Buggy source:
/** 
 * Finds the property field with a specific property name from the ClassInfo's property fields Note that this method does not allow for property names with differing case. //TODO
 * @param propertyName the propertyName of the field to find
 * @return A FieldInfo object describing the required property field, or null if it doesn't exist.
 */
public FieldInfo propertyField(String propertyName){
  if (propertyFields == null) {
    if (propertyFields == null) {
      Collection<FieldInfo> fieldInfos=propertyFields();
      propertyFields=new HashMap<>(fieldInfos.size());
      for (      FieldInfo fieldInfo : fieldInfos) {
        propertyFields.put(fieldInfo.property().toLowerCase(),fieldInfo);
      }
    }
  }
  return propertyFields.get(propertyName.toLowerCase());
}

Fixed version (ground truth):
/** 
 * Finds the property field with a specific property name from the ClassInfo's property fields Note that this method does not allow for property names with differing case. //TODO
 * @param propertyName the propertyName of the field to find
 * @return A FieldInfo object describing the required property field, or null if it doesn't exist.
 */
public FieldInfo propertyField(String propertyName){
  if (propertyFields == null) {
    initPropertyFields();
  }
  return propertyFields.get(propertyName.toLowerCase());
}
Program: 31616
Project: 31616
Buggy source:
private NodeModel buildNode(Object node){
  NodeModel nodeModel=new NodeModel();
  nodeModel.setId(nodeId(node));
  List<String> labels=labels(node);
  nodeModel.setLabels(labels.toArray(new String[labels.size()]));
  nodeModel.setProperties(properties(node));
  return nodeModel;
}

Fixed version (ground truth):
private NodeModel buildNode(Object node){
  NodeModel nodeModel=new NodeModel();
  nodeModel.setId(nodeId(node));
  List<String> labels=labels(node);
  nodeModel.setLabels(labels.toArray(new String[labels.size()]));
  nodeModel.setProperties(convertArrayPropertiesToIterable(properties(node)));
  return nodeModel;
}
Program: 31617
Project: 31617
Buggy source:
@Before public void init() throws IOException {
  session=sessionFactory.openSession();
}

Fixed version (ground truth):
@Before public void init() throws IOException {
  session=sessionFactory.openSession();
  session.purgeDatabase();
}
Program: 31618
Project: 31618
Buggy source:
@Test public void testUnauthorizedDriver(){
  session=new SessionFactory(baseConfiguration.credentials("String_Node_Str","String_Node_Str").build(),"String_Node_Str").openSession();
  try (Transaction tx=session.beginTransaction()){
    tx.commit();
    fail("String_Node_Str");
  }
 catch (  Exception rpe) {
    Throwable cause=rpe.getCause();
    while (!(cause instanceof HttpResponseException)) {
      cause=cause.getCause();
    }
    assertTrue(cause.getMessage().startsWith("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testUnauthorizedDriver(){
  if (DriverManager.getDriver() instanceof HttpDriver) {
    session=new SessionFactory(baseConfiguration.credentials("String_Node_Str","String_Node_Str").build(),"String_Node_Str").openSession();
    try (Transaction tx=session.beginTransaction()){
      tx.commit();
      fail("String_Node_Str");
    }
 catch (    Exception rpe) {
      Throwable cause=rpe.getCause();
      while (!(cause instanceof HttpResponseException)) {
        cause=cause.getCause();
      }
      assertTrue(cause.getMessage().startsWith("String_Node_Str"));
    }
  }
}
Program: 31619
Project: 31619
Buggy source:
/** 
 * @see issue #35
 */
@Test public void testInvalidCredentials(){
  session=new SessionFactory(baseConfiguration.credentials("String_Node_Str","String_Node_Str").build(),"String_Node_Str").openSession();
  try (Transaction tx=session.beginTransaction()){
    fail("String_Node_Str");
  }
 catch (  Exception rpe) {
    Throwable cause=rpe.getCause();
    while (!(cause instanceof HttpResponseException)) {
      cause=cause.getCause();
    }
    assertEquals("String_Node_Str",cause.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @see issue #35
 */
@Test public void testInvalidCredentials(){
  if (DriverManager.getDriver() instanceof HttpDriver) {
    session=new SessionFactory(baseConfiguration.credentials("String_Node_Str","String_Node_Str").build(),"String_Node_Str").openSession();
    try (Transaction tx=session.beginTransaction()){
      fail("String_Node_Str");
    }
 catch (    Exception rpe) {
      Throwable cause=rpe.getCause();
      while (!(cause instanceof HttpResponseException)) {
        cause=cause.getCause();
      }
      assertEquals("String_Node_Str",cause.getMessage());
    }
  }
}
Program: 31620
Project: 31620
Buggy source:
@Test public void testAuthorizedDriver(){
  session=new SessionFactory(baseConfiguration.build(),"String_Node_Str").openSession();
  try (Transaction ignored=session.beginTransaction()){
    assertNotNull(ignored);
  }
 catch (  Exception rpe) {
    fail("String_Node_Str" + rpe.getLocalizedMessage() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testAuthorizedDriver(){
  if (DriverManager.getDriver() instanceof HttpDriver) {
    session=new SessionFactory(baseConfiguration.build(),"String_Node_Str").openSession();
    try (Transaction ignored=session.beginTransaction()){
      assertNotNull(ignored);
    }
 catch (    Exception rpe) {
      fail("String_Node_Str" + rpe.getLocalizedMessage() + "String_Node_Str");
    }
  }
}
Program: 31621
Project: 31621
Buggy source:
public ServiceNotFoundException(String s){
  super(s);
}

Fixed version (ground truth):
public ServiceNotFoundException(String message,Throwable cause){
  super(message,cause);
}
Program: 31622
Project: 31622
Buggy source:
private Class underlyingElementType(ClassInfo classInfo,String propertyName){
  FieldInfo fieldInfo=fieldInfoForPropertyName(propertyName,classInfo);
  Class clazz=null;
  if (fieldInfo != null) {
    if (fieldInfo.getTypeDescriptor() != null) {
      clazz=ClassUtils.getType(fieldInfo.getTypeDescriptor());
    }
    if (clazz == null && fieldInfo.getTypeParameterDescriptor() != null) {
      clazz=ClassUtils.getType(fieldInfo.getTypeParameterDescriptor());
    }
    if (clazz == null && fieldInfo.getDescriptor() != null) {
      clazz=ClassUtils.getType(fieldInfo.getDescriptor());
    }
  }
  return clazz;
}

Fixed version (ground truth):
private Class underlyingElementType(ClassInfo classInfo,String propertyName){
  FieldInfo fieldInfo=fieldInfoForPropertyName(propertyName,classInfo);
  Class clazz=null;
  if (fieldInfo != null) {
    clazz=ClassUtils.getType(fieldInfo.getTypeDescriptor());
  }
  return clazz;
}
Program: 31623
Project: 31623
Buggy source:
private Class underlyingElementType(ClassInfo classInfo,String propertyName){
  FieldInfo fieldInfo=classInfo.propertyField(propertyName);
  if (fieldInfo != null) {
    String descriptor=fieldInfo.getTypeDescriptor() == null ? fieldInfo.getTypeParameterDescriptor() : fieldInfo.getTypeDescriptor();
    if (descriptor != null) {
      return ClassUtils.getType(descriptor);
    }
  }
  return classInfo.getUnderlyingClass();
}

Fixed version (ground truth):
private Class underlyingElementType(ClassInfo classInfo,String propertyName){
  FieldInfo fieldInfo=classInfo.propertyField(propertyName);
  if (fieldInfo != null) {
    return ClassUtils.getType(fieldInfo.getTypeDescriptor());
  }
  return classInfo.getUnderlyingClass();
}
Program: 31624
Project: 31624
Buggy source:
private static void cacheIterableFieldWriter(ClassInfo classInfo,Class<?> parameterType,String relationshipType,String relationshipDirection,DirectedRelationshipForType directedRelationshipForType,FieldInfo fieldInfo,FieldWriter fieldWriter){
  if (fieldInfo.isParameterisedTypeOf(parameterType)) {
    directedRelationshipForType=new DirectedRelationshipForType(relationshipType,relationshipDirection,ClassUtils.getType(fieldInfo.getTypeParameterDescriptor()));
  }
  iterableWriterCache.get(classInfo).put(directedRelationshipForType,fieldWriter);
}

Fixed version (ground truth):
private static void cacheIterableFieldWriter(ClassInfo classInfo,Class<?> parameterType,String relationshipType,String relationshipDirection,DirectedRelationshipForType directedRelationshipForType,FieldInfo fieldInfo,FieldWriter fieldWriter){
  if (fieldInfo.isParameterisedTypeOf(parameterType)) {
    directedRelationshipForType=new DirectedRelationshipForType(relationshipType,relationshipDirection,ClassUtils.getType(fieldInfo.getTypeDescriptor()));
  }
  iterableWriterCache.get(classInfo).put(directedRelationshipForType,fieldWriter);
}
Program: 31625
Project: 31625
Buggy source:
private static void cacheIterableMethodWriter(ClassInfo classInfo,Class<?> parameterType,String relationshipType,String relationshipDirection,DirectedRelationshipForType directedRelationshipForType,MethodInfo methodInfo,MethodWriter methodWriter){
  if (methodInfo.isParameterisedTypeOf(parameterType)) {
    directedRelationshipForType=new DirectedRelationshipForType(relationshipType,relationshipDirection,ClassUtils.getType(methodInfo.getTypeParameterDescriptor()));
  }
  iterableWriterCache.get(classInfo).put(directedRelationshipForType,methodWriter);
}

Fixed version (ground truth):
private static void cacheIterableMethodWriter(ClassInfo classInfo,Class<?> parameterType,String relationshipType,String relationshipDirection,DirectedRelationshipForType directedRelationshipForType,MethodInfo methodInfo,MethodWriter methodWriter){
  if (methodInfo.isParameterisedTypeOf(parameterType)) {
    directedRelationshipForType=new DirectedRelationshipForType(relationshipType,relationshipDirection,ClassUtils.getType(methodInfo.getTypeDescriptor()));
  }
  iterableWriterCache.get(classInfo).put(directedRelationshipForType,methodWriter);
}
Program: 31626
Project: 31626
Buggy source:
@Override public void write(Object instance,Object value){
  if (fieldInfo.hasPropertyConverter()) {
    value=fieldInfo.getPropertyConverter().toEntityAttribute(value);
    FieldWriter.write(field,instance,value);
  }
 else {
    if (fieldInfo.isScalar()) {
      String descriptor=fieldInfo.getTypeParameterDescriptor() == null ? fieldInfo.getDescriptor() : fieldInfo.getTypeParameterDescriptor();
      value=Utils.coerceTypes(ClassUtils.getType(descriptor),value);
    }
    FieldWriter.write(field,instance,value);
  }
}

Fixed version (ground truth):
@Override public void write(Object instance,Object value){
  if (fieldInfo.hasPropertyConverter()) {
    value=fieldInfo.getPropertyConverter().toEntityAttribute(value);
    FieldWriter.write(field,instance,value);
  }
 else {
    if (fieldInfo.isScalar()) {
      String descriptor=fieldInfo.getTypeDescriptor();
      value=Utils.coerceTypes(ClassUtils.getType(descriptor),value);
    }
    FieldWriter.write(field,instance,value);
  }
}
Program: 31627
Project: 31627
Buggy source:
MethodWriter(ClassInfo classInfo,MethodInfo methodInfo){
  this.setterMethodInfo=methodInfo;
  this.parameterType=ClassUtils.getType(setterMethodInfo.getDescriptor());
  this.method=classInfo.getMethod(setterMethodInfo,parameterType);
}

Fixed version (ground truth):
MethodWriter(ClassInfo classInfo,MethodInfo methodInfo){
  this.setterMethodInfo=methodInfo;
  this.method=classInfo.getMethod(setterMethodInfo);
  this.parameterType=method.getParameterTypes()[0];
}
Program: 31628
Project: 31628
Buggy source:
@Override public void write(Object instance,Object value){
  if (setterMethodInfo.hasPropertyConverter()) {
    value=setterMethodInfo.getPropertyConverter().toEntityAttribute(value);
    MethodWriter.write(method,instance,value);
  }
 else {
    if (setterMethodInfo.isScalar()) {
      String descriptor=setterMethodInfo.getTypeParameterDescriptor() == null ? setterMethodInfo.getDescriptor() : setterMethodInfo.getTypeParameterDescriptor();
      value=Utils.coerceTypes(ClassUtils.getType(descriptor),value);
    }
    MethodWriter.write(method,instance,value);
  }
}

Fixed version (ground truth):
@Override public void write(Object instance,Object value){
  if (setterMethodInfo.hasPropertyConverter()) {
    value=setterMethodInfo.getPropertyConverter().toEntityAttribute(value);
    MethodWriter.write(method,instance,value);
  }
 else {
    if (setterMethodInfo.isScalar()) {
      if (value.getClass() != parameterType) {
        value=Utils.coerceTypes(parameterType,value);
      }
    }
    MethodWriter.write(method,instance,value);
  }
}
Program: 31629
Project: 31629
Buggy source:
@SuppressWarnings("String_Node_Str") public Method getMethod(MethodInfo methodInfo,Class... parameterTypes){
  try {
    return MetaDataClassLoader.loadClass(name()).getMethod(methodInfo.getName(),parameterTypes);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the Method corresponding to the supplied MethodInfo as declared by the class represented by this ClassInfo
 * @param methodInfo the MethodInfo used to obtain the Method
 * @return a Method
 */
public Method getMethod(MethodInfo methodInfo){
  return methodInfo.getMethod(name());
}
Program: 31630
Project: 31630
Buggy source:
/** 
 * Find all getter MethodInfos for the specified ClassInfo whose return type matches the supplied class
 * @param returnType The getter return type to look for.
 * @return A {@link List} of {@link MethodInfo} objects that return the given type, never <code>null</code>
 */
public List<MethodInfo> findGetters(Class<?> returnType){
  String setterSignature="String_Node_Str" + returnType.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
  List<MethodInfo> methodInfos=new ArrayList<>();
  for (  MethodInfo methodInfo : methodsInfo().methods()) {
    if (methodInfo.getDescriptor().equals(setterSignature)) {
      methodInfos.add(methodInfo);
    }
  }
  return methodInfos;
}

Fixed version (ground truth):
/** 
 * Find all getter MethodInfos for the specified ClassInfo whose return type matches the supplied class
 * @param returnType The getter return type to look for.
 * @return A {@link List} of {@link MethodInfo} objects that return the given type, never <code>null</code>
 */
public List<MethodInfo> findGetters(Class<?> returnType){
  String setterSignature="String_Node_Str" + returnType.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
  List<MethodInfo> methodInfos=new ArrayList<>();
  for (  MethodInfo methodInfo : methodsInfo().methods()) {
    if (methodInfo.getTypeDescriptor().equals(setterSignature)) {
      methodInfos.add(methodInfo);
    }
  }
  return methodInfos;
}
Program: 31631
Project: 31631
Buggy source:
/** 
 * The identity setter is any setter annotated with @NodeId taking a Long parameter, or if none exists, a setter called 'setId' taking a Long parameter
 * @return A FieldInfo object representing the identity field or null if it doesn't exist
 */
public MethodInfo identitySetter(){
  for (  MethodInfo methodInfo : methodsInfo().setters()) {
    AnnotationInfo annotationInfo=methodInfo.getAnnotations().get(GraphId.CLASS);
    if (annotationInfo != null) {
      if (methodInfo.getDescriptor().equals("String_Node_Str")) {
        return methodInfo;
      }
    }
  }
  MethodInfo methodInfo=methodsInfo().get("String_Node_Str");
  if (methodInfo != null) {
    if (methodInfo.getDescriptor().equals("String_Node_Str")) {
      return methodInfo;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The identity setter is any setter annotated with @NodeId taking a Long parameter, or if none exists, a setter called 'setId' taking a Long parameter
 * @return A FieldInfo object representing the identity field or null if it doesn't exist
 */
public MethodInfo identitySetter(){
  for (  MethodInfo methodInfo : methodsInfo().setters()) {
    AnnotationInfo annotationInfo=methodInfo.getAnnotations().get(GraphId.CLASS);
    if (annotationInfo != null) {
      if (methodInfo.getTypeDescriptor().equals("String_Node_Str")) {
        return methodInfo;
      }
    }
  }
  MethodInfo methodInfo=methodsInfo().get("String_Node_Str");
  if (methodInfo != null) {
    if (methodInfo.getTypeDescriptor().equals("String_Node_Str")) {
      return methodInfo;
    }
  }
  return null;
}
Program: 31632
Project: 31632
Buggy source:
/** 
 * The identity getter is any getter annotated with @NodeId returning a Long, or if none exists, a getter returning Long called 'getId'
 * @return A FieldInfo object representing the identity field or null if it doesn't exist
 */
public MethodInfo identityGetter(){
  for (  MethodInfo methodInfo : methodsInfo().getters()) {
    AnnotationInfo annotationInfo=methodInfo.getAnnotations().get(GraphId.CLASS);
    if (annotationInfo != null) {
      if (methodInfo.getDescriptor().equals("String_Node_Str")) {
        return methodInfo;
      }
    }
  }
  MethodInfo methodInfo=methodsInfo().get("String_Node_Str");
  if (methodInfo != null) {
    if (methodInfo.getDescriptor().equals("String_Node_Str")) {
      return methodInfo;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The identity getter is any getter annotated with @NodeId returning a Long, or if none exists, a getter returning Long called 'getId'
 * @return A FieldInfo object representing the identity field or null if it doesn't exist
 */
public MethodInfo identityGetter(){
  for (  MethodInfo methodInfo : methodsInfo().getters()) {
    AnnotationInfo annotationInfo=methodInfo.getAnnotations().get(GraphId.CLASS);
    if (annotationInfo != null) {
      if (methodInfo.getTypeDescriptor().equals("String_Node_Str")) {
        return methodInfo;
      }
    }
  }
  MethodInfo methodInfo=methodsInfo().get("String_Node_Str");
  if (methodInfo != null) {
    if (methodInfo.getTypeDescriptor().equals("String_Node_Str")) {
      return methodInfo;
    }
  }
  return null;
}
Program: 31633
Project: 31633
Buggy source:
/** 
 * Find all setter MethodInfos for the specified ClassInfo whose parameter type matches the supplied class
 * @param parameterType The setter parameter type to look for.
 * @return A {@link List} of {@link MethodInfo} objects that accept the given parameter type, never <code>null</code>
 */
public List<MethodInfo> findSetters(Class<?> parameterType){
  String setterSignature="String_Node_Str" + parameterType.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
  List<MethodInfo> methodInfos=new ArrayList<>();
  for (  MethodInfo methodInfo : methodsInfo().methods()) {
    if (methodInfo.getDescriptor().equals(setterSignature)) {
      methodInfos.add(methodInfo);
    }
  }
  return methodInfos;
}

Fixed version (ground truth):
/** 
 * Find all setter MethodInfos for the specified ClassInfo whose parameter type matches the supplied class
 * @param parameterType The setter parameter type to look for.
 * @return A {@link List} of {@link MethodInfo} objects that accept the given parameter type, never <code>null</code>
 */
public List<MethodInfo> findSetters(Class<?> parameterType){
  String setterSignature="String_Node_Str" + parameterType.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
  List<MethodInfo> methodInfos=new ArrayList<>();
  for (  MethodInfo methodInfo : methodsInfo().methods()) {
    if (methodInfo.getTypeDescriptor().equals(setterSignature)) {
      methodInfos.add(methodInfo);
    }
  }
  return methodInfos;
}
Program: 31634
Project: 31634
Buggy source:
/** 
 * The identity field is a field annotated with @NodeId, or if none exists, a field of type Long called 'id'
 * @return A {@link FieldInfo} object representing the identity field never <code>null</code>
 * @throws MappingException if no identity field can be found
 */
public FieldInfo identityField(){
  if (identityField != null) {
    return identityField;
  }
  try {
    lock.lock();
    if (identityField == null) {
      for (      FieldInfo fieldInfo : fieldsInfo().fields()) {
        AnnotationInfo annotationInfo=fieldInfo.getAnnotations().get(GraphId.CLASS);
        if (annotationInfo != null) {
          if (fieldInfo.getDescriptor().equals("String_Node_Str")) {
            identityField=fieldInfo;
            return fieldInfo;
          }
        }
      }
      FieldInfo fieldInfo=fieldsInfo().get("String_Node_Str");
      if (fieldInfo != null) {
        if (fieldInfo.getDescriptor().equals("String_Node_Str")) {
          identityField=fieldInfo;
          return fieldInfo;
        }
      }
      throw new MappingException("String_Node_Str" + this.className);
    }
 else {
      return identityField;
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * The identity field is a field annotated with @NodeId, or if none exists, a field of type Long called 'id'
 * @return A {@link FieldInfo} object representing the identity field never <code>null</code>
 * @throws MappingException if no identity field can be found
 */
public FieldInfo identityField(){
  if (identityField != null) {
    return identityField;
  }
  try {
    lock.lock();
    if (identityField == null) {
      for (      FieldInfo fieldInfo : fieldsInfo().fields()) {
        AnnotationInfo annotationInfo=fieldInfo.getAnnotations().get(GraphId.CLASS);
        if (annotationInfo != null) {
          if (fieldInfo.getTypeDescriptor().equals("String_Node_Str")) {
            identityField=fieldInfo;
            return fieldInfo;
          }
        }
      }
      FieldInfo fieldInfo=fieldsInfo().get("String_Node_Str");
      if (fieldInfo != null) {
        if (fieldInfo.getTypeDescriptor().equals("String_Node_Str")) {
          identityField=fieldInfo;
          return fieldInfo;
        }
      }
      throw new MappingException("String_Node_Str" + this.className);
    }
 else {
      return identityField;
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 31635
Project: 31635
Buggy source:
public static void setDriver(Driver driver){
  logger.debug("String_Node_Str",driver.getClass().getName());
  Components.driver=driver;
}

Fixed version (ground truth):
/** 
 * Sets a new   {@link Driver} to be used by the OGM.If a different driver is in use, it will be closed first. In addition, the  {@link Configuration} is updatedto reflect the correct classname for the new driver.
 * @param driver an instance of {@link Driver} to be used by the OGM.
 */
public static void setDriver(Driver driver){
  logger.debug("String_Node_Str",driver.getClass().getName());
  if (Components.driver != null && Components.driver != driver) {
    Components.driver.close();
    Components.getConfiguration().driverConfiguration().setDriverClassName(driver.getClass().getCanonicalName());
  }
  Components.driver=driver;
}
Program: 31636
Project: 31636
Buggy source:
public static double neo4jVersion(){
  String neo4jVersion=(String)configuration.get("String_Node_Str");
  if (neo4jVersion != null) {
    try {
      return new Double(neo4jVersion);
    }
 catch (    NumberFormatException nfe) {
      logger.warn("String_Node_Str");
    }
  }
  return 9.9;
}

Fixed version (ground truth):
/** 
 * Gets the neo4j.version from the current configuration
 * @return the major.minor part of the neo4.version property string, as a double, or 9.9 if not configured
 */
public static double neo4jVersion(){
  String neo4jVersion=(String)configuration.get("String_Node_Str");
  if (neo4jVersion != null) {
    try {
      String[] versionElements=neo4jVersion.split("String_Node_Str");
      if (versionElements.length < 2) {
        throw new NumberFormatException();
      }
      return new Double(versionElements[0] + "String_Node_Str" + versionElements[1]);
    }
 catch (    NumberFormatException nfe) {
      logger.warn("String_Node_Str",neo4jVersion);
    }
  }
  return 9.9;
}