nus-yam/ex-repair huggingface dataset:
Program: 13474
Project: 13474
Buggy source:
/** 
 * @param dataSource
 * @throws Exception 
 */
public InDesignObject newFrame(Element dataSource) throws Exception {
  TextFrame frame=this.getDocument().newFrame(dataSource);
  this.frames.put(frame.getId(),frame);
  this.rectangles.put(frame.getId(),frame);
  this.addChild(frame);
  return frame;
}

Fixed version (ground truth):
/** 
 * @param dataSource
 * @throws Exception 
 */
public InDesignComponent newFrame(Element dataSource) throws Exception {
  TextFrame frame=this.getDocument().newFrame(dataSource);
  this.frames.put(frame.getId(),frame);
  this.rectangles.put(frame.getId(),frame);
  this.addChild(frame);
  return frame;
}
Program: 13476
Project: 13476
Buggy source:
/** 
 * @param pageNumber
 * @return
 * @throws Exception 
 */
public Page addPage(int pageNumber) throws Exception {
  String pageNumberStr=String.valueOf(pageNumber);
  if (this.pagesByName.containsKey(pageNumberStr))   throw new RuntimeException("String_Node_Str" + pageNumber + "String_Node_Str");
  InDesignDocument doc=(InDesignDocument)this.getParent();
  Page page=this.getDocument().newPage();
  page.setPName(pageNumberStr);
  Page masterPage;
  if (doc.isFacingPages()) {
    if (pageNumber % 2 == 0) {
      masterPage=getMasterSpread().getEvenPage();
      page.setPageSide(PageSideOption.LEFT_HAND);
    }
 else {
      masterPage=getMasterSpread().getOddPage();
      page.setPageSide(PageSideOption.RIGHT_HAND);
    }
  }
 else {
    masterPage=getMasterSpread().getFirstPage();
    page.setPageSide(PageSideOption.SINGLE_SIDED);
  }
  this.pagesById.put(page.getId(),page);
  this.pagesByName.put(page.getPName(),page);
  this.pages.add(page);
  this.pageCount=this.pages.size();
  return page;
}

Fixed version (ground truth):
/** 
 * @param pageNumber
 * @return
 * @throws Exception 
 */
public Page addPage(int pageNumber) throws Exception {
  String pageNumberStr=String.valueOf(pageNumber);
  if (this.pagesByName.containsKey(pageNumberStr))   throw new RuntimeException("String_Node_Str" + pageNumber + "String_Node_Str");
  InDesignDocument doc=(InDesignDocument)this.getParent();
  Page page=this.getDocument().newPage();
  page.setParent(this);
  page.setPName(pageNumberStr);
  if (doc.isFacingPages()) {
    if (pageNumber % 2 == 0) {
      page.setPageSide(PageSideOption.LEFT_HAND);
    }
 else {
      page.setPageSide(PageSideOption.RIGHT_HAND);
    }
  }
 else {
    page.setPageSide(PageSideOption.SINGLE_SIDED);
  }
  this.pagesById.put(page.getId(),page);
  this.pagesByName.put(page.getPName(),page);
  this.pages.add(page);
  this.pageCount=this.pages.size();
  return page;
}
Program: 13477
Project: 13477
Buggy source:
public Story setParentStory(Story parentStory){
  this.parentStory=parentStory;
  this.parentStoryId=parentStory.getId();
  return parentStory;
}

Fixed version (ground truth):
public Story setParentStory(Story parentStory) throws Exception {
  this.parentStory=parentStory;
  this.parentStoryId=parentStory.getId();
  TextFrame nextInThread=this.getNextInThread();
  if (nextInThread != null) {
    nextInThread.setParentStory(parentStory);
  }
  return parentStory;
}
Program: 13478
Project: 13478
Buggy source:
public void testWriteInxFile() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  Page newPage=newSpread.addPage(10);
  Rectangle rect;
  rect=(Rectangle)doc.getObject("String_Node_Str");
  assertNotNull("String_Node_Str",rect);
  InDesignObject clonedObj=cloned.clone(rect);
  Rectangle clonedRect=(Rectangle)clonedObj;
  newSpread.addRectangle(clonedRect);
  File inxFile=File.createTempFile("String_Node_Str","String_Node_Str");
  InxWriter writer=new InxWriter(inxFile);
  writer.write(cloned);
  assertTrue("String_Node_Str",inxFile.exists());
  assertTrue("String_Node_Str",inxFile.length() > 0);
  String inxXml=readFileToString(inxFile);
  logger.info("String_Node_Str" + inxXml);
  assertTrue("String_Node_Str",inxFile.length() > 1000);
  Document inxDom=DataUtil.constructNonValidatingDocumentBuilder().parse(inxFile);
  assertNotNull("String_Node_Str",inxDom);
  Element docElem=inxDom.getDocumentElement();
  assertNotNull("String_Node_Str",docElem);
  assertEquals("String_Node_Str","String_Node_Str",docElem.getNodeName());
  InDesignDocument newDoc=new InDesignDocument();
  newDoc.load(docElem);
  Spread spread=newDoc.getSpread(1);
  assertNotNull("String_Node_Str",spread);
  Page page=spread.getPages().get(0);
  assertNotNull("String_Node_Str",page);
}

Fixed version (ground truth):
public void testWriteInxFile() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  Page newPage=newSpread.addPage(10);
  Rectangle rect;
  rect=(Rectangle)doc.getObject("String_Node_Str");
  assertNotNull("String_Node_Str",rect);
  InDesignComponent clonedObj=cloned.clone(rect);
  Rectangle clonedRect=(Rectangle)clonedObj;
  newSpread.addRectangle(clonedRect);
  File inxFile=File.createTempFile("String_Node_Str","String_Node_Str");
  InxWriter writer=new InxWriter(inxFile);
  writer.write(cloned);
  assertTrue("String_Node_Str",inxFile.exists());
  assertTrue("String_Node_Str",inxFile.length() > 0);
  String inxXml=readFileToString(inxFile);
  logger.info("String_Node_Str" + inxXml);
  assertTrue("String_Node_Str",inxFile.length() > 1000);
  Document inxDom=DataUtil.constructNonValidatingDocumentBuilder().parse(inxFile);
  assertNotNull("String_Node_Str",inxDom);
  Element docElem=inxDom.getDocumentElement();
  assertNotNull("String_Node_Str",docElem);
  assertEquals("String_Node_Str","String_Node_Str",docElem.getNodeName());
  InDesignDocument newDoc=new InDesignDocument();
  newDoc.load(docElem);
  Spread spread=newDoc.getSpread(1);
  assertNotNull("String_Node_Str",spread);
  Page page=spread.getPages().get(0);
  assertNotNull("String_Node_Str",page);
}
Program: 13479
Project: 13479
Buggy source:
public void testOverrideMasterSpreadObjects() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  newSpread.setTransformationMatrix(0);
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  assertNotNull("String_Node_Str",master);
  Page newPage=newSpread.addPage(10);
  assertNotNull("String_Node_Str",newPage);
  assertEquals("String_Node_Str",0,newSpread.getAllFrames().size());
  newSpread.overrideMasterSpreadObjects();
  assertTrue("String_Node_Str",newSpread.getAllFrames().size() > 0);
  boolean foundThread=false;
  for (  TextFrame frame : newSpread.getAllFrames()) {
    if ("String_Node_Str".equals(frame.getLabel().trim())) {
      foundThread=true;
      TextFrame nextInThread=frame.getNextInThread();
      assertNotNull(nextInThread);
      TextFrame nextInThreadMaster=nextInThread.getMasterFrame();
      assertNotNull(nextInThreadMaster);
      assertNotSame(nextInThreadMaster,frame.getNextInThread());
      assertNotSame(nextInThread.getPreviousInThread(),frame.getMasterFrame());
      assertEquals("String_Node_Str",frame,nextInThread.getPreviousInThread());
    }
  }
  assertTrue("String_Node_Str",foundThread);
  assertTrue("String_Node_Str",newPage.getAllFrames().size() > 0);
}

Fixed version (ground truth):
public void testOverrideMasterSpreadObjects() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  newSpread.setTransformationMatrix(0);
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  assertNotNull("String_Node_Str",master);
  Page newPage=newSpread.addPage(10);
  assertNotNull("String_Node_Str",newPage);
  assertEquals("String_Node_Str",0,newSpread.getAllFrames().size());
  newSpread.overrideMasterSpreadObjects();
  assertTrue("String_Node_Str",newSpread.getAllFrames().size() > 0);
  boolean foundThread=false;
  for (  TextFrame frame : newSpread.getAllFrames()) {
    if ("String_Node_Str".equals(frame.getLabel().trim())) {
      foundThread=true;
      TextFrame nextInThread=frame.getNextInThread();
      assertNotNull(nextInThread);
      InDesignComponent nextInThreadMaster=nextInThread.getMasterFrame();
      assertNotNull(nextInThreadMaster);
      assertNotSame(nextInThreadMaster,frame.getNextInThread());
      assertNotSame(nextInThread.getPreviousInThread(),frame.getMasterFrame());
      assertEquals("String_Node_Str",frame,nextInThread.getPreviousInThread());
    }
  }
  assertTrue("String_Node_Str",foundThread);
  assertTrue("String_Node_Str",newPage.getAllFrames().size() > 0);
}
Program: 13480
Project: 13480
Buggy source:
public void testCreateSpreads() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  assertEquals("String_Node_Str",cloned,newSpread.getParent());
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  assertNotNull("String_Node_Str",master);
  assertEquals("String_Node_Str",master,newSpread.getMasterSpread());
  assertEquals("String_Node_Str",1,master.getPages().size());
  assertEquals("String_Node_Str",0,newSpread.getPages().size());
  Page newPage=newSpread.addPage(10);
  assertNotNull("String_Node_Str",newPage);
  Rectangle rect;
  System.err.println("String_Node_Str" + doc.reportObjectsById());
  rect=(Rectangle)doc.getObject("String_Node_Str");
  assertNotNull("String_Node_Str",rect);
  InDesignObject clonedObj=cloned.clone(rect);
  assertNotNull("String_Node_Str",clonedObj);
  Rectangle clonedRect=(Rectangle)clonedObj;
  assertTrue("String_Node_Str",!rect.getId().equals(clonedRect.getId()));
  newSpread.addRectangle(clonedRect);
  assertTrue("String_Node_Str",newPage.contains(clonedRect));
}

Fixed version (ground truth):
public void testCreateSpreads() throws Exception {
  Spread newSpread;
  String masterSpreadName="String_Node_Str";
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  assertEquals("String_Node_Str",cloned,newSpread.getParent());
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  newSpread=cloned.newSpread(masterSpreadName);
  assertNotNull("String_Node_Str",newSpread);
  assertNotNull("String_Node_Str",newSpread.getTransformationMatrix());
  MasterSpread master=cloned.getMasterSpread(masterSpreadName);
  assertNotNull("String_Node_Str",master);
  assertEquals("String_Node_Str",master,newSpread.getMasterSpread());
  assertEquals("String_Node_Str",1,master.getPages().size());
  assertEquals("String_Node_Str",0,newSpread.getPages().size());
  Page newPage=newSpread.addPage(10);
  assertNotNull("String_Node_Str",newPage);
  Rectangle rect;
  System.err.println("String_Node_Str" + doc.reportObjectsById());
  rect=(Rectangle)doc.getObject("String_Node_Str");
  assertNotNull("String_Node_Str",rect);
  InDesignComponent clonedObj=cloned.clone(rect);
  assertNotNull("String_Node_Str",clonedObj);
  Rectangle clonedRect=(Rectangle)clonedObj;
  assertTrue("String_Node_Str",!rect.getId().equals(clonedRect.getId()));
  newSpread.addRectangle(clonedRect);
  assertTrue("String_Node_Str",newPage.contains(clonedRect));
}
Program: 13481
Project: 13481
Buggy source:
/** 
 * @return
 */
public String reportChildObjects(){
  StringBuilder report=new StringBuilder("String_Node_Str");
  for (  InDesignComponent comp : this.getChildren()) {
    InDesignObject obj=(InDesignObject)comp;
    Element dataSource=obj.getDataSourceElement();
    String dsName="String_Node_Str";
    if (dataSource != null)     dsName=dataSource.getNodeName();
    report.append("String_Node_Str").append(obj.getId()).append("String_Node_Str").append(obj.getClass().getSimpleName()).append("String_Node_Str").append(dsName).append("String_Node_Str").append("String_Node_Str");
  }
  return report.toString();
}

Fixed version (ground truth):
/** 
 * @return
 */
public String reportChildObjects(){
  StringBuilder report=new StringBuilder("String_Node_Str");
  for (  InDesignComponent comp : this.getChildren()) {
    Element dataSource=comp.getDataSourceElement();
    String dsName="String_Node_Str";
    if (dataSource != null)     dsName=dataSource.getNodeName();
    if (comp instanceof InDesignObject) {
      InDesignObject obj=(InDesignObject)comp;
      report.append("String_Node_Str").append(obj.getId()).append("String_Node_Str");
    }
    report.append(comp.getClass().getSimpleName()).append("String_Node_Str").append(dsName).append("String_Node_Str").append("String_Node_Str");
  }
  return report.toString();
}
Program: 13482
Project: 13482
Buggy source:
/** 
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static String decodeRawValueToSingleObjectId(String rawValue) throws Exception {
  String[] values=getSingleValue(rawValue);
  if (values[0].equals("String_Node_Str") && values[1].equals("String_Node_Str"))   return null;
  String typeCode="String_Node_Str";
  if (values[0].startsWith("String_Node_Str"))   typeCode=values[0].substring(1);
  if ("String_Node_Str".equals(typeCode) | "String_Node_Str".equals(typeCode))   return values[1];
  throw new Exception("String_Node_Str" + values[0] + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static String decodeRawValueToSingleObjectId(String rawValue) throws Exception {
  String[] values=getSingleValue(rawValue);
  if (values[0].equals("String_Node_Str") && values[1].equals("String_Node_Str"))   return null;
  String typeCode=values[0].substring(0);
  if (values[0].startsWith("String_Node_Str"))   typeCode=values[0].substring(1);
  if ("String_Node_Str".equals(typeCode) | "String_Node_Str".equals(typeCode))   return values[1];
  throw new Exception("String_Node_Str" + values[0] + "String_Node_Str");
}
Program: 13483
Project: 13483
Buggy source:
/** 
 * Decodes a value that is a list of lists of string pairs representing a map of name/value pairs.
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static Map<String,String> decodeRawValueToStringMap(String rawValue) throws Exception {
  String[] parts=rawValue.split("String_Node_Str");
  String typeCode=parts[0];
  if (typeCode.startsWith("String_Node_Str"))   typeCode=typeCode.substring(1);
  if (!"String_Node_Str".equals(typeCode))   throw new InDesignDocumentException("String_Node_Str" + typeCode + "String_Node_Str");
  Map<String,String> resultMap=new HashMap<String,String>();
  int i=5;
  while (i < (parts.length - 2)) {
    String key=parts[i++];
    String value=parts[i++];
    resultMap.put(key,value);
    i+=2;
  }
  return resultMap;
}

Fixed version (ground truth):
/** 
 * Decodes a value that is a list of lists of string pairs representing a map of name/value pairs.
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static Map<String,String> decodeRawValueToStringMap(String rawValue) throws Exception {
  String[] parts=rawValue.split("String_Node_Str");
  String typeCode=parts[0];
  if (typeCode.startsWith("String_Node_Str"))   typeCode=typeCode.substring(1);
  if (!"String_Node_Str".equals(typeCode))   throw new InDesignDocumentException("String_Node_Str" + typeCode + "String_Node_Str");
  Map<String,String> resultMap=new HashMap<String,String>();
  int i=4;
  while (i < (parts.length - 3)) {
    String tcKey=parts[i++];
    String key=parts[i++];
    String tcValue=parts[i++];
    String value=parts[i++];
    resultMap.put(key,value);
    i+=2;
  }
  return resultMap;
}
Program: 13485
Project: 13485
Buggy source:
/** 
 * Get the frame to which this frame threads, if any.
 * @return Frame or null if there is no next thread.
 * @throws Exception 
 */
public TextFrame getNextInThread() throws Exception {
  if (nextFrameInThread == null && hasProperty(InDesignDocument.PROP_NTXF)) {
    String objectId=getObjectReferenceProperty(InDesignDocument.PROP_NTXF);
    if (objectId != null) {
      this.nextFrameInThread=(TextFrame)this.getDocument().getObject(objectId);
    }
  }
  return this.nextFrameInThread;
}

Fixed version (ground truth):
/** 
 * Get the frame to which this frame threads, if any.
 * @return Frame or null if there is no next thread.
 * @throws Exception 
 */
public TextFrame getNextInThread() throws Exception {
  if (nextInThread == null && hasProperty(InDesignDocument.PROP_NTXF)) {
    String objectId=getObjectReferenceProperty(InDesignDocument.PROP_NTXF);
    if (objectId != null) {
      this.nextInThread=(TextFrame)this.getDocument().getObject(objectId);
    }
  }
  return this.nextInThread;
}
Program: 13486
Project: 13486
Buggy source:
/** 
 * @param nextTextFrame
 */
public void setNextInThread(TextFrame nextTextFrame){
  this.nextFrameInThread=nextTextFrame;
}

Fixed version (ground truth):
/** 
 * Set the next frame in the thread. Automatically sets this frame as the previous frame on  the specified text frame.
 * @param nextTextFrame The frame to which this frameis to be threaded.
 */
public void setNextInThread(TextFrame nextTextFrame){
  this.nextInThread=nextTextFrame;
  if (nextTextFrame != null) {
    nextTextFrame.setPreviousInThread(this);
  }
}
Program: 13487
Project: 13487
Buggy source:
/** 
 * @param propSelf
 * @return
 * @throws Exception 
 */
protected String getStringProperty(String attName) throws Exception {
  if (this.getDataSourceElement().hasAttribute(attName)) {
    return InxHelper.decodeRawValueToSingleString(this.getDataSourceElement().getAttribute(attName));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param attName
 * @return
 * @throws Exception 
 */
protected String getStringProperty(String attName) throws Exception {
  if (this.getDataSourceElement().hasAttribute(attName)) {
    return InxHelper.decodeRawValueToSingleString(this.getDataSourceElement().getAttribute(attName));
  }
  return null;
}
Program: 13488
Project: 13488
Buggy source:
/** 
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static String decodeRawValueToSingleObjectId(String rawValue) throws Exception {
  String[] values=getSingleValue(rawValue);
  String typeCode="String_Node_Str";
  if (values[0].startsWith("String_Node_Str"))   typeCode=values[0].substring(1);
  if ("String_Node_Str".equals(typeCode) | "String_Node_Str".equals(typeCode))   return values[1];
  throw new Exception("String_Node_Str" + values[0] + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static String decodeRawValueToSingleObjectId(String rawValue) throws Exception {
  String[] values=getSingleValue(rawValue);
  if (values[0].equals("String_Node_Str") && values[1].equals("String_Node_Str"))   return null;
  String typeCode="String_Node_Str";
  if (values[0].startsWith("String_Node_Str"))   typeCode=values[0].substring(1);
  if ("String_Node_Str".equals(typeCode) | "String_Node_Str".equals(typeCode))   return values[1];
  throw new Exception("String_Node_Str" + values[0] + "String_Node_Str");
}
Program: 13489
Project: 13489
Buggy source:
/** 
 * Override any overrideable objects in the spread's master spread.
 * @throws Exception 
 */
public void overrideMasterSpreadObjects() throws Exception {
  for (  InDesignComponent comp : this.masterSpread.getChildren()) {
    if (comp.getBooleanProperty("String_Node_Str")) {
      if (comp instanceof Rectangle) {
        this.addRectangle((Rectangle)comp);
      }
 else {
        this.addChild(comp);
      }
    }
  }
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}

Fixed version (ground truth):
/** 
 * Override any overrideable objects in the spread's master spread.
 * @throws Exception 
 */
public void overrideMasterSpreadObjects() throws Exception {
  InDesignDocument doc=(InDesignDocument)getParent();
  Map<TextFrame,TextFrame> masterToOverride=new HashMap<TextFrame,TextFrame>();
  for (  InDesignComponent comp : this.masterSpread.getChildren()) {
    if (comp.getBooleanProperty("String_Node_Str")) {
      if (comp instanceof InDesignObject) {
        InDesignObject idObj=(InDesignObject)comp;
        if (idObj instanceof TextFrame) {
          TextFrame masterFrame=(TextFrame)idObj;
          TextFrame overrideFrame=(TextFrame)doc.clone(masterFrame);
          overrideFrame.setMasterFrame(masterFrame);
          masterToOverride.put(masterFrame,overrideFrame);
        }
 else         if (idObj instanceof Rectangle) {
          this.addRectangle((Rectangle)(doc.clone(idObj)));
        }
 else {
          this.addChild(idObj);
        }
      }
 else {
        this.addChild(comp);
      }
    }
  }
  for (  TextFrame masterFrame : masterToOverride.keySet()) {
    if (masterFrame.getNextInThread() == null)     continue;
    TextFrame override=masterToOverride.get(masterFrame);
    TextFrame nextMaster=masterFrame.getNextInThread();
    TextFrame nextOverride=masterToOverride.get(nextMaster);
    if (this.frames.containsKey(nextOverride)) {
      override.setNextInThread(nextOverride);
    }
 else {
      override.setNextInThread((TextFrame)null);
    }
  }
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}
Program: 13490
Project: 13490
Buggy source:
/** 
 * Decodes a value that is a list of lists of string pairs representing a map of name/value pairs.
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static Map<String,String> decodeRawValueToStringMap(String rawValue) throws Exception {
  String[] parts=rawValue.split("String_Node_Str");
  String typeCode=parts[0];
  if (typeCode.startsWith("String_Node_Str"))   typeCode=typeCode.substring(1);
  if (!"String_Node_Str".equals(typeCode))   throw new InDesignDocumentException("String_Node_Str" + typeCode + "String_Node_Str");
  int i=4;
  Map<String,String> resultMap=new HashMap<String,String>();
  while (i < (parts.length - 3)) {
    String key=parts[i++];
    String value=parts[i++];
    resultMap.put(key,value);
    i+=2;
  }
  return resultMap;
}

Fixed version (ground truth):
/** 
 * Decodes a value that is a list of lists of string pairs representing a map of name/value pairs.
 * @param rawValue
 * @return
 * @throws Exception 
 */
public static Map<String,String> decodeRawValueToStringMap(String rawValue) throws Exception {
  String[] parts=rawValue.split("String_Node_Str");
  String typeCode=parts[0];
  if (typeCode.startsWith("String_Node_Str"))   typeCode=typeCode.substring(1);
  if (!"String_Node_Str".equals(typeCode))   throw new InDesignDocumentException("String_Node_Str" + typeCode + "String_Node_Str");
  Map<String,String> resultMap=new HashMap<String,String>();
  int i=5;
  while (i < (parts.length - 2)) {
    String key=parts[i++];
    String value=parts[i++];
    resultMap.put(key,value);
    i+=2;
  }
  return resultMap;
}
Program: 13491
Project: 13491
Buggy source:
/** 
 * Given a Geometry object, encodes it as an IGeo string value.
 * @param geometry
 * @return
 */
public static String encodeGeometry(Geometry geometry){
  List<InxValue> values=new ArrayList<InxValue>();
  values.add(new InxLong64(geometry.getPaths().size()));
  for (  Path path : geometry.getPaths()) {
    values.add(new InxLong64(path.getPoints().size()));
    for (    Point point : path.getPoints()) {
      values.add(new InxLong64(2));
      values.add(new InxDouble(point.getX()));
      values.add(new InxDouble(point.getY()));
    }
    values.add(new InxBoolean(false));
  }
  values.add(new InxDouble(geometry.getBoundingBox().getLeft()));
  values.add(new InxDouble(geometry.getBoundingBox().getTop()));
  values.add(new InxDouble(geometry.getBoundingBox().getRight()));
  values.add(new InxDouble(geometry.getBoundingBox().getBottom()));
  values.addAll(geometry.getTransformationMatrix().getMatrixValues());
  if (geometry.getGraphicBoundingBox() != null) {
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getLeft()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getTop()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getRight()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getBottom()));
  }
  return encodeValueList(values);
}

Fixed version (ground truth):
/** 
 * Given a Geometry object, encodes it as an IGeo string value.
 * @param geometry
 * @return
 */
public static String encodeGeometry(Geometry geometry){
  List<InxValue> values=new ArrayList<InxValue>();
  values.add(new InxLong64(geometry.getPaths().size()));
  for (  Path path : geometry.getPaths()) {
    values.add(new InxLong64(path.getPoints().size()));
    for (    PathPoint point : path.getPoints()) {
      values.add(new InxLong64(2));
      values.add(new InxDouble(point.getX()));
      values.add(new InxDouble(point.getY()));
    }
    values.add(new InxBoolean(false));
  }
  values.add(new InxDouble(geometry.getBoundingBox().getLeft()));
  values.add(new InxDouble(geometry.getBoundingBox().getTop()));
  values.add(new InxDouble(geometry.getBoundingBox().getRight()));
  values.add(new InxDouble(geometry.getBoundingBox().getBottom()));
  values.addAll(geometry.getTransformationMatrix().getMatrixValues());
  if (geometry.getGraphicBoundingBox() != null) {
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getLeft()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getTop()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getRight()));
    values.add(new InxDouble(geometry.getGraphicBoundingBox().getBottom()));
  }
  return encodeValueList(values);
}
Program: 13492
Project: 13492
Buggy source:
/** 
 * Registers a BOS member on which the member is dependent, specifing a key by  which the member can be later looked up, such as the original referencing element, the fully-qualified URI of the target, a database key, or whatever. Intended to enable mapping from original references in member data to the target managed object in order to rewrite pointers. <p>Note that while a given member is never added to dependencies multiple times, it be registered under any number of dependency types.
 * @param key
 * @param targetMember
 */
public void registerDependency(String key,BosMember targetMember,DependencyType type){
  dependencies.put(key,targetMember);
  if (!dependenciesByType.containsKey(type)) {
    this.dependenciesByType.put(type,new HashSet<BosMember>());
  }
  this.dependenciesByType.get(type).add(targetMember);
  if (!dependencyTypesByKey.containsKey(targetMember.getKey())) {
    this.dependencyTypesByKey.put(targetMember.getKey(),new HashSet<DependencyType>());
  }
  this.dependencyTypesByKey.get(targetMember.getKey()).add(type);
}

Fixed version (ground truth):
/** 
 * Registers a BOS member on which the member is dependent, specifing a key by  which the member can be later looked up, such as the original referencing element, the fully-qualified URI of the target, a database key, or whatever. Intended to enable mapping from original references in member data to the target managed object in order to rewrite pointers. <p>Note that while a given member is never added to dependencies multiple times, it may be registered under any number of dependency types.
 * @param key
 * @param targetMember
 */
public void registerDependency(String key,BosMember targetMember,DependencyType type){
  dependencies.put(key,targetMember);
  if (!dependenciesByType.containsKey(type)) {
    this.dependenciesByType.put(type,new HashSet<BosMember>());
  }
  this.dependenciesByType.get(type).add(targetMember);
  if (!dependencyTypesByKey.containsKey(targetMember.getKey())) {
    this.dependencyTypesByKey.put(targetMember.getKey(),new HashSet<DependencyType>());
  }
  this.dependencyTypesByKey.get(targetMember.getKey()).add(type);
}
Program: 13495
Project: 13495
Buggy source:
public void testDitaBosConstruction() throws Exception {
  DitaBoundedObjectSet mapBos=DitaBosHelper.calculateMapBos(bosOptions,log,rootMap);
  assertNotNull(mapBos);
  assertEquals(9,mapBos.size());
  BosMember member=null;
  for (  BosMember cand : mapBos.getMembers()) {
    if (cand.getFileName().equals("String_Node_Str")) {
      member=cand;
      break;
    }
  }
  assertNotNull(member);
  Set<BosMember> deps=member.getDependenciesOfType(Constants.IMAGE_DEPENDENCY);
  assertNotNull(deps);
  assertEquals(1,deps.size());
  BosMember dep=deps.iterator().next();
  assertEquals("String_Node_Str",dep.getKey());
  Set<DependencyType> depTypes=member.getDependencyTypes();
  assertNotNull(depTypes);
  assertEquals(1,depTypes.size());
  assertTrue(depTypes.contains(Constants.IMAGE_DEPENDENCY));
  depTypes=member.getDependencyTypes(dep.getKey());
  assertNotNull(depTypes);
  assertTrue(depTypes.contains(Constants.IMAGE_DEPENDENCY));
  DitaBosReporter reporter=new TextDitaBosReporter();
  reporter.setPrintStream(System.out);
  reporter.report(mapBos,new BosReportOptions());
}

Fixed version (ground truth):
public void testDitaBosConstruction() throws Exception {
  DitaBoundedObjectSet mapBos=DitaBosHelper.calculateMapBos(bosOptions,log,rootMap);
  assertNotNull(mapBos);
  assertEquals(9,mapBos.size());
  BosMember memberTopic03=null;
  BosMember memberTopic04=null;
  for (  BosMember cand : mapBos.getMembers()) {
    if (cand.getFileName().equals("String_Node_Str")) {
      memberTopic03=cand;
    }
    if (cand.getFileName().equals("String_Node_Str")) {
      memberTopic04=cand;
    }
  }
  assertNotNull(memberTopic03);
  assertNotNull(memberTopic04);
  Set<BosMember> deps=memberTopic03.getDependenciesOfType(Constants.IMAGE_DEPENDENCY);
  assertNotNull(deps);
  assertEquals(1,deps.size());
  BosMember dep=deps.iterator().next();
  assertEquals("String_Node_Str",dep.getKey());
  Set<DependencyType> depTypes=memberTopic03.getDependencyTypes();
  assertNotNull(depTypes);
  assertEquals(1,depTypes.size());
  assertTrue(depTypes.contains(Constants.IMAGE_DEPENDENCY));
  depTypes=memberTopic03.getDependencyTypes(dep.getKey());
  assertNotNull(depTypes);
  assertTrue(depTypes.contains(Constants.IMAGE_DEPENDENCY));
  Map<String,? extends BosMember> depMap=memberTopic04.getDependencies();
  assertEquals("String_Node_Str",2,depMap.size());
  depTypes=memberTopic04.getDependencyTypes();
  assertEquals("String_Node_Str",2,depTypes.size());
  assertTrue("String_Node_Str",depTypes.contains(Constants.XREF_DEPENDENCY));
  assertTrue("String_Node_Str",depTypes.contains(Constants.IMAGE_DEPENDENCY));
  DitaBosReporter reporter=new TextDitaBosReporter();
  reporter.setPrintStream(System.out);
  reporter.report(mapBos,new BosReportOptions());
}
Program: 13497
Project: 13497
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  Options cmdlineOptions=configureOptions();
  CommandLineParser parser=new PosixParser();
  CommandLine cmdline=null;
  try {
    cmdline=parser.parse(cmdlineOptions,args);
  }
 catch (  ParseException exp) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp(DitaDxpMapPackager.class.getSimpleName(),cmdlineOptions);
    System.exit(-1);
  }
  if (!cmdline.hasOption(INPUT_OPTION_ONE_CHAR) || !cmdline.hasOption(OUTPUT_OPTION_ONE_CHAR)) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp(DitaDxpMapPackager.class.getSimpleName(),cmdlineOptions);
    System.exit(-1);
  }
  DitaDxpMapPackager app=new DitaDxpMapPackager(cmdline);
  try {
    app.run();
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  Options cmdlineOptions=configureOptions();
  CommandLineParser parser=new PosixParser();
  CommandLine cmdline=null;
  try {
    cmdline=parser.parse(cmdlineOptions,args);
  }
 catch (  ParseException exp) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp(DitaDxpMapPackager.class.getSimpleName(),cmdlineOptions);
    System.exit(-1);
  }
  if (!cmdline.hasOption(INPUT_OPTION_ONE_CHAR)) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp(DitaDxpMapPackager.class.getSimpleName(),cmdlineOptions);
    System.exit(-1);
  }
  DitaDxpMapPackager app=new DitaDxpMapPackager(cmdline);
  try {
    app.run();
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.exit(1);
  }
}
Program: 13498
Project: 13498
Buggy source:
/** 
 * @throws Exception 
 */
private void run() throws Exception {
  String mapFilepath=commandLine.getOptionValue("String_Node_Str");
  File mapFile=new File(mapFilepath);
  checkExistsAndCanReadSystemExit(mapFile);
  System.err.println("String_Node_Str" + mapFile.getAbsolutePath() + "String_Node_Str");
  String outputFilepath=commandLine.getOptionValue("String_Node_Str");
  File outputZipFile=new File(outputFilepath);
  outputZipFile.getParentFile().mkdirs();
  if (!outputZipFile.getParentFile().canWrite()) {
    throw new RuntimeException("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
  }
  Document rootMap=null;
  BosConstructionOptions bosOptions=new BosConstructionOptions(log,new HashMap<URI,Document>());
  setupCatalogs(bosOptions);
  try {
    URL rootMapUrl=mapFile.toURL();
    rootMap=DomUtil.getDomForUri(new URI(rootMapUrl.toExternalForm()),bosOptions);
    Date startTime=TimingUtils.getNowTime();
    DitaBoundedObjectSet mapBos=DitaBosHelper.calculateMapBos(bosOptions,log,rootMap);
    System.err.println("String_Node_Str" + TimingUtils.reportElapsedTime(startTime));
    zipMapBos(mapBos,outputZipFile);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
  }
}

Fixed version (ground truth):
/** 
 * @throws Exception 
 */
private void run() throws Exception {
  String mapFilepath=commandLine.getOptionValue("String_Node_Str");
  File mapFile=new File(mapFilepath);
  checkExistsAndCanReadSystemExit(mapFile);
  System.err.println("String_Node_Str" + mapFile.getAbsolutePath() + "String_Node_Str");
  File outputZipFile=null;
  String outputFilepath=null;
  if (commandLine.hasOption(OUTPUT_OPTION_ONE_CHAR)) {
    outputFilepath=commandLine.getOptionValue(OUTPUT_OPTION_ONE_CHAR);
    outputZipFile=new File(outputFilepath);
  }
 else {
    File parentDir=mapFile.getParentFile();
    String nameBase=FilenameUtils.getBaseName(mapFile.getName());
    outputZipFile=new File(parentDir,nameBase + DXP_EXTENSION);
  }
  outputZipFile.getParentFile().mkdirs();
  if (!outputZipFile.getParentFile().canWrite()) {
    throw new RuntimeException("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
  }
  Document rootMap=null;
  BosConstructionOptions bosOptions=new BosConstructionOptions(log,new HashMap<URI,Document>());
  setupCatalogs(bosOptions);
  try {
    URL rootMapUrl=mapFile.toURL();
    rootMap=DomUtil.getDomForUri(new URI(rootMapUrl.toExternalForm()),bosOptions);
    Date startTime=TimingUtils.getNowTime();
    DitaBoundedObjectSet mapBos=DitaBosHelper.calculateMapBos(bosOptions,log,rootMap);
    System.err.println("String_Node_Str" + TimingUtils.reportElapsedTime(startTime));
    zipMapBos(mapBos,outputZipFile);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
  }
}
Program: 13500
Project: 13500
Buggy source:
public static void destroyAudio(AudioClip mAudio){
  try {
    if (mAudio != null) {
      mAudio.stop();
      mAudio.release();
    }
  }
 catch (  Exception e) {
    Logger.e(TAG,"String_Node_Str",e);
  }
 finally {
    mAudio=null;
  }
}

Fixed version (ground truth):
public static void destroyAudio(AudioClip mAudio){
  try {
    if (mAudio != null) {
      mAudio.stop();
      mAudio.release();
    }
  }
 catch (  Exception e) {
    Logger.e(TAG,"String_Node_Str",e);
  }
}
Program: 13501
Project: 13501
Buggy source:
public void onStart(Intent intent,int value){
  if (intent == null)   return;
  String filePath=intent.getStringExtra(EXTRA_FILEPATHS);
  playAsNotification=intent.getBooleanExtra(EXTRA_PLAY_AS_NOTIFICATION,true);
  deleteFile=intent.getBooleanExtra(EXTRA_DELETE_FILE,false);
  StringTokenizer token=new StringTokenizer(filePath,"String_Node_Str");
  filePaths=new ArrayList<String>();
  while (token.hasMoreTokens()) {
    String file=token.nextToken().trim();
    if (file.length() > 0 && (new File(file).exists()))     filePaths.add(file);
  }
  if (filePath == null || filePaths.size() == 0)   return;
  if (mediaPlayer == null && playAsNotification) {
    AudioManager am=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
    originalVolumeMedia=am.getStreamVolume(AudioManager.STREAM_MUSIC);
    am.setStreamVolume(AudioManager.STREAM_MUSIC,originalVolumeMedia / 4,AudioManager.FLAG_VIBRATE);
  }
  playNextMedia();
}

Fixed version (ground truth):
public void onStart(Intent intent,int value){
  if (intent == null)   return;
  String filePath=intent.getStringExtra(EXTRA_FILEPATHS);
  playAsNotification=intent.getBooleanExtra(EXTRA_PLAY_AS_NOTIFICATION,true);
  deleteFile=intent.getBooleanExtra(EXTRA_DELETE_FILE,false);
  StringTokenizer token=new StringTokenizer(filePath,"String_Node_Str");
  filePaths=new ArrayList<>();
  while (token.hasMoreTokens()) {
    String file=token.nextToken().trim();
    if (file.length() > 0 && (new File(file).exists()))     filePaths.add(file);
  }
  if (filePath == null || filePaths.size() == 0)   return;
  if (mediaPlayer == null && playAsNotification) {
    AudioManager am=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
    originalVolumeMedia=am.getStreamVolume(AudioManager.STREAM_MUSIC);
    am.setStreamVolume(AudioManager.STREAM_MUSIC,originalVolumeMedia / 4,AudioManager.FLAG_VIBRATE);
  }
  playNextMedia();
}
Program: 13502
Project: 13502
Buggy source:
public ManagerAudio(){
  soundPool=new SoundPool(10,AudioManager.STREAM_MUSIC,0);
  soundPoolMap=new Hashtable<Integer,Integer>();
  soundPoolMap.put(SOUND_POOL_BEEP,soundPool.load(A.getApp(),R.raw.sound_beep_01,1));
}

Fixed version (ground truth):
public ManagerAudio(){
  soundPool=new SoundPool(10,AudioManager.STREAM_MUSIC,0);
  soundPoolMap=new Hashtable<>();
  soundPoolMap.put(SOUND_POOL_BEEP,soundPool.load(A.getApp(),R.raw.sound_beep_01,1));
}
Program: 13504
Project: 13504
Buggy source:
protected static void onStatusChanged(String provider,int status,Bundle extras){
  Logger.w(TAG,"String_Node_Str" + provider + "String_Node_Str"+ status+ "String_Node_Str"+ extras+ "String_Node_Str");
  for (int i=0; i < mListeners.size(); i++) {
    mListeners.get(i).onStatusChanged(provider,status,extras);
  }
  if (provider.equals(LocationManager.GPS_PROVIDER) && status == 1) {
    if (LocationState.location != null) {
      LocationState.location.setProvider(LocationManager.NETWORK_PROVIDER);
      onLocationChanged(LocationState.location);
    }
  }
}

Fixed version (ground truth):
static void onStatusChanged(String provider,int status,Bundle extras){
  Logger.w(TAG,"String_Node_Str" + provider + "String_Node_Str"+ status+ "String_Node_Str"+ extras+ "String_Node_Str");
  for (int i=0; i < mListeners.size(); i++) {
    mListeners.get(i).onStatusChanged(provider,status,extras);
  }
  if (provider.equals(LocationManager.GPS_PROVIDER) && status == 1) {
    if (LocationState.location != null) {
      LocationState.location.setProvider(LocationManager.NETWORK_PROVIDER);
      onLocationChanged(LocationState.location);
    }
  }
}
Program: 13505
Project: 13505
Buggy source:
protected static void onProviderEnabled(String provider){
  Logger.w(TAG,"String_Node_Str" + provider + "String_Node_Str");
}

Fixed version (ground truth):
static void onProviderEnabled(String provider){
  Logger.w(TAG,"String_Node_Str" + provider + "String_Node_Str");
}
Program: 13506
Project: 13506
Buggy source:
public static void init(Context c){
  if (LocationState.location == null) {
    LocationState.location=PreferenceValues.getLastKnownLocation(c);
    mListeners=new ArrayList<ILocationEventListener>();
    lastSource=-1;
  }
}

Fixed version (ground truth):
public static void init(Context c){
  if (LocationState.location == null) {
    LocationState.location=PreferenceValues.getLastKnownLocation();
    mListeners=new ArrayList<>();
    lastSource=-1;
  }
}
Program: 13507
Project: 13507
Buggy source:
protected static void onLocationChanged(Location location){
  try {
    if (location == null)     return;
    if (LocationState.location != null) {
      if (LocationState.location.getProvider().equals(LocationManager.NETWORK_PROVIDER) && location.getProvider().equals(LocationManager.GPS_PROVIDER) && (LocationState.location.getAccuracy() * 3) < location.getAccuracy()) {
        return;
      }
      if (!speedCorrection && (location.getTime() - LocationState.location.getTime()) < 5000 && location.getSpeed() > 100.0f && location.getSpeed() / LocationState.location.getSpeed() > 2) {
        location.setSpeed(LocationState.location.getSpeed());
        speedCorrection=true;
      }
 else {
        speedCorrection=false;
      }
      if (LocationState.location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
        mLastGpsFixTime=System.currentTimeMillis();
      }
      if (location.getSpeed() < 0.5f) {
        if (Math.abs(location.getBearing() - LocationState.location.getBearing()) > 25.0) {
          location.setBearing(LocationState.location.getBearing());
        }
      }
    }
    if (location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
      location.setAltitude(location.getAltitude() + Preferences.GPS_ALTITUDE_CORRECTION);
    }
    LocationState.location=location;
    for (int i=0; i < mListeners.size(); i++) {
      ILocationEventListener list=mListeners.get(i);
      list.onLocationChanged(location);
    }
  }
 catch (  Exception e) {
    Logger.e(TAG,"String_Node_Str" + location + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
static void onLocationChanged(Location location){
  try {
    if (location == null)     return;
    if (LocationState.location != null) {
      if (LocationState.location.getProvider().equals(LocationManager.NETWORK_PROVIDER) && location.getProvider().equals(LocationManager.GPS_PROVIDER) && (LocationState.location.getAccuracy() * 3) < location.getAccuracy()) {
        return;
      }
      if (!speedCorrection && (location.getTime() - LocationState.location.getTime()) < 5000 && location.getSpeed() > 100.0f && location.getSpeed() / LocationState.location.getSpeed() > 2) {
        location.setSpeed(LocationState.location.getSpeed());
        speedCorrection=true;
      }
 else {
        speedCorrection=false;
      }
      if (LocationState.location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
        mLastGpsFixTime=System.currentTimeMillis();
      }
      if (location.getSpeed() < 0.5f) {
        if (Math.abs(location.getBearing() - LocationState.location.getBearing()) > 25.0) {
          location.setBearing(LocationState.location.getBearing());
        }
      }
    }
    if (location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
      location.setAltitude(location.getAltitude() + Preferences.GPS_ALTITUDE_CORRECTION);
    }
    LocationState.location=location;
    for (int i=0; i < mListeners.size(); i++) {
      ILocationEventListener list=mListeners.get(i);
      list.onLocationChanged(location);
    }
  }
 catch (  Exception e) {
    Logger.e(TAG,"String_Node_Str" + location + "String_Node_Str",e);
  }
}
Program: 13508
Project: 13508
Buggy source:
protected static void onProviderDisabled(String provider){
}

Fixed version (ground truth):
static void onProviderDisabled(String provider){
}
Program: 13509
Project: 13509
Buggy source:
protected static void onGpsStatusChanged(int event,GpsStatus gpsStatus){
  if (mListeners == null || mListeners.size() == 0)   return;
  if (event == GpsStatus.GPS_EVENT_STARTED || event == GpsStatus.GPS_EVENT_STOPPED) {
    for (int i=0; i < mListeners.size(); i++) {
      mListeners.get(i).onStatusChanged(LocationManager.GPS_PROVIDER,event == GpsStatus.GPS_EVENT_STARTED ? 2 : 1,null);
    }
  }
 else   if (event == GpsStatus.GPS_EVENT_SATELLITE_STATUS) {
    ArrayList<SatellitePosition> pos=null;
    if (gpsStatus != null) {
      pos=new ArrayList<SatellitePosition>();
      Iterator<GpsSatellite> enuSat=gpsStatus.getSatellites().iterator();
      mSatsCount.x=0;
      mSatsCount.y=0;
      while (enuSat.hasNext()) {
        GpsSatellite sat=enuSat.next();
        SatellitePosition satPos=new SatellitePosition();
        satPos.azimuth=sat.getAzimuth();
        satPos.elevation=sat.getElevation();
        satPos.prn=sat.getPrn();
        satPos.snr=(int)sat.getSnr();
        satPos.fixed=sat.usedInFix();
        if (satPos.fixed)         mSatsCount.x++;
        mSatsCount.y++;
        pos.add(satPos);
      }
    }
    postGpsSatelliteChange(pos);
  }
}

Fixed version (ground truth):
static void onGpsStatusChanged(int event,GpsStatus gpsStatus){
  if (mListeners == null || mListeners.size() == 0)   return;
  if (event == GpsStatus.GPS_EVENT_STARTED || event == GpsStatus.GPS_EVENT_STOPPED) {
    for (int i=0; i < mListeners.size(); i++) {
      mListeners.get(i).onStatusChanged(LocationManager.GPS_PROVIDER,event == GpsStatus.GPS_EVENT_STARTED ? 2 : 1,null);
    }
  }
 else   if (event == GpsStatus.GPS_EVENT_SATELLITE_STATUS) {
    ArrayList<SatellitePosition> pos=null;
    if (gpsStatus != null) {
      pos=new ArrayList<>();
      Iterator<GpsSatellite> enuSat=gpsStatus.getSatellites().iterator();
      mSatsCount.x=0;
      mSatsCount.y=0;
      while (enuSat.hasNext()) {
        GpsSatellite sat=enuSat.next();
        SatellitePosition satPos=new SatellitePosition();
        satPos.azimuth=sat.getAzimuth();
        satPos.elevation=sat.getElevation();
        satPos.prn=sat.getPrn();
        satPos.snr=(int)sat.getSnr();
        satPos.fixed=sat.usedInFix();
        if (satPos.fixed)         mSatsCount.x++;
        mSatsCount.y++;
        pos.add(satPos);
      }
    }
    postGpsSatelliteChange(pos);
  }
}
Program: 13510
Project: 13510
Buggy source:
/** 
 * The default constructor.
 * @see Point2D.Float
 * @see Point2D.Double
 */
protected Point2D(){
}

Fixed version (ground truth):
/** 
 * The default constructor.
 */
Point2D(){
}
Program: 13511
Project: 13511
Buggy source:
public Orientation(){
  this.listeners=new Vector<IOrientationEventListener>();
}

Fixed version (ground truth):
public Orientation(){
  this.listeners=new Vector<>();
}
Program: 13513
Project: 13513
Buggy source:
@Override public void onOrientationChanged(float azimuth,float pitch,float roll){
  Location loc=LocationState.getLocation();
  mAzimuth=azimuth;
  mPitch=pitch;
  mRoll=roll;
  String provider=loc.getProvider();
  if (provider.equals(LocationManager.GPS_PROVIDER)) {
    provider=getString(R.string.provider_gps);
  }
 else   if (provider.equals(LocationManager.NETWORK_PROVIDER)) {
    provider=getString(R.string.provider_network);
  }
 else {
    provider=getString(R.string.provider_passive);
  }
  viewProvider.setText(provider);
  viewLat.setText(UtilsFormat.formatLatitude(loc.getLatitude()));
  viewLon.setText(UtilsFormat.formatLongitude(loc.getLongitude()));
  viewAlt.setText(UtilsFormat.formatAltitude(loc.getAltitude(),true));
  viewAcc.setText(UtilsFormat.formatDistance((double)loc.getAccuracy(),false));
  viewSpeed.setText(UtilsFormat.formatSpeed(loc.getSpeed(),false));
  repaint();
}

Fixed version (ground truth):
@Override public void onOrientationChanged(float azimuth,float pitch,float roll){
  Location loc=LocationState.getLocation();
  mAzimuth=azimuth;
  mPitch=pitch;
  mRoll=roll;
  String provider=loc.getProvider();
switch (provider) {
case LocationManager.GPS_PROVIDER:
    provider=getString(R.string.provider_gps);
  break;
case LocationManager.NETWORK_PROVIDER:
provider=getString(R.string.provider_network);
break;
default :
provider=getString(R.string.provider_passive);
break;
}
viewProvider.setText(provider);
viewLat.setText(UtilsFormat.formatLatitude(loc.getLatitude()));
viewLon.setText(UtilsFormat.formatLongitude(loc.getLongitude()));
viewAlt.setText(UtilsFormat.formatAltitude(loc.getAltitude(),true));
viewAcc.setText(UtilsFormat.formatDistance((double)loc.getAccuracy(),false));
viewSpeed.setText(UtilsFormat.formatSpeed(loc.getSpeed(),false));
repaint();
}