nus-yam/ex-repair huggingface dataset:
Program: 75965
Project: 75965
Buggy source:
CachedAggregationResultSet(DataInputStream inputStream,int length,String[] levelNames,int[] sortTypes,String[][] keyNames,String[][] attributeNames,int[][] keyDataTypes,int[][] attributeDataTypes,String[] aggregationNames,int[] aggregationDataType) throws IOException {
  this.currentPosition=0;
  this.length=length;
  this.levelNames=levelNames;
  this.sortType=sortTypes;
  this.keyNames=keyNames;
  this.attributeNames=attributeNames;
  this.keyDataTypes=keyDataTypes;
  this.attributeDataTypes=attributeDataTypes;
  this.aggregationDataType=aggregationDataType;
  this.aggregationResultNameMap=new HashMap();
  if (aggregationNames != null) {
    for (int i=0; i < aggregationNames.length; i++) {
      aggregationResultNameMap.put(aggregationNames[i],new Integer(i));
    }
  }
  aggregationResultRow=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  for (int i=0; i < length; i++) {
    aggregationResultRow.add(AggregationResultSetSaveUtil.loadAggregationRow(inputStream));
  }
  seek(0);
}

Fixed version (ground truth):
CachedAggregationResultSet(DataInputStream inputStream,int length,String[] levelNames,int[] sortTypes,String[][] keyNames,String[][] attributeNames,int[][] keyDataTypes,int[][] attributeDataTypes,String[] aggregationNames,int[] aggregationDataType) throws IOException {
  this.inputStream=inputStream;
  this.currentPosition=0;
  this.length=length;
  this.levelNames=levelNames;
  this.sortType=sortTypes;
  this.keyNames=keyNames;
  this.attributeNames=attributeNames;
  this.keyDataTypes=keyDataTypes;
  this.attributeDataTypes=attributeDataTypes;
  this.aggregationDataType=aggregationDataType;
  this.aggregationResultNameMap=new HashMap();
  if (aggregationNames != null) {
    for (int i=0; i < aggregationNames.length; i++) {
      aggregationResultNameMap.put(aggregationNames[i],new Integer(i));
    }
  }
  aggregationResultRow=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  seek(0);
}
Program: 75966
Project: 75966
Buggy source:
/** 
 * Tests whether the property is the extension property which holds the serialized XML value for extension model properties. The property type should be XML.
 * @param propName name of the property to check
 * @return true if the property is XML type and holds the serialized XMLvalue for extension model properties, otherwise false
 */
public boolean isExtensionXMLProperty(String propName){
  ExtensionElementDefn extDefn=getExtDefn();
  if (extDefn != null) {
    IPropertyDefn propDefn=extDefn.getProperty(propName);
    if (propDefn != null && IPropertyType.XML_TYPE == propDefn.getTypeCode())     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Tests whether the property is the extension property which holds the serialized XML value for extension model properties. The property type should be XML.
 * @param propName name of the property to check
 * @return true if the property is XML type and holds the serialized XMLvalue for extension model properties, otherwise false
 */
public boolean isExtensionXMLProperty(String propName){
  ExtensionElementDefn extDefn=getExtDefn();
  if (extDefn != null) {
    ElementPropertyDefn propDefn=(ElementPropertyDefn)extDefn.getProperty(propName);
    if (propDefn != null && propDefn.hasOwnModel() && IPropertyType.XML_TYPE == propDefn.getTypeCode())     return true;
  }
  return false;
}
Program: 75967
Project: 75967
Buggy source:
static public void startContent(IContent content,IContentEmitter emitter){
  String vformat=content.getStyle().getVisibleFormat();
  if (vformat == null) {
    starter.visit(content,emitter);
  }
 else {
    if (vformat.toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0 || vformat.toLowerCase().indexOf("String_Node_Str") > 0) {
      starter.visit(content,emitter);
    }
  }
}

Fixed version (ground truth):
static public void startContent(IContent content,IContentEmitter emitter){
  String vformat=content.getStyle().getVisibleFormat();
  if (vformat == null) {
    starter.visit(content,emitter);
  }
 else {
    if (vformat.toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) == -1 && vformat.toLowerCase().indexOf("String_Node_Str") == -1) {
      starter.visit(content,emitter);
    }
  }
}
Program: 75968
Project: 75968
Buggy source:
protected void executeHeader(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      removePageBreak(childContent);
      content.getChildren().add(childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}

Fixed version (ground truth):
protected void executeHeader(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      removePageBreak(childContent);
      add(content.getChildren(),childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}
Program: 75969
Project: 75969
Buggy source:
protected void execute(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      content.getChildren().add(childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}

Fixed version (ground truth):
protected void execute(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      add(content.getChildren(),childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}
Program: 75970
Project: 75970
Buggy source:
public boolean hasNextChild(){
  if (!needUpdate) {
    return hasNext;
  }
  if (currentRunIn != null) {
    if (currentRunIn.hasNextChild()) {
      hasNext=true;
      needUpdate=false;
      return hasNext;
    }
 else {
      currentRunIn.close();
    }
  }
  currentRunIn=null;
  while (executor.hasNextChild()) {
    IReportItemExecutor next=executor.getNextChild();
    IContent nextContent=next.execute();
    if (nextContent instanceof IListBandContent) {
      IListBandContent band=(IListBandContent)nextContent;
      if (repeat && (band.getBandType() == IBandContent.BAND_HEADER || band.getBandType() == IBandContent.BAND_GROUP_HEADER)) {
        executeHeader(next,nextContent);
        next.close();
        next=new DOMReportItemExecutor(nextContent);
        next.execute();
        nextContent.getParent().getChildren().add(nextContent);
      }
      if (next.hasNextChild()) {
        currentRunIn=next;
        break;
      }
    }
 else {
      childExecutor=next;
      childContent=nextContent;
      break;
    }
  }
  if (currentRunIn != null || childContent != null) {
    hasNext=true;
  }
 else {
    hasNext=false;
  }
  needUpdate=false;
  return hasNext;
}

Fixed version (ground truth):
public boolean hasNextChild(){
  if (!needUpdate) {
    return hasNext;
  }
  if (currentRunIn != null) {
    if (currentRunIn.hasNextChild()) {
      hasNext=true;
      needUpdate=false;
      return hasNext;
    }
 else {
      currentRunIn.close();
    }
  }
  currentRunIn=null;
  while (executor.hasNextChild()) {
    IReportItemExecutor next=executor.getNextChild();
    IContent nextContent=next.execute();
    if (nextContent instanceof IListBandContent) {
      IListBandContent band=(IListBandContent)nextContent;
      if (repeat && (band.getBandType() == IBandContent.BAND_HEADER || band.getBandType() == IBandContent.BAND_GROUP_HEADER)) {
        executeHeader(next,nextContent);
        next.close();
        next=new DOMReportItemExecutor(nextContent);
        next.execute();
        add(nextContent.getParent().getChildren(),nextContent);
      }
      if (next.hasNextChild()) {
        currentRunIn=next;
        break;
      }
    }
 else {
      childExecutor=next;
      childContent=nextContent;
      break;
    }
  }
  if (currentRunIn != null || childContent != null) {
    hasNext=true;
  }
 else {
    hasNext=false;
  }
  needUpdate=false;
  return hasNext;
}
Program: 75971
Project: 75971
Buggy source:
/** 
 * @return whether the output format is for printing
 */
protected boolean isForPrinting(){
  String outputFormat=getOutputFormat();
  if ("String_Node_Str".equalsIgnoreCase(outputFormat) || "String_Node_Str".equalsIgnoreCase(outputFormat))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * @return whether the output format is for printing
 */
protected boolean isForPrinting(){
  String outputFormat=getOutputFormat();
  if ("String_Node_Str".equalsIgnoreCase(outputFormat) || "String_Node_Str".equalsIgnoreCase(outputFormat) || "String_Node_Str".equalsIgnoreCase(outputFormat))   return true;
  return false;
}
Program: 75973
Project: 75973
Buggy source:
/** 
 * @throws Exception
 */
public void testJSFilterWithCache() throws Exception {
  String[] bindingNameRow=new String[4];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  ScriptExpression[] bindingExprRow=new ScriptExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_GE,"String_Node_Str")),new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_EQ,"String_Node_Str"))};
  QueryDefinition queryDefn1=this.createQuery(null,null,null,null,null,null,null,null,filterDefn,bindingNameRow,bindingExprRow);
  queryDefn1.setNeedCache(true);
  IResultIterator resultIt=executeQuery(queryDefn1);
  String queryResultID=resultIt.getQueryResults().getID();
  resultIt.close();
  resultIt=getResultIterator(filterDefn,null,null,true,queryResultID);
  outputQueryResult(resultIt,bindingNameRow);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testJSFilterWithCache() throws Exception {
  String[] bindingNameRow=new String[4];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  ScriptExpression[] bindingExprRow=new ScriptExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_GE,"String_Node_Str")),new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_EQ,"String_Node_Str"))};
  QueryDefinition queryDefn1=this.createQuery(null,null,null,null,null,null,null,null,filterDefn,bindingNameRow,bindingExprRow);
  queryDefn1.setCacheQueryResults(true);
  IResultIterator resultIt=executeQuery(queryDefn1);
  String queryResultID=resultIt.getQueryResults().getID();
  resultIt.close();
  resultIt=getResultIterator(filterDefn,null,null,true,queryResultID);
  outputQueryResult(resultIt,bindingNameRow);
  checkOutputFile();
}
Program: 75975
Project: 75975
Buggy source:
private void groupOnDayWithCache(Object startValue) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.DAY_INTERVAL);
  if (startValue != null)   groupDefn[0].setIntervalStart(startValue);
  groupDefn[0].setIntervalRange(3);
  String[] bindingNameRow=new String[4];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[4];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  bindingExprRow[3]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  qd.setNeedCache(true);
  String outputStr=getOutputStrForGroupTestWithCache(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}

Fixed version (ground truth):
private void groupOnDayWithCache(Object startValue) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.DAY_INTERVAL);
  if (startValue != null)   groupDefn[0].setIntervalStart(startValue);
  groupDefn[0].setIntervalRange(3);
  String[] bindingNameRow=new String[4];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[4];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  bindingExprRow[3]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  qd.setCacheQueryResults(true);
  String outputStr=getOutputStrForGroupTestWithCache(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}
Program: 75978
Project: 75978
Buggy source:
private static IDocumentManager createRADocumentManager() throws IOException, DataException {
  String pathName=System.getProperty("String_Node_Str") + File.separator + "String_Node_Str";
  ArchiveFile archiveFile=new ArchiveFile(pathName,"String_Node_Str");
  ArchiveReader reader=new ArchiveReader(archiveFile);
  IDocumentManager documentManager=DocumentManagerFactory.createRADocumentManager(reader);
  return documentManager;
}

Fixed version (ground truth):
private static IDocumentManager createRADocumentManager() throws IOException, DataException {
  ArchiveFile archiveFile=new ArchiveFile(pathName,"String_Node_Str");
  ArchiveReader reader=new ArchiveReader(archiveFile);
  IDocumentManager documentManager=DocumentManagerFactory.createRADocumentManager(reader);
  return documentManager;
}
Program: 75979
Project: 75979
Buggy source:
private static IDocArchiveWriter createRAWriter() throws IOException {
  String pathName=System.getProperty("String_Node_Str") + File.separator + "String_Node_Str";
  ArchiveFile archiveFile=new ArchiveFile(pathName,"String_Node_Str");
  ArchiveWriter writer=new ArchiveWriter(archiveFile);
  return writer;
}

Fixed version (ground truth):
private static IDocArchiveWriter createRAWriter() throws IOException {
  ArchiveFile archiveFile=new ArchiveFile(pathName,"String_Node_Str");
  ArchiveWriter writer=new ArchiveWriter(archiveFile);
  return writer;
}
Program: 75980
Project: 75980
Buggy source:
/** 
 * Caculate the paste position
 */
private void calculatePositionAndSlotId(){
  DesignElementHandle container=null;
  if (newContainer instanceof DesignElementHandle) {
    slotID=DEUtil.getDefaultSlotID(newContainer);
    container=(DesignElementHandle)newContainer;
  }
 else   if (newContainer instanceof SlotHandle) {
    slotID=((SlotHandle)newContainer).getSlotID();
    container=((SlotHandle)newContainer).getElementHandle();
  }
 else {
    return;
  }
  if (afterHandle != null) {
    position=DEUtil.findInsertPosition(container,afterHandle,slotID);
  }
 else   if (position > -1 && isCut && sourceHandle.getContainer() == container) {
    int oldPosition=DEUtil.findInsertPosition(container,sourceHandle,slotID);
    if (oldPosition < position) {
      position--;
    }
  }
}

Fixed version (ground truth):
/** 
 * Caculate the paste position
 */
private void calculatePositionAndSlotId(){
  DesignElementHandle container=null;
  if (newContainer instanceof DesignElementHandle) {
    slotID=DEUtil.getDefaultSlotID(newContainer);
    if (slotID == -1) {
      contentString=DEUtil.getDefaultContentName(newContainer);
    }
    container=(DesignElementHandle)newContainer;
  }
 else   if (newContainer instanceof SlotHandle) {
    slotID=((SlotHandle)newContainer).getSlotID();
    container=((SlotHandle)newContainer).getElementHandle();
  }
 else {
    return;
  }
  if (afterHandle != null) {
    position=DEUtil.findInsertPosition(container,afterHandle,slotID);
  }
 else   if (position > -1 && isCut && sourceHandle.getContainer() == container) {
    int oldPosition=DEUtil.findInsertPosition(container,sourceHandle,slotID);
    if (oldPosition < position) {
      position--;
    }
  }
}
Program: 75981
Project: 75981
Buggy source:
/** 
 * Add this design element to report.
 * @param newHandle The design element to add
 */
private void addHandleToReport(DesignElementHandle newHandle) throws ContentException, NameException {
  SlotHandle slotHandle=null;
  if (newContainer instanceof DesignElementHandle) {
    slotHandle=((DesignElementHandle)newContainer).getSlot(slotID);
    slotHandle.paste(newHandle,position);
  }
 else   if (newContainer instanceof SlotHandle) {
    slotHandle=(SlotHandle)newContainer;
    slotHandle.paste(newHandle,position);
  }
 else   if (newContainer instanceof PropertyHandle) {
    try {
      ((PropertyHandle)newContainer).add(newHandle,position);
    }
 catch (    SemanticException e) {
    }
  }
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(newHandle) + "String_Node_Str"+ slotHandle.getSlotID()+ "String_Node_Str"+ DEUtil.getDisplayLabel(slotHandle.getElementHandle())+ "String_Node_Str"+ position);
  }
}

Fixed version (ground truth):
/** 
 * Add this design element to report.
 * @param newHandle The design element to add
 */
private void addHandleToReport(DesignElementHandle newHandle) throws ContentException, NameException, SemanticException {
  SlotHandle slotHandle=null;
  if (newContainer instanceof DesignElementHandle) {
    slotHandle=((DesignElementHandle)newContainer).getSlot(slotID);
  }
 else   if (newContainer instanceof SlotHandle) {
    slotHandle=(SlotHandle)newContainer;
  }
  if (slotHandle != null) {
    slotHandle.paste(newHandle,position);
  }
 else   if (newContainer instanceof PropertyHandle) {
    ((PropertyHandle)newContainer).paste(newHandle,position);
  }
 else   if (newContainer instanceof DesignElementHandle) {
    ((DesignElementHandle)newContainer).getPropertyHandle(contentString).paste(newHandle,position);
  }
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(newHandle) + "String_Node_Str"+ slotHandle.getSlotID()+ "String_Node_Str"+ DEUtil.getDisplayLabel(slotHandle.getElementHandle())+ "String_Node_Str"+ position);
  }
}
Program: 75983
Project: 75983
Buggy source:
/** 
 * Pastes elements. Includes transaction.
 * @param transferData single or multiple transfer data, every data must be an instance of <code>DesignElementHandle</code> or <code>DesignElement</code>
 * @param targetObj container or sibling. Copy position is after the sibling or the last in the container
 * @return paste result
 */
public static boolean copyHandles(Object transferData,Object targetObj){
  if (getColumnHandle(transferData) != null) {
    return copyColumn(getColumnHandle(transferData),targetObj,false);
  }
  int canContain=handleValidateTargetCanContain(targetObj,transferData,true);
  int position=calculateNextPosition(targetObj,canContain);
  if (position > -1) {
    targetObj=getDesignElementHandle(targetObj).getContainerSlotHandle();
  }
  return copyHandles(transferData,targetObj,position);
}

Fixed version (ground truth):
/** 
 * Pastes elements. Includes transaction.
 * @param transferData single or multiple transfer data, every data must be an instance of <code>DesignElementHandle</code> or <code>DesignElement</code>
 * @param targetObj container or sibling. Copy position is after the sibling or the last in the container
 * @return paste result
 */
public static boolean copyHandles(Object transferData,Object targetObj){
  targetObj=unwrapToModel(targetObj);
  if (getColumnHandle(transferData) != null) {
    return copyColumn(getColumnHandle(transferData),targetObj,false);
  }
  int canContain=handleValidateTargetCanContain(targetObj,transferData,true);
  int position=calculateNextPosition(targetObj,canContain);
  if (position > -1) {
    Object temp=targetObj;
    targetObj=getDesignElementHandle(targetObj).getContainerSlotHandle();
    if (targetObj == null) {
      targetObj=getDesignElementHandle(temp).getContainer();
    }
  }
  return copyHandles(transferData,targetObj,position);
}
Program: 75984
Project: 75984
Buggy source:
/** 
 * Gets the position after the sibling in the container
 * @param targetObj container or sibling
 * @param canContain <code>CONTAIN_PARENT</code> as sibling, others as container
 * @return the position: after the sibling in the same container, or -1 asthe last position in the container
 */
public static int calculateNextPosition(Object targetObj,int canContain){
  int position=-1;
  if (canContain == CONTAIN_PARENT) {
    DesignElementHandle afterHandle=getDesignElementHandle(targetObj);
    if (afterHandle != null) {
      if (afterHandle.getContainerSlotHandle() != null) {
        position=afterHandle.getContainerSlotHandle().findPosn(afterHandle);
      }
 else       if (afterHandle.getContainerPropertyHandle() != null) {
        position=afterHandle.getContainerPropertyHandle().getContents().indexOf(afterHandle);
      }
      position++;
    }
  }
  return position;
}

Fixed version (ground truth):
/** 
 * Gets the position after the sibling in the container
 * @param targetObj container or sibling
 * @param canContain <code>CONTAIN_PARENT</code> as sibling, others as container
 * @return the position: after the sibling in the same container, or -1 asthe last position in the container
 */
public static int calculateNextPosition(Object targetObj,int canContain){
  int position=-1;
  if (canContain == CONTAIN_PARENT) {
    DesignElementHandle afterHandle=getDesignElementHandle(targetObj);
    if (afterHandle != null) {
      position=afterHandle.getIndex();
      position++;
    }
  }
  return position;
}
Program: 75985
Project: 75985
Buggy source:
public int findInParameter(String parameterName) throws OdaException {
  UnsupportedOperationException e=new UnsupportedOperationException("String_Node_Str");
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str",e);
  throw e;
}

Fixed version (ground truth):
public int findInParameter(String parameterName) throws OdaException {
  UnsupportedOperationException e=new UnsupportedOperationException("String_Node_Str");
  addLog("String_Node_Str",e);
  throw e;
}
Program: 75986
Project: 75986
Buggy source:
public void setNull(int parameterId) throws OdaException {
  assertNotNull(preStat);
  try {
    java.sql.ParameterMetaData pm=this.preStat.getParameterMetaData();
    if (pm == null) {
      this.preStat.setNull(parameterId,java.sql.Types.OTHER);
    }
 else {
      this.preStat.setNull(parameterId,pm.getParameterType(parameterId));
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_NULL_VALUE,e);
  }
}

Fixed version (ground truth):
public void setNull(int parameterId) throws OdaException {
  assertNotNull(preStat);
  try {
    java.sql.ParameterMetaData pm=this.preStat.getParameterMetaData();
    if (pm == null) {
      this.preStat.setNull(parameterId,java.sql.Types.OTHER);
      addLog("String_Node_Str",parameterId,"String_Node_Str");
    }
 else {
      this.preStat.setNull(parameterId,pm.getParameterType(parameterId));
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_NULL_VALUE,e);
  }
}
Program: 75987
Project: 75987
Buggy source:
public void setDouble(int parameterId,double value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setDouble(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_DUBLE_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setDouble(int parameterId,double value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setDouble(parameterId,value);
    addLog("String_Node_Str",parameterId,String.valueOf(value));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_DUBLE_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75988
Project: 75988
Buggy source:
public void setSortSpec(SortSpec sortBy) throws OdaException {
  UnsupportedOperationException e=new UnsupportedOperationException("String_Node_Str");
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str",e);
  throw e;
}

Fixed version (ground truth):
public void setSortSpec(SortSpec sortBy) throws OdaException {
  UnsupportedOperationException e=new UnsupportedOperationException("String_Node_Str");
  addLog("String_Node_Str",e);
  throw e;
}
Program: 75989
Project: 75989
Buggy source:
public void setTimestamp(int parameterId,Timestamp value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setTimestamp(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_TIMESTAMP_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setTimestamp(int parameterId,Timestamp value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setTimestamp(parameterId,value);
    addLog("String_Node_Str",parameterId,String.valueOf(value));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_TIMESTAMP_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75990
Project: 75990
Buggy source:
public void setTime(int parameterId,Time value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setTime(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_TIME_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setTime(int parameterId,Time value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setTime(parameterId,value);
    addLog("String_Node_Str",parameterId,value.toString());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_TIME_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75991
Project: 75991
Buggy source:
public void setBigDecimal(int parameterId,BigDecimal value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setBigDecimal(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_BIGDECIMAL_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setBigDecimal(int parameterId,BigDecimal value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setBigDecimal(parameterId,value);
    addLog("String_Node_Str",parameterId,String.valueOf(value));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_BIGDECIMAL_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75992
Project: 75992
Buggy source:
public void setInt(int parameterId,int value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setInt(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_INT_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setInt(int parameterId,int value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setInt(parameterId,value);
    addLog("String_Node_Str",parameterId,String.valueOf(value));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_INT_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75993
Project: 75993
Buggy source:
public void setString(int parameterId,String value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setString(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_STRING_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setString(int parameterId,String value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setString(parameterId,value);
    addLog("String_Node_Str",parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_STRING_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75994
Project: 75994
Buggy source:
public void setProperty(String name,String value) throws OdaException {
  if (name == null)   throw new NullPointerException("String_Node_Str");
  if (name.equals("String_Node_Str")) {
    if (value != null && value.length() > 0) {
      try {
        double secs=Double.parseDouble(value);
        this.preStat.setQueryTimeout((int)secs);
      }
 catch (      SQLException e) {
        logger.log(Level.FINE,"String_Node_Str",e);
      }
    }
  }
 else   if (name.equals(ConnectionProfileProperty.PROFILE_NAME_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PATH_PROP_KEY)) {
  }
 else {
    OdaException e=new OdaException("String_Node_Str" + name);
    logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
public void setProperty(String name,String value) throws OdaException {
  if (name == null)   throw new NullPointerException("String_Node_Str");
  if (name.equals("String_Node_Str")) {
    if (value != null && value.length() > 0) {
      try {
        double secs=Double.parseDouble(value);
        this.preStat.setQueryTimeout((int)secs);
      }
 catch (      SQLException e) {
        logger.log(Level.FINE,"String_Node_Str",e);
      }
    }
  }
 else   if (name.equals(ConnectionProfileProperty.PROFILE_NAME_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PATH_PROP_KEY)) {
  }
 else {
    OdaException e=new OdaException("String_Node_Str" + name);
    addLog("String_Node_Str",e);
    throw e;
  }
}
Program: 75995
Project: 75995
Buggy source:
public void setDate(int parameterId,Date value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setDate(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_DATE_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setDate(int parameterId,Date value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setDate(parameterId,value);
    addLog("String_Node_Str",parameterId,value.toString());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_DATE_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75996
Project: 75996
Buggy source:
public void setBoolean(int parameterId,boolean value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setBoolean(parameterId,value);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_BOOLEAN_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}

Fixed version (ground truth):
public void setBoolean(int parameterId,boolean value) throws OdaException {
  assertNotNull(preStat);
  try {
    this.preStat.setBoolean(parameterId,value);
    addLog("String_Node_Str",parameterId,String.valueOf(value));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_BOOLEAN_VALUE,e);
  }
catch (  RuntimeException e1) {
    rethrowRunTimeException(e1,ERRMSG_SET_PARAMETER + parameterId);
  }
}
Program: 75998
Project: 75998
Buggy source:
/** 
 * Gets insert elements actions including extension points.
 */
private RegisterActions[] getInsertElementActions(){
  if (insertElementActions == null) {
    insertElementActions=insertActions;
    List extensionPoints=ExtensionPointManager.getInstance().getExtendedElementPoints();
    PaletteEntryExtension[] entries=EditpartExtensionManager.getPaletteEntries();
    if (!extensionPoints.isEmpty()) {
      insertElementActions=new RegisterActions[insertActions.length + extensionPoints.size() + entries.length];
      for (int i=0; i < insertActions.length; i++) {
        insertElementActions[i]=insertActions[i];
      }
      for (int k=0; k < extensionPoints.size(); k++) {
        ExtendedElementUIPoint point=(ExtendedElementUIPoint)extensionPoints.get(k);
        IElementDefn extension=DEUtil.getMetaDataDictionary().getExtension(point.getExtensionName());
        String displayName=new String();
        displayName=extension.getDisplayName();
        if (displayName.equalsIgnoreCase("String_Node_Str")) {
          displayName="String_Node_Str" + displayName;
        }
        RegisterActions extAction=new RegisterActions(extension.getName(),displayName);
        insertElementActions[insertActions.length + k]=extAction;
      }
    }
    for (int i=0; i < entries.length; i++) {
      RegisterActions extAction=new RegisterActions(entries[i].getItemName(),entries[i].getLabel());
      insertElementActions[insertActions.length + extensionPoints.size() + i]=extAction;
    }
  }
  return insertElementActions;
}

Fixed version (ground truth):
/** 
 * Gets insert elements actions including extension points.
 */
private RegisterActions[] getInsertElementActions(){
  if (insertElementActions == null) {
    insertElementActions=insertActions;
    List extensionPoints=ExtensionPointManager.getInstance().getExtendedElementPoints();
    PaletteEntryExtension[] entries=EditpartExtensionManager.getPaletteEntries();
    insertElementActions=new RegisterActions[insertActions.length + extensionPoints.size() + entries.length];
    for (int i=0; i < insertActions.length; i++) {
      insertElementActions[i]=insertActions[i];
    }
    if (!extensionPoints.isEmpty()) {
      for (int k=0; k < extensionPoints.size(); k++) {
        ExtendedElementUIPoint point=(ExtendedElementUIPoint)extensionPoints.get(k);
        IElementDefn extension=DEUtil.getMetaDataDictionary().getExtension(point.getExtensionName());
        String displayName=new String();
        displayName=extension.getDisplayName();
        if (displayName.equalsIgnoreCase("String_Node_Str")) {
          displayName="String_Node_Str" + displayName;
        }
        RegisterActions extAction=new RegisterActions(extension.getName(),displayName);
        insertElementActions[insertActions.length + k]=extAction;
      }
    }
    for (int i=0; i < entries.length; i++) {
      RegisterActions extAction=new RegisterActions(entries[i].getItemName(),entries[i].getLabel());
      insertElementActions[insertActions.length + extensionPoints.size() + i]=extAction;
    }
  }
  return insertElementActions;
}
Program: 75999
Project: 75999
Buggy source:
public void setKeepWithNext(boolean keepWithNext){
  if (keepWithNext) {
    keepWith=true;
  }
  if (!keepWith) {
    clearCache();
  }
}

Fixed version (ground truth):
public void setKeepWithNext(boolean keepWithNext){
  if (keepWithNext) {
    keepWith=true;
  }
  if (!keepWith && !pageBreakAvoid) {
    clearCache();
  }
}
Program: 76001
Project: 76001
Buggy source:
/** 
 */
void produceaggregationNameMap(){
  AggregationFunctionDefinition[] functions=aggregation.getAggregationFunctions();
  aggregationResultNameMap=new HashMap();
  for (int i=0; i < functions.length; i++) {
    if (functions[i].getName() != null) {
      aggregationResultNameMap.put(functions[i].getName(),new Integer(i));
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void produceaggregationNameMap(){
  AggregationFunctionDefinition[] functions=aggregation.getAggregationFunctions();
  aggregationResultNameMap=new HashMap();
  if (functions == null) {
    return;
  }
  for (int i=0; i < functions.length; i++) {
    if (functions[i].getName() != null) {
      aggregationResultNameMap.put(functions[i].getName(),new Integer(i));
    }
  }
}
Program: 76002
Project: 76002
Buggy source:
/** 
 * Returns the GetParameterDefinitionTask
 * @param reportDesignName
 * @param options
 * @return
 * @throws EngineException
 */
private IGetParameterDefinitionTask getParameterDefinitionTask(String reportDesignName,InputOptions options) throws EngineException {
  IReportRunnable runnable=ReportEngineService.getInstance().openReportDesign(reportDesignName,getModuleOptions(options));
  IGetParameterDefinitionTask paramTask=ReportEngineService.getInstance().createGetParameterDefinitionTask(runnable);
  return paramTask;
}

Fixed version (ground truth):
/** 
 * Returns the GetParameterDefinitionTask
 * @param reportDesignName
 * @param options
 * @return
 * @throws EngineException
 */
private IGetParameterDefinitionTask getParameterDefinitionTask(String reportDesignName,InputOptions options) throws EngineException {
  IReportRunnable runnable=ReportEngineService.getInstance().openReportDesign(reportDesignName,getModuleOptions(options));
  IGetParameterDefinitionTask paramTask=ReportEngineService.getInstance().createGetParameterDefinitionTask(runnable,options);
  return paramTask;
}
Program: 76004
Project: 76004
Buggy source:
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable){
  IGetParameterDefinitionTask task=null;
  try {
    task=engine.createGetParameterDefinitionTask(runnable);
  }
 catch (  Exception e) {
  }
  return task;
}

Fixed version (ground truth):
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable,InputOptions options){
  IGetParameterDefinitionTask task=null;
  try {
    HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
    task=engine.createGetParameterDefinitionTask(runnable);
    Map context=BirtUtility.getAppContext(request,ReportEngineService.class.getClassLoader());
    task.setAppContext(context);
  }
 catch (  Exception e) {
  }
  return task;
}
Program: 76005
Project: 76005
Buggy source:
public int getAggregationIndex(String name) throws IOException {
  return ((Integer)aggregationResultNameMap.get(name)).intValue();
}

Fixed version (ground truth):
public int getAggregationIndex(String name) throws IOException {
  Object index=aggregationResultNameMap.get(name);
  if (index == null) {
    return -1;
  }
  return ((Integer)index).intValue();
}
Program: 76007
Project: 76007
Buggy source:
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    IDE.openEditor(page,file,true);
    BasicNewProjectResourceWizard.updatePerspective(configElement);
    if (showCheat && !cheatId.equals("String_Node_Str")) {
      OpenCheatSheetAction action=null;
      action=new OpenCheatSheetAction(cheatId);
      action.run();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    IDE.openEditor(page,file,true);
    BasicNewProjectResourceWizard.updatePerspective(configElement);
    if (showCheat && !cheatId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatId).run();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}
Program: 76009
Project: 76009
Buggy source:
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      OpenCheatSheetAction action=new OpenCheatSheetAction(cheatSheetId);
      action.run();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatSheetId).run();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}
Program: 76011
Project: 76011
Buggy source:
/** 
 * When session destroyed
 * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
 */
public void sessionDestroyed(HttpSessionEvent event){
  String sessionId=event.getSession().getId();
  ParameterAccessor.clearSessionFiles(sessionId);
}

Fixed version (ground truth):
/** 
 * When session destroyed
 * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
 */
public void sessionDestroyed(HttpSessionEvent event){
  if (ParameterAccessor.isCleanSessionFiles) {
    String sessionId=event.getSession().getId();
    ParameterAccessor.clearSessionFiles(sessionId);
  }
}
Program: 76012
Project: 76012
Buggy source:
protected String getRenderingStyle(Object key){
  Object value=renderingHints.get(key);
  if (key.equals(RenderingHints.KEY_TEXT_ANTIALIASING)) {
    if (value.equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF))     return "String_Node_Str";
 else     return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
protected String getRenderingStyle(Object key){
  Object value=renderingHints.get(key);
  if (key.equals(RenderingHints.KEY_TEXT_ANTIALIASING)) {
    if (value.equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)) {
      if (transforms.getType() != AffineTransform.TYPE_IDENTITY)       return "String_Node_Str";
 else       return "String_Node_Str";
    }
 else     return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 76013
Project: 76013
Buggy source:
/** 
 * Delegate method to the Graphics2D drawString method.
 * @param g2d graphics context that is SVG graphic context.
 * @param x the x value to draw the string
 * @param y the y value to draw the string
 */
public void draw(Graphics2D g2d,float x,float y){
  SVGGraphics2D SVGg2d=(SVGGraphics2D)g2d;
  SVGg2d.drawString(value,x,y);
}

Fixed version (ground truth):
/** 
 * Delegate method to the Graphics2D drawString method.
 * @param g2d graphics context that is SVG graphic context.
 * @param x the x value to draw the string
 * @param y the y value to draw the string
 */
public void draw(Graphics2D g2d,float x,float y){
  SVGGraphics2D SVGg2d=(SVGGraphics2D)g2d;
  if (frc.isAntiAliased())   SVGg2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
 else   SVGg2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
  SVGg2d.drawString(value,x,y);
}
Program: 76014
Project: 76014
Buggy source:
/** 
 * starts a TOC entry, mostly used for non-leaf TOC entry, which can not be closed until its children have been written.
 * @param content report item content object
 */
protected void startTOCEntry(IContent content){
  TOCBuilder tocBuilder=context.getTOCBuilder();
  if (tocBuilder != null) {
    if (content != null) {
      TOCEntry parentTOCEntry=getParentTOCEntry();
      String hiddenFormats=content.getStyle().getVisibleFormat();
      Object tocValue=content.getTOC();
      if (tocValue != null) {
        long elementId=((ReportElementDesign)content.getGenerateBy()).getID();
        String bookmark=content.getBookmark();
        tocEntry=tocBuilder.startEntry(parentTOCEntry,tocValue,bookmark,hiddenFormats,elementId);
        String tocId=tocEntry.getNode().getNodeID();
        if (bookmark == null) {
          content.setBookmark(tocId);
        }
        return;
      }
 else       if (hiddenFormats != null) {
        tocEntry=tocBuilder.startDummyEntry(parentTOCEntry,hiddenFormats);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * starts a TOC entry, mostly used for non-leaf TOC entry, which can not be closed until its children have been written.
 * @param content report item content object
 */
protected void startTOCEntry(IContent content){
  TOCBuilder tocBuilder=context.getTOCBuilder();
  if (tocBuilder != null) {
    if (content != null) {
      TOCEntry parentTOCEntry=getParentTOCEntry();
      String hiddenFormats=content.getStyle().getVisibleFormat();
      Object tocValue=content.getTOC();
      if (tocValue != null) {
        long elementId=getElementId(content);
        String bookmark=content.getBookmark();
        tocEntry=tocBuilder.startEntry(parentTOCEntry,tocValue,bookmark,hiddenFormats,elementId);
        String tocId=tocEntry.getNode().getNodeID();
        if (bookmark == null) {
          content.setBookmark(tocId);
        }
        return;
      }
 else       if (hiddenFormats != null) {
        tocEntry=tocBuilder.startDummyEntry(parentTOCEntry,hiddenFormats);
      }
    }
  }
}