nus-yam/ex-repair huggingface dataset:
Program: 72142
Project: 72142
Buggy source:
protected void verticalAlign(){
  Iterator iter=currentContext.root.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    IStyle childStyle=child.getStyle();
    String vAlign=childStyle.getVerticalAlign();
    if (childStyle == null) {
      continue;
    }
    int spacing=currentContext.root.getHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (CSSConstants.CSS_BASELINE_VALUE.equalsIgnoreCase(vAlign)) {
      int lineHeight=((ContainerLayout)parent).getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine());
      }
    }
 else     if (CSSConstants.CSS_BOTTOM_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),spacing + child.getY());
    }
 else     if (CSSConstants.CSS_MIDDLE_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),spacing / 2 + child.getY());
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(){
  Iterator iter=currentContext.root.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    IStyle childStyle=child.getStyle();
    String vAlign=childStyle.getVerticalAlign();
    if (childStyle == null) {
      continue;
    }
    int spacing=currentContext.root.getContentHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (CSSConstants.CSS_BASELINE_VALUE.equalsIgnoreCase(vAlign)) {
      int lineHeight=((ContainerLayout)parent).getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine());
      }
    }
 else     if (CSSConstants.CSS_BOTTOM_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing);
    }
 else     if (CSSConstants.CSS_MIDDLE_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing / 2);
    }
  }
}
Program: 72143
Project: 72143
Buggy source:
private int getMaxBaseLine(){
  int maxChildrenBaseLine=currentContext.root.getMaxChildrenBaseLine();
  if (maxChildrenBaseLine == 0) {
    Iterator iter=currentContext.root.getChildren();
    int maxChildrenBaseLineBelow=currentContext.root.getMaxChildrenBaseLineBelow();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      maxChildrenBaseLine=Math.max(maxChildrenBaseLine,child.getBaseLine());
      maxChildrenBaseLineBelow=Math.max(maxChildrenBaseLineBelow,child.getAllocatedHeight() - child.getBaseLine());
    }
    currentContext.root.setContentHeight(Math.max(currentContext.root.getContentHeight(),maxChildrenBaseLine + maxChildrenBaseLineBelow));
    currentContext.root.setBaseLine(maxChildrenBaseLine);
    currentContext.root.setMaxChildrenBaseLine(maxChildrenBaseLine);
    currentContext.root.setMaxChildrenBaseLineBelow(maxChildrenBaseLineBelow);
  }
  return maxChildrenBaseLine;
}

Fixed version (ground truth):
/** 
 * Calculates the max baseline, and update the root height if necessary.
 * @return the max baseline.
 */
private int getMaxBaseLine(){
  int maxChildrenBaseLine=currentContext.root.getMaxChildrenBaseLine();
  if (maxChildrenBaseLine == 0) {
    int maxChildrenBaseLineBelow=0;
    Iterator iter=currentContext.root.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      maxChildrenBaseLine=Math.max(maxChildrenBaseLine,child.getBaseLine());
      maxChildrenBaseLineBelow=Math.max(maxChildrenBaseLineBelow,child.getAllocatedHeight() - child.getBaseLine());
    }
    currentContext.root.setContentHeight(Math.max(currentContext.root.getContentHeight(),maxChildrenBaseLine + maxChildrenBaseLineBelow));
    currentContext.root.setBaseLine(maxChildrenBaseLine);
    currentContext.root.setMaxChildrenBaseLine(maxChildrenBaseLine);
    currentContext.root.setMaxChildrenBaseLineBelow(maxChildrenBaseLineBelow);
  }
  return maxChildrenBaseLine;
}
Program: 72144
Project: 72144
Buggy source:
public void defineNames(List namesRefer){
  writer.openTag("String_Node_Str");
  for (Iterator it=namesRefer.iterator(); it.hasNext(); ) {
    BookmarkDef bookmark=(BookmarkDef)it.next();
    String name=bookmark.getName();
    String refer=bookmark.getRefer();
    defineName(name,refer);
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void defineNames(List namesRefer){
  writer.openTag("String_Node_Str");
  for (Iterator it=namesRefer.iterator(); it.hasNext(); ) {
    BookmarkDef bookmark=(BookmarkDef)it.next();
    String name=bookmark.getName();
    String refer=bookmark.getRefer();
    if (!bookmarkNames.contains(name)) {
      defineName(name,refer);
      bookmarkNames.add(name);
    }
 else {
      logger.log(Level.WARNING,"String_Node_Str" + name);
    }
  }
  writer.closeTag("String_Node_Str");
  bookmarkNames.clear();
}
Program: 72145
Project: 72145
Buggy source:
/** 
 * adapt the obsolete query definition for backward compatibility.
 * @param query
 * @return
 * @throws DataException
 */
private void adaptCubeQueryDefinition(ICubeQueryDefinition query) throws DataException {
  List bindings=query.getBindings();
  List levelExprList=getAllAggrOns(query);
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    String measureName=OlapExpressionCompiler.getReferencedScriptObject(binding.getExpression(),ScriptConstants.MEASURE_SCRIPTABLE);
    if (measureName != null) {
      if (binding.getAggrFunction() == null) {
        String aggrFunc=getAggrFunction(query,measureName);
        binding.setAggrFunction(aggrFunc);
        if (binding.getAggregatOns().size() == 0) {
          for (Iterator itr=levelExprList.iterator(); itr.hasNext(); ) {
            binding.addAggregateOn(itr.next().toString());
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * adapt the obsolete query definition for backward compatibility.
 * @param query
 * @return
 * @throws DataException
 */
private void adaptCubeQueryDefinition(ICubeQueryDefinition query) throws DataException {
  List bindings=query.getBindings();
  List levelExprList=getAllAggrOns(query);
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    String measureName=OlapExpressionUtil.getMeasure(binding.getExpression());
    if (measureName != null) {
      if (binding.getAggrFunction() == null) {
        String aggrFunc=getAggrFunction(query,measureName);
        binding.setAggrFunction(aggrFunc);
        if (binding.getAggregatOns().size() == 0) {
          for (Iterator itr=levelExprList.iterator(); itr.hasNext(); ) {
            binding.addAggregateOn(itr.next().toString());
          }
        }
      }
    }
  }
}
Program: 72148
Project: 72148
Buggy source:
public static boolean isNumber(String val){
  try {
    new BigDecimal(val);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
public static boolean isNumber(String val){
  try {
    BigDecimal num=new BigDecimal(val);
    if (num.compareTo(new BigDecimal(Double.MAX_VALUE)) != 1)     return true;
 else     return false;
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 72150
Project: 72150
Buggy source:
public void close(){
  if (statementMap.size() > 0) {
    Iterator keySet=statementMap.keySet().iterator();
    while (keySet.hasNext()) {
      PreparedStatement stmt=(PreparedStatement)keySet.next();
      try {
        stmt.close();
      }
 catch (      DataException e) {
        logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
      }
    }
    statementMap.clear();
  }
  Set<CacheConnection> it=this.getOdaConnections(false);
  if (it.size() > 1) {
    CacheConnection conn=it.iterator().next();
    conn.currentStatements=0;
    it.remove(conn);
    for (    CacheConnection connections : it) {
      try {
        connections.odaConn.close();
      }
 catch (      DataException e) {
        e.printStackTrace();
      }
    }
    it.clear();
    it.add(conn);
  }
}

Fixed version (ground truth):
public void close(){
  if (statementMap.size() > 0) {
    Iterator keySet=statementMap.keySet().iterator();
    while (keySet.hasNext()) {
      PreparedStatement stmt=(PreparedStatement)keySet.next();
      try {
        stmt.close();
      }
 catch (      Exception e) {
        logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
      }
    }
    statementMap.clear();
  }
  Set<CacheConnection> it=this.getOdaConnections(false);
  if (it.size() > 1) {
    CacheConnection conn=it.iterator().next();
    conn.currentStatements=0;
    it.remove(conn);
    for (    CacheConnection connections : it) {
      try {
        connections.odaConn.close();
      }
 catch (      Exception e) {
        logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
      }
    }
    it.clear();
    it.add(conn);
  }
}
Program: 72151
Project: 72151
Buggy source:
public void run() throws EngineException {
  doValidateParameters();
  loadDesign();
}

Fixed version (ground truth):
public void run() throws EngineException {
  usingParameterValues();
  loadDesign();
}
Program: 72153
Project: 72153
Buggy source:
/** 
 * Gets a JDBC connection from the specified JNDI data source URL, or if not available, directly from the specified driver and JDBC driver url.
 * @param driverClass   the class name of JDBC driver
 * @param url           JDBC connection URL
 * @param jndiNameUrl   the JNDI name to look up a Data Source name service; may be null or empty
 * @param connectionProperties  properties for establising connection
 * @return              a JDBC connection
 * @throws SQLException
 * @throws OdaException
 */
public Connection getConnection(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  validateConnectionUrl(url,jndiNameUrl);
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + driverClass + "String_Node_Str"+ url+ "String_Node_Str"+ jndiNameUrl);
  return doConnect(driverClass,url,jndiNameUrl,connectionProperties,driverClassPath);
}

Fixed version (ground truth):
/** 
 * Gets a JDBC connection from the specified JNDI data source URL, or if not available, directly from the specified driver and JDBC driver url.
 * @param driverClass   the class name of JDBC driver
 * @param url           JDBC connection URL
 * @param jndiNameUrl   the JNDI name to look up a Data Source name service; may be null or empty
 * @param connectionProperties  properties for establising connection
 * @return              a JDBC connection
 * @throws SQLException
 * @throws OdaException
 */
public Connection getConnection(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  validateConnectionUrl(url,jndiNameUrl);
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + driverClass + "String_Node_Str"+ LogUtil.encryptURL(url)+ "String_Node_Str"+ jndiNameUrl);
  return doConnect(driverClass,url,jndiNameUrl,connectionProperties,driverClassPath);
}
Program: 72154
Project: 72154
Buggy source:
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ url);
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + url);
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(e.getLocalizedMessage()));
  }
}

Fixed version (ground truth):
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ LogUtil.encryptURL(url));
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + LogUtil.encryptURL(url));
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(e.getLocalizedMessage()));
  }
}
Program: 72155
Project: 72155
Buggy source:
public java.sql.Connection connect(String u,Properties p) throws SQLException {
  logger.entering(WrappedDriver.class.getName() + "String_Node_Str" + driverClass,"String_Node_Str",u);
  try {
    return this.driver.connect(u,p);
  }
 catch (  RuntimeException e) {
    throw new SQLException(e.getMessage());
  }
}

Fixed version (ground truth):
public java.sql.Connection connect(String u,Properties p) throws SQLException {
  logger.entering(WrappedDriver.class.getName() + "String_Node_Str" + driverClass,"String_Node_Str",LogUtil.encryptURL(u));
  try {
    return this.driver.connect(u,p);
  }
 catch (  RuntimeException e) {
    throw new SQLException(e.getMessage());
  }
}
Program: 72156
Project: 72156
Buggy source:
public boolean acceptsURL(String u) throws SQLException {
  boolean res=this.driver.acceptsURL(u);
  if (logger.isLoggable(Level.FINER))   logger.log(Level.FINER,"String_Node_Str" + driverClass + "String_Node_Str"+ u+ "String_Node_Str"+ res);
  return res;
}

Fixed version (ground truth):
public boolean acceptsURL(String u) throws SQLException {
  boolean res=this.driver.acceptsURL(u);
  if (logger.isLoggable(Level.FINER))   logger.log(Level.FINER,"String_Node_Str" + driverClass + "String_Node_Str"+ LogUtil.encryptURL(u)+ "String_Node_Str"+ res);
  return res;
}
Program: 72157
Project: 72157
Buggy source:
public static String parse(String dateTime){
  if (dateTime == null) {
    return "String_Node_Str";
  }
  if (dateTime.indexOf("String_Node_Str") != -1) {
    String dateFormat=null;
    DateFormatter dateFormatter=new DateFormatter(dateTime);
    return dateFormatter.getFormatCode();
  }
  StringBuffer buffer=new StringBuffer();
  boolean inQuto=false;
  for (int count=0; count < dateTime.length(); count++) {
    char tempChar=dateTime.charAt(count);
    if (inQuto) {
      if (tempChar == '\'' && nextIsQuto(dateTime,count)) {
        buffer.append(tempChar);
        count++;
      }
 else {
        if (tempChar == '\'') {
          inQuto=false;
        }
 else {
          buffer.append(tempChar);
        }
      }
    }
 else {
      if (tempChar == '\'') {
        if (nextIsQuto(dateTime,count)) {
          buffer.append(tempChar);
          count++;
        }
 else {
          inQuto=true;
        }
      }
 else {
        if (tempChar == 'a') {
          buffer.append("String_Node_Str");
          continue;
        }
        if ("String_Node_Str".indexOf(tempChar) != -1) {
          continue;
        }
        buffer.append(tempChar);
      }
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
public static String parse(String dateTime){
  if (dateTime == null) {
    return "String_Node_Str";
  }
  if (dateTime.indexOf("String_Node_Str") != -1) {
    String dateFormat=null;
    DateFormatter dateFormatter=new DateFormatter(dateTime);
    dateTime=dateFormatter.getFormatCode();
  }
  StringBuffer buffer=new StringBuffer();
  boolean inQuto=false;
  for (int count=0; count < dateTime.length(); count++) {
    char tempChar=dateTime.charAt(count);
    if (inQuto) {
      if (tempChar == '\'' && nextIsQuto(dateTime,count)) {
        buffer.append(tempChar);
        count++;
      }
 else {
        if (tempChar == '\'') {
          inQuto=false;
        }
 else {
          buffer.append(tempChar);
        }
      }
    }
 else {
      if (tempChar == '\'') {
        if (nextIsQuto(dateTime,count)) {
          buffer.append(tempChar);
          count++;
        }
 else {
          inQuto=true;
        }
      }
 else {
        if (tempChar == 'a') {
          buffer.append("String_Node_Str");
          continue;
        }
        if ("String_Node_Str".indexOf(tempChar) != -1) {
          continue;
        }
        buffer.append(tempChar);
      }
    }
  }
  return buffer.toString();
}
Program: 72164
Project: 72164
Buggy source:
private void initBindings(ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  for (Iterator bindings=ChartReportItemUtil.getAllColumnBindingsIterator(handle); bindings.hasNext(); ) {
    ComputedColumnHandle column=(ComputedColumnHandle)bindings.next();
    Binding binding=new Binding(column.getName());
    binding.setDataType(DataAdapterUtil.adaptModelDataType(column.getDataType()));
    binding.setAggrFunction(column.getAggregateFunction() == null ? null : DataAdapterUtil.adaptModelAggregationType(column.getAggregateFunction()));
    String expression=column.getExpression();
    if (expression == null) {
      for (Iterator argItr=column.argumentsIterator(); argItr.hasNext(); ) {
        AggregationArgumentHandle aah=(AggregationArgumentHandle)argItr.next();
        expression=aah.getValue();
      }
    }
    binding.setExpression(new ScriptExpression(expression));
    List lstAggOn=column.getAggregateOnList();
    if (expression == null || !bSingleChart && !lstAggOn.isEmpty()) {
      addAggregateOn(binding,lstAggOn,cubeQuery,cube);
    }
    registeredBindings.put(column.getName(),binding);
    registeredQueries.put(binding.getBindingName(),expression);
  }
}

Fixed version (ground truth):
private void initBindings(ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  for (Iterator bindings=ChartReportItemUtil.getAllColumnBindingsIterator(handle); bindings.hasNext(); ) {
    ComputedColumnHandle column=(ComputedColumnHandle)bindings.next();
    IBinding binding=new Binding(column.getName());
    binding.setDataType(DataAdapterUtil.adaptModelDataType(column.getDataType()));
    binding.setAggrFunction(column.getAggregateFunction() == null ? null : DataAdapterUtil.adaptModelAggregationType(column.getAggregateFunction()));
    String expression=column.getExpression();
    if (expression == null) {
      for (Iterator argItr=column.argumentsIterator(); argItr.hasNext(); ) {
        AggregationArgumentHandle aah=(AggregationArgumentHandle)argItr.next();
        expression=aah.getValue();
      }
    }
    binding.setExpression(new ScriptExpression(expression));
    List lstAggOn=column.getAggregateOnList();
    if (expression == null || !bSingleChart && !lstAggOn.isEmpty()) {
      addAggregateOn(binding,lstAggOn,cubeQuery,cube);
    }
    registeredBindings.put(column.getName(),binding);
    registeredQueries.put(binding.getBindingName(),expression);
  }
}
Program: 72165
Project: 72165
Buggy source:
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param tableRight
 * @param columnRight
 * @param cellRight
 * @param usedStyle
 */
public void resolveTableRightBorder(IStyle tableRight,IStyle rowRight,IStyle columnRight,IStyle cellRight,IStyle usedStyle){
  resolveBorder(tableRightBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(cellRight,POSITION_RIGHT),new BorderStyleInfo(columnRight,POSITION_RIGHT),new BorderStyleInfo(rowRight,POSITION_RIGHT),new BorderStyleInfo(tableRight,POSITION_RIGHT)},new BorderStyleInfo(usedStyle,POSITION_RIGHT));
}

Fixed version (ground truth):
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param tableRight
 * @param columnRight
 * @param cellRight
 * @param usedStyle
 */
public void resolveTableRightBorder(IStyle tableRight,IStyle rowRight,IStyle columnRight,IStyle cellRight,IStyle usedStyle){
  resolveBorder(tableRightBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(cellRight,POSITION_TRAIL),new BorderStyleInfo(columnRight,POSITION_TRAIL),new BorderStyleInfo(rowRight,POSITION_TRAIL),new BorderStyleInfo(tableRight,POSITION_TRAIL)},new BorderStyleInfo(usedStyle,POSITION_TRAIL));
}
Program: 72166
Project: 72166
Buggy source:
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param preColumnRight
 * @param columnLeft
 * @param preCellRight
 * @param cellLeft
 * @param usedStyle
 */
public void resolveCellLeftBorder(IStyle preColumnRight,IStyle columnLeft,IStyle preCellRight,IStyle cellLeft,IStyle usedStyle){
  resolveBorder(cellLeftBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(preCellRight,POSITION_RIGHT),new BorderStyleInfo(cellLeft,POSITION_LEFT),new BorderStyleInfo(preColumnRight,POSITION_RIGHT),new BorderStyleInfo(columnLeft,POSITION_LEFT)},new BorderStyleInfo(usedStyle,POSITION_LEFT));
}

Fixed version (ground truth):
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param preColumnRight
 * @param columnLeft
 * @param preCellRight
 * @param cellLeft
 * @param usedStyle
 */
public void resolveCellLeftBorder(IStyle preColumnRight,IStyle columnLeft,IStyle preCellRight,IStyle cellLeft,IStyle usedStyle){
  resolveBorder(cellLeftBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(preCellRight,POSITION_TRAIL),new BorderStyleInfo(cellLeft,POSITION_LEAD),new BorderStyleInfo(preColumnRight,POSITION_TRAIL),new BorderStyleInfo(columnLeft,POSITION_LEAD)},new BorderStyleInfo(usedStyle,POSITION_LEAD));
}
Program: 72167
Project: 72167
Buggy source:
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param tableLeft
 * @param columnLeft
 * @param cellLeft
 * @param usedStyle
 */
public void resolveTableLeftBorder(IStyle tableLeft,IStyle rowLeft,IStyle columnLeft,IStyle cellLeft,IStyle usedStyle){
  resolveBorder(tableLeftBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(cellLeft,POSITION_LEFT),new BorderStyleInfo(columnLeft,POSITION_LEFT),new BorderStyleInfo(rowLeft,POSITION_LEFT),new BorderStyleInfo(tableLeft,POSITION_LEFT)},new BorderStyleInfo(usedStyle,POSITION_LEFT));
}

Fixed version (ground truth):
/** 
 * The used style should be style of area which is writable, and the others are styles of content which is read-only.
 * @param tableLeft
 * @param columnLeft
 * @param cellLeft
 * @param usedStyle
 */
public void resolveTableLeftBorder(IStyle tableLeft,IStyle rowLeft,IStyle columnLeft,IStyle cellLeft,IStyle usedStyle){
  resolveBorder(tableLeftBorderCache,new BorderStyleInfo[]{new BorderStyleInfo(cellLeft,POSITION_LEAD),new BorderStyleInfo(columnLeft,POSITION_LEAD),new BorderStyleInfo(rowLeft,POSITION_LEAD),new BorderStyleInfo(tableLeft,POSITION_LEAD)},new BorderStyleInfo(usedStyle,POSITION_LEAD));
}
Program: 72168
Project: 72168
Buggy source:
public TableLayoutInfo(int[] colWidth){
  this.colWidth=colWidth;
  this.columnNumber=colWidth.length;
  this.xPositions=new int[columnNumber];
  this.tableWidth=0;
  boolean rtl=tableContent.getReportContent().getDesign().getReportDesign().isDirectionRTL();
  for (int i=0; i < columnNumber; i++) {
    if (rtl) {
      xPositions[i]=parent.getCurrentMaxContentWidth() - tableWidth - colWidth[i];
    }
 else     xPositions[i]=tableWidth;
    tableWidth+=colWidth[i];
  }
}

Fixed version (ground truth):
public TableLayoutInfo(int[] colWidth){
  this.colWidth=colWidth;
  this.columnNumber=colWidth.length;
  this.xPositions=new int[columnNumber];
  this.tableWidth=0;
  if (tableContent.isRTL()) {
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=parent.getCurrentMaxContentWidth() - tableWidth - colWidth[i];
      tableWidth+=colWidth[i];
    }
  }
 else {
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=tableWidth;
      tableWidth+=colWidth[i];
    }
  }
}
Program: 72171
Project: 72171
Buggy source:
public TableAreaLayout(ITableContent tableContent,TableLayoutInfo layoutInfo,int startCol,int endCol){
  this.tableContent=tableContent;
  this.layoutInfo=layoutInfo;
  this.startCol=startCol;
  this.endCol=endCol;
}

Fixed version (ground truth):
public TableAreaLayout(ITableContent tableContent,TableLayoutInfo layoutInfo,int startCol,int endCol){
  this.tableContent=tableContent;
  this.layoutInfo=layoutInfo;
  this.startCol=startCol;
  this.endCol=endCol;
  if (tableContent != null)   bcr.setRTL(tableContent.isRTL());
}
Program: 72172
Project: 72172
Buggy source:
public boolean addArea(AbstractArea area){
  CellArea cArea=(CellArea)area;
  root.addChild(area);
  cArea.setPosition(tbl.getXPos(cArea.getColumnID()),0);
  return true;
}

Fixed version (ground truth):
public boolean addArea(AbstractArea area){
  CellArea cArea=(CellArea)area;
  root.addChild(area);
  int columnID=cArea.getColumnID();
  int colSpan=cArea.getColSpan();
  if (colSpan > 1 && content.isRTL()) {
    columnID+=colSpan - 1;
  }
  cArea.setPosition(tbl.getXPos(columnID),0);
  return true;
}
Program: 72173
Project: 72173
Buggy source:
public TableAreaLayout(ITableContent tableContent,TableLayoutInfo layoutInfo,int startCol,int endCol){
  this.tableContent=tableContent;
  this.layoutInfo=layoutInfo;
  this.startCol=startCol;
  this.endCol=endCol;
}

Fixed version (ground truth):
public TableAreaLayout(ITableContent tableContent,TableLayoutInfo layoutInfo,int startCol,int endCol){
  this.tableContent=tableContent;
  this.layoutInfo=layoutInfo;
  this.startCol=startCol;
  this.endCol=endCol;
  if (tableContent != null)   bcr.setRTL(tableContent.isRTL());
}
Program: 72174
Project: 72174
Buggy source:
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent,ModuleHandle handle){
  List<URL> urls=getClassPathURLs();
  loadResourceFolderScriptLibs(handle,urls);
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent){
  List<URL> urls=getClassPathURLs();
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}
Program: 72175
Project: 72175
Buggy source:
/** 
 * Return the URLs of ScriptLib jars.
 * @return
 */
private static List<URL> getDefaultViewerScriptLibURLs(){
  List<URL> urls=new ArrayList<URL>();
  try {
    Bundle bundle=Platform.getBundle(VIEWER_NAMESPACE);
    Enumeration bundleFile=bundle.getEntryPaths(BIRT_SCRIPTLIB);
    while (bundleFile.hasMoreElements()) {
      String o=bundleFile.nextElement().toString();
      if (o.endsWith("String_Node_Str"))       urls.add(bundle.getResource(o));
    }
  }
 catch (  Exception e) {
  }
  return urls;
}

Fixed version (ground truth):
/** 
 * Return the URLs of ScriptLib jars.
 * @return
 */
private static List<URL> getDefaultViewerScriptLibURLs(){
  List<URL> urls=new ArrayList<URL>();
  try {
    Bundle bundle=Platform.getBundle(VIEWER_NAMESPACE);
    Enumeration bundleFile=bundle.getEntryPaths(BIRT_SCRIPTLIB);
    while (bundleFile.hasMoreElements()) {
      String o=bundleFile.nextElement().toString();
      if (o.endsWith("String_Node_Str"))       urls.add(bundle.getResource(o));
    }
    URL classes=bundle.getEntry(BIRT_CLASSES);
    if (classes != null) {
      urls.add(classes);
    }
  }
 catch (  Exception e) {
  }
  return urls;
}
Program: 72176
Project: 72176
Buggy source:
/** 
 * Builds the direction style.
 * @param styleBuffer The <code>StringBuffer</code> to which the result is output.
 * @param style The style object.
 * @author bidi_hcg
 */
public static void buildBidiDirection(StringBuffer styleBuffer,IStyle style){
  if (style != null) {
    String direction=style.getDirection();
    if (direction != null) {
      if (CSSConstants.CSS_RTL_VALUE.equals(direction))       buildProperty(styleBuffer,IStyle.CSS_DIRECTION_PROPERTY,IStyle.CSS_RTL_VALUE);
 else       if (CSSConstants.CSS_LTR_VALUE.equals(direction))       buildProperty(styleBuffer,IStyle.CSS_DIRECTION_PROPERTY,IStyle.CSS_LTR_VALUE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Builds the direction style.
 * @param styleBuffer The <code>StringBuffer</code> to which the result is output.
 * @param style The style object.
 * @author bidi_hcg
 */
public static void buildBidiDirection(StringBuffer styleBuffer,IStyle style){
  if (style != null) {
    String direction=style.getDirection();
    if (direction != null) {
      buildProperty(styleBuffer,IStyle.CSS_DIRECTION_PROPERTY,direction);
    }
  }
}
Program: 72177
Project: 72177
Buggy source:
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent){
  List<URL> urls=getClassPathURLs();
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent,ModuleHandle handle){
  List<URL> urls=getClassPathURLs();
  loadResourceFolderScriptLibs(handle,urls);
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}
Program: 72178
Project: 72178
Buggy source:
private List getProjectPath(IProject project){
  List retValue=new ArrayList();
  if (!hasJavaNature(project)) {
    return retValue;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IClasspathEntry[] classpathEntries=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (classpathEntries == null) {
      classpathEntries=fCurrJProject.readRawClasspath();
    }
  }
  if (classpathEntries != null) {
    retValue=getExistingEntries(classpathEntries);
  }
  return retValue;
}

Fixed version (ground truth):
private List getProjectPath(IProject project){
  List retValue=new ArrayList();
  if (!hasJavaNature(project)) {
    return retValue;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IClasspathEntry[] classpathEntries=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (classpathEntries == null) {
      classpathEntries=fCurrJProject.readRawClasspath();
    }
  }
  if (classpathEntries != null) {
    retValue=getExistingEntries(classpathEntries,project);
  }
  return retValue;
}
Program: 72179
Project: 72179
Buggy source:
private String getProjectOutClassPath(IProject project){
  if (!hasJavaNature(project)) {
    return null;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IPath path=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (path == null) {
      path=fCurrJProject.readOutputLocation();
      String curPath=path.toOSString();
      String directPath=project.getLocation().toOSString();
      int index=directPath.lastIndexOf(File.separator);
      String absPath=directPath.substring(0,index) + curPath;
      return absPath;
    }
  }
  return null;
}

Fixed version (ground truth):
private String getProjectOutClassPath(IProject project){
  if (!hasJavaNature(project)) {
    return null;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IPath path=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (path == null) {
      path=fCurrJProject.readOutputLocation();
      String absPath=getFullPath(path,project);
      return absPath;
    }
  }
  return null;
}
Program: 72180
Project: 72180
Buggy source:
private List getExistingEntries(IClasspathEntry[] classpathEntries){
  ArrayList newClassPath=new ArrayList();
  for (int i=0; i < classpathEntries.length; i++) {
    IClasspathEntry curr=classpathEntries[i];
    if (curr.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
      try {
        newClassPath.add(curr.getPath().toFile().toURL());
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  return newClassPath;
}

Fixed version (ground truth):
private List getExistingEntries(IClasspathEntry[] classpathEntries,IProject project){
  ArrayList newClassPath=new ArrayList();
  for (int i=0; i < classpathEntries.length; i++) {
    IClasspathEntry curr=classpathEntries[i];
    if (curr.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
      try {
        boolean inWorkSpace=true;
        IWorkspace space=ResourcesPlugin.getWorkspace();
        if (space == null || space.getRoot() == null) {
          inWorkSpace=false;
        }
        IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
        IPath path=curr.getPath();
        if (root.findMember(path) == null) {
          inWorkSpace=false;
        }
        if (inWorkSpace) {
          String absPath=getFullPath(path,root.findMember(path).getProject());
          URL url=new URL("String_Node_Str" + absPath);
          newClassPath.add(url);
        }
 else {
          newClassPath.add(curr.getPath().toFile().toURL());
        }
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  return newClassPath;
}
Program: 72181
Project: 72181
Buggy source:
private void addResultSetRelation(String pRsetId,String rowId,String queryId,String rsetId){
  int intRowId=Integer.parseInt(rowId);
  rsetIndex.addResultSet(queryId,pRsetId,intRowId,rsetId);
}

Fixed version (ground truth):
private void addResultSetRelation(String pRsetId,String rowId,String queryId,String rsetId){
  rsetIndex.addResultSet(queryId,pRsetId,rowId,rsetId);
}
Program: 72182
Project: 72182
Buggy source:
protected String getResultID(String pRsetId,String rowId,String queryId){
  int intRowId=Integer.parseInt(rowId);
  String resultSetId=rsetIndex.getResultSet(queryId,pRsetId,intRowId);
  return resultSetId;
}

Fixed version (ground truth):
protected String getResultID(String pRsetId,String rowId,String queryId){
  return rsetIndex.getResultSet(queryId,pRsetId,rowId);
}
Program: 72183
Project: 72183
Buggy source:
public String getResultSet(String query,String parent,int row){
  QueryResultSets rsets=queries.get(query);
  if (rsets != null) {
    String rset=rsets.getResultSet(parent,row);
    if (rset == null) {
      if (parent != null) {
        int charAt=parent.indexOf("String_Node_Str");
        if (charAt != -1) {
          String root=parent.substring(0,charAt);
          return rsets.getResultSet(root,row);
        }
      }
    }
    return rset;
  }
  return null;
}

Fixed version (ground truth):
public String getResultSet(String query,String parent,String row){
  QueryResultSets rsets=queries.get(query);
  if (rsets != null) {
    String rset=rsets.getResultSet(parent,row);
    if (rset == null) {
      if (parent != null) {
        int charAt=parent.indexOf("String_Node_Str");
        if (charAt != -1) {
          String root=parent.substring(0,charAt);
          return rsets.getResultSet(root,row);
        }
      }
    }
    return rset;
  }
  return null;
}
Program: 72184
Project: 72184
Buggy source:
public void addResultSet(String query,String parent,int row,String rset){
  QueryResultSets rsets=queries.get(query);
  if (rsets == null) {
    rsets=new QueryResultSets();
    queries.put(query,rsets);
  }
  rsets.addResultSet(parent,row,rset);
}

Fixed version (ground truth):
public void addResultSet(String query,String parent,String row,String rset){
  QueryResultSets rsets=queries.get(query);
  if (rsets == null) {
    rsets=new QueryResultSets();
    queries.put(query,rsets);
  }
  rsets.addResultSet(parent,row,rset);
}
Program: 72185
Project: 72185
Buggy source:
private void initializeClassLoader(){
  if (applicationClassLoader == null) {
    applicationClassLoader=new ApplicationClassLoader(engine,runnable);
    getScriptContext().getContext().setApplicationClassLoader(applicationClassLoader);
  }
}

Fixed version (ground truth):
private void initializeClassLoader(){
  if (applicationClassLoader == null) {
    applicationClassLoader=new ApplicationClassLoader(engine,runnable);
    getScriptContext().setApplicationClassLoader(applicationClassLoader);
  }
}
Program: 72186
Project: 72186
Buggy source:
/** 
 * Creates a new page.
 * @param page the PageArea specified from layout
 */
public void newPage(float pageWidth,float pageHeight,Color backgroundColor){
  currentPageNum++;
  imageInfos.clear();
  this.pageWidth=pageWidth;
  this.pageHeight=pageHeight;
  println("String_Node_Str");
  println("String_Node_Str" + currentPageNum + "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  drawBackgroundColor(backgroundColor,0,0,pageWidth,pageHeight);
}

Fixed version (ground truth):
/** 
 * Creates a new page.
 * @param page the PageArea specified from layout
 */
public void newPage(float pageWidth,float pageHeight,Color backgroundColor){
  currentPageNum++;
  imageInfos.clear();
  if (pageWidth > this.pageWidth) {
    this.pageWidth=pageWidth;
  }
  if (pageHeight > this.pageHeight) {
    this.pageHeight=pageHeight;
  }
  println("String_Node_Str");
  println("String_Node_Str" + currentPageNum + "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str");
  drawBackgroundColor(backgroundColor,0,0,pageWidth,pageHeight);
}
Program: 72187
Project: 72187
Buggy source:
public void run(){
  loadDesign();
}

Fixed version (ground truth):
public void run() throws EngineException {
  doValidateParameters();
  loadDesign();
}
Program: 72190
Project: 72190
Buggy source:
public boolean supportsNamedParameters() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,DataSourceMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  try {
    return dbMetadata.supportsNamedParameters();
  }
 catch (  SQLException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean supportsNamedParameters() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,DataSourceMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  return false;
}
Program: 72192
Project: 72192
Buggy source:
/** 
 * Returns if the specified translation is contained in the translation table.
 * @param trans a given <code>Translation</code>
 * @return <code>true</code> if the <code>Translation</code> iscontained in the translation talbe, return <code>false</code> otherwise.
 */
public boolean contains(Translation trans){
  return translations.contains(trans);
}

Fixed version (ground truth):
/** 
 * Returns if the specified translation is contained in the translation table.
 * @param trans a given <code>Translation</code>
 * @return <code>true</code> if the <code>Translation</code> is contained inthe translation talbe, return <code>false</code> otherwise.
 */
public boolean contains(Translation trans){
  return translations.contains(trans);
}
Program: 72193
Project: 72193
Buggy source:
/** 
 * Finds an embedded image by name.
 * @param imageName the embedded image name
 * @return the defined image that matches, or <code>null</code> if theimage name was not found in the embedded images.
 */
public EmbeddedImage findImage(String imageName){
  StructureDefn defn=(StructureDefn)MetaDataDictionary.getInstance().getStructure(EmbeddedImage.EMBEDDED_IMAGE_STRUCT);
  return (EmbeddedImage)StructureRefUtil.findStructure(this,defn,imageName);
}

Fixed version (ground truth):
/** 
 * Finds an embedded image by name.
 * @param imageName the embedded image name
 * @return the defined image that matches, or <code>null</code> if the imagename was not found in the embedded images.
 */
public EmbeddedImage findImage(String imageName){
  StructureDefn defn=(StructureDefn)MetaDataDictionary.getInstance().getStructure(EmbeddedImage.EMBEDDED_IMAGE_STRUCT);
  return (EmbeddedImage)StructureRefUtil.findStructure(this,defn,imageName);
}
Program: 72194
Project: 72194
Buggy source:
/** 
 * Returns the <code>URL</code> object if the file with <code>fileName</code> exists. This method takes the following search steps: <ul> <li>Search file taking <code>fileName</code> as absolute file name; <li>Search file taking <code>fileName</code> as relative file name and basing "base" property of module; <li>Search file with the file locator (<code>IResourceLocator</code>) in session. </ul>
 * @param fileName file name to search
 * @param fileType file type. The value should be one of: <ul> <li><code>IResourceLocator.IMAGE</code> <li><code>IResourceLocator.LIBRARY</code> <li><code>IResourceLocator.MESSAGEFILE</code> </ul> Any invalid value will be treated as <code>IResourceLocator.IMAGE</code>.
 * @return the <code>URL</code> object if the file with<code>fileName</code> is found, or null otherwise.
 */
public URL findResource(String fileName,int fileType){
  URL url=getSession().getResourceLocator().findResource((ModuleHandle)getHandle(this),fileName,fileType);
  return url;
}

Fixed version (ground truth):
/** 
 * Returns the <code>URL</code> object if the file with <code>fileName</code> exists. This method takes the following search steps: <ul> <li>Search file taking <code>fileName</code> as absolute file name; <li> Search file taking <code>fileName</code> as relative file name and basing "base" property of module; <li>Search file with the file locator (<code> IResourceLocator</code>) in session. </ul>
 * @param fileName file name to search
 * @param fileType file type. The value should be one of: <ul> <li><code>IResourceLocator.IMAGE</code> <li><code> IResourceLocator.LIBRARY</code> <li><code> IResourceLocator.MESSAGEFILE</code> </ul> Any invalid value will be treated as <code>IResourceLocator.IMAGE</code>.
 * @return the <code>URL</code> object if the file with<code>fileName</code> is found, or null otherwise.
 */
public URL findResource(String fileName,int fileType){
  URL url=getSession().getResourceLocator().findResource((ModuleHandle)getHandle(this),fileName,fileType);
  return url;
}
Program: 72195
Project: 72195
Buggy source:
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent){
  List<URL> urls=getClassPathURLs();
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @return
 */
public static ClassLoader getCustomScriptClassLoader(ClassLoader parent,ModuleHandle handle){
  List<URL> urls=getClassPathURLs();
  loadResourceFolderScriptLibs(handle,urls);
  if (urls.size() == 0)   return parent;
  return new URLClassLoader(urls.toArray(new URL[0]),parent);
}
Program: 72196
Project: 72196
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  expectedValue=new ArrayList();
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_subquery_on_group=false;
  this.PRE_add_filter=false;
  this.PRE_add_sort=false;
  this.PRE_change_oldbinding=false;
  this.PRE_add_group=false;
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  expectedValue=new ArrayList();
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_add_secondGroup=false;
  this.GEN_subquery_on_group=false;
  this.GEN_useDetail=true;
  this.GEN_make_empty=false;
  this.PRE_add_filter=false;
  this.PRE_add_sort=false;
  this.PRE_change_oldbinding=false;
  this.PRE_add_group=false;
  this.PRE_printGroupInfo=false;
}
Program: 72197
Project: 72197
Buggy source:
/** 
 * @param GEN_add_filter
 * @param GEN_add_group
 * @param qd
 * @throws BirtException
 */
private void _preBasicIV(QueryDefinition qd) throws BirtException {
  qd.setQueryResultsID(this.queryResultID);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  do {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
    this.testPrintln(abc + ri.getRowId());
  }
 while (ri.next());
  ri.close();
  myPreDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @param GEN_add_filter
 * @param GEN_add_group
 * @param qd
 * @throws BirtException
 */
private void _preBasicIV(QueryDefinition qd) throws BirtException {
  qd.setQueryResultsID(this.queryResultID);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  if (!ri.isEmpty()) {
    do {
      String abc="String_Node_Str";
      for (int i=0; i < rowExprName.length; i++)       abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
      for (int i=0; i < totalExprName.length; i++)       abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
      if (this.PRE_printGroupInfo)       this.testPrintln(abc + ri.getRowId() + "String_Node_Str"+ ri.getRowIndex()+ "String_Node_Str"+ ri.getStartingGroupLevel()+ "String_Node_Str"+ ri.getEndingGroupLevel());
 else       this.testPrintln(abc + ri.getRowId());
    }
 while (ri.next());
  }
  ri.close();
  myPreDataEngine.shutdown();
}
Program: 72199
Project: 72199
Buggy source:
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle rect=sep.getBounds();
  gc.setForeground(ColorConstants.darkGray);
  gc.drawLine(0,0,rect.width,0);
}

Fixed version (ground truth):
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle rect=sep.getBounds();
  gc.setForeground(ReportColorConstants.DarkGrayForground);
  gc.drawLine(0,0,rect.width,0);
}
Program: 72201
Project: 72201
Buggy source:
/** 
 * Get the foreground color.
 * @param handle The handle of design element.
 * @return fore ground color
 */
public int getForegroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.COLOR_PROP);
  int color=handle.getPropertyHandle(StyleHandle.COLOR_PROP).getIntValue();
  if (obj == null) {
    return 0x0;
  }
  return color;
}

Fixed version (ground truth):
/** 
 * Get the foreground color.
 * @param handle The handle of design element.
 * @return fore ground color
 */
public int getForegroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.COLOR_PROP);
  int color=handle.getPropertyHandle(StyleHandle.COLOR_PROP).getIntValue();
  if (obj == null) {
    return SWT.COLOR_LIST_FOREGROUND;
  }
  return color;
}