nus-yam/ex-repair huggingface dataset:
Program: 72096
Project: 72096
Buggy source:
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return true;
  }
  try {
{
      if (!maxRowsUpToDate) {
        callStat.setMaxRows(maxrows);
        maxRowsUpToDate=true;
      }
      this.registerOutputParameter();
      boolean execute=callStat.execute();
      this.populateOutputParamResultSet();
      this.isExecuted=true;
      return execute;
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  try {
{
      if (!maxRowsUpToDate) {
        callStat.setMaxRows(maxrows);
        maxRowsUpToDate=true;
      }
      this.registerOutputParameter();
      boolean execute=callStat.execute();
      this.populateOutputParamResultSet();
      this.isExecuted=true;
      return execute;
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}
Program: 72097
Project: 72097
Buggy source:
/** 
 * Returns the real path based on working folder. If file path is an absolute path, return it directly. Else, return the absolute path based on working folder.
 * @param filePath
 * @param request
 * @return
 */
public static String getRealPathOnWorkingFolder(String filePath,HttpServletRequest request){
  if (!isRelativePath(filePath))   return filePath;
  if (isRelativePath(workingFolder)) {
    filePath=getRealPath(workingFolder + "String_Node_Str" + filePath,request.getSession().getServletContext());
  }
 else {
    filePath=workingFolder + File.separator + filePath;
  }
  return filePath;
}

Fixed version (ground truth):
/** 
 * Returns the real path based on working folder. If file path is an absolute path, return it directly. Else, return the absolute path based on working folder.
 * @param filePath
 * @param request
 * @return
 */
public static String getRealPathOnWorkingFolder(String filePath,HttpServletRequest request){
  if (filePath == null || filePath.length() == 0) {
    return filePath;
  }
  if (!isRelativePath(filePath))   return filePath;
  if (isRelativePath(workingFolder)) {
    filePath=getRealPath(workingFolder + "String_Node_Str" + filePath,request.getSession().getServletContext());
  }
 else {
    filePath=workingFolder + File.separator + filePath;
  }
  return filePath;
}
Program: 72098
Project: 72098
Buggy source:
/** 
 * submit current line to parent true if succeed
 * @return
 */
protected void closeLayout(){
  int size=contextList.size();
  if (size == 1) {
    currentContext=contextList.removeFirst();
    currentContext.root.setHeight(Math.max(currentContext.root.getHeight(),lineHeight));
    if (currentContext.root.getChildrenCount() > 0) {
      align(currentContext,false);
      boolean succeed=parent.addArea(currentContext.root,parent.contextList.size() - 1);
      if (succeed) {
        return;
      }
 else {
        parent.autoPageBreak();
        parent.addToRoot(currentContext.root,parent.contextList.size() - 1);
        if (isInBlockStacking) {
          parent.flushFinishedPage();
        }
      }
    }
  }
 else {
    for (int i=0; i < size; i++) {
      currentContext=contextList.removeFirst();
      if (currentContext.root.getChildrenCount() > 0) {
        parent.addToRoot(currentContext.root,i);
      }
      if (isInBlockStacking) {
        parent.flushFinishedPage();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * submit current line to parent true if succeed
 * @return
 */
protected void closeLayout(){
  int size=contextList.size();
  if (size == 1) {
    currentContext=contextList.removeFirst();
    currentContext.root.setHeight(Math.max(currentContext.root.getHeight(),lineHeight));
    if (currentContext.root.getChildrenCount() > 0) {
      align(currentContext,false);
      boolean succeed=parent.addArea(currentContext.root,parent.contextList.size() - 1);
      if (succeed) {
        return;
      }
 else {
        parent.autoPageBreak();
        parent.addToRoot(currentContext.root,parent.contextList.size() - 1);
        if (isInBlockStacking) {
          parent.flushFinishedPage();
        }
      }
    }
  }
 else {
    for (int i=0; i < size; i++) {
      currentContext=contextList.removeFirst();
      if (currentContext.root.getChildrenCount() > 0) {
        parent.addToRoot(currentContext.root,i);
      }
    }
    if (parent.isInBlockStacking) {
      parent.flushFinishedPage();
    }
  }
}
Program: 72099
Project: 72099
Buggy source:
public LineLayout(LayoutEngineContext context,ContainerLayout parent){
  super(context,parent,null);
}

Fixed version (ground truth):
public LineLayout(LayoutEngineContext context,ContainerLayout parent){
  super(context,parent,null);
  isInBlockStacking=false;
}
Program: 72100
Project: 72100
Buggy source:
protected void initialize(){
  currentContext=new ContainerContext();
  contextList.add(currentContext);
  createRoot();
  currentContext.maxAvaWidth=parent.getCurrentMaxContentWidth();
  currentContext.maxAvaHeight=parent.getCurrentMaxContentHeight();
  currentContext.root.setWidth(parent.getCurrentMaxContentWidth());
  lineHeight=((BlockStackingLayout)parent).getLineHeight();
  if (parent.content != null) {
    if (CSSConstants.CSS_RTL_VALUE.equals(parent.content.getComputedStyle().getDirection()))     baseLevel=Bidi.DIRECTION_RIGHT_TO_LEFT;
  }
}

Fixed version (ground truth):
protected void initialize(){
  int currentIP=0;
  if (contextList.size() > 0) {
    currentIP=contextList.get(contextList.size() - 1).currentIP;
  }
  currentContext=new ContainerContext();
  currentContext.currentIP=currentIP;
  contextList.add(currentContext);
  createRoot();
  currentContext.maxAvaWidth=parent.getCurrentMaxContentWidth();
  currentContext.maxAvaHeight=parent.getCurrentMaxContentHeight();
  currentContext.root.setWidth(parent.getCurrentMaxContentWidth());
  lineHeight=((BlockStackingLayout)parent).getLineHeight();
  if (parent.content != null) {
    if (CSSConstants.CSS_RTL_VALUE.equals(parent.content.getComputedStyle().getDirection()))     baseLevel=Bidi.DIRECTION_RIGHT_TO_LEFT;
  }
}
Program: 72101
Project: 72101
Buggy source:
public void outputPage(IPageContent page){
  context.emitter.outputPage(page);
  context.pageNumber++;
}

Fixed version (ground truth):
public void outputPage(IPageContent page){
  context.emitter.outputPage(page);
}
Program: 72102
Project: 72102
Buggy source:
protected IPageContent createPageContent(){
  MasterPageDesign pageDesign=getMasterPage(report);
  return ReportExecutorUtil.executeMasterPage(reportExecutor,context.pageNumber,pageDesign);
}

Fixed version (ground truth):
protected IPageContent createPageContent(){
  MasterPageDesign pageDesign=getMasterPage(report);
  return ReportExecutorUtil.executeMasterPage(reportExecutor,context.pageNumber++,pageDesign);
}
Program: 72103
Project: 72103
Buggy source:
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  if (currentContext.root != null) {
    if (unresolvedRow != null) {
      TableContext tc=(TableContext)(tbl.currentContext);
      tc.layout.setUnresolvedRow(unresolvedRow);
    }
    tbl.updateRow((RowArea)currentContext.root,specifiedHeight,index);
    if (finished || !isRowEmpty(currentContext)) {
      tbl.addRow((RowArea)currentContext.root,index);
      parent.addToRoot(currentContext.root,index);
    }
    if (!finished && unresolvedRow == null) {
      TableContext tc=(TableContext)(tbl.contextList.get(index));
      unresolvedRow=tc.layout.getUnresolvedRow();
    }
  }
}

Fixed version (ground truth):
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  if (currentContext.root != null) {
    boolean added=false;
    if (unresolvedRow != null) {
      TableContext tc=(TableContext)(tbl.contextList.get(index));
      tc.layout.setUnresolvedRow(unresolvedRow);
    }
    tbl.updateRow((RowArea)currentContext.root,specifiedHeight,index);
    if (finished || !isRowEmpty(currentContext)) {
      tbl.addRow((RowArea)currentContext.root,index);
      parent.addToRoot(currentContext.root,index);
      added=true;
    }
    if (!finished && unresolvedRow == null) {
      TableContext tc=(TableContext)(tbl.contextList.get(index));
      if (added) {
        unresolvedRow=tc.layout.getUnresolvedRow();
      }
 else {
        unresolvedRow=tc.layout.getUnresolvedRow((RowArea)currentContext.root);
      }
    }
  }
}
Program: 72105
Project: 72105
Buggy source:
public Row getUnresolvedRow(){
  return (Row)rows.getCurrent();
}

Fixed version (ground truth):
public Row getUnresolvedRow(RowArea row){
  addRow(row);
  Row unResolvedRow=(Row)rows.getCurrent();
  rows.removeLast();
  return unResolvedRow;
}
Program: 72106
Project: 72106
Buggy source:
protected void repeatHeader(){
  if (bandStatus == IBandContent.BAND_GROUP_HEADER) {
    return;
  }
  if (!((IGroupContent)content).isHeaderRepeat()) {
    return;
  }
  IBandContent header=((IGroupContent)content).getHeader();
  if (header == null || header.getChildren().isEmpty()) {
    return;
  }
  TableRegionLayout rLayout=tableLM.getTableRegionLayout();
  rLayout.initialize(header);
  rLayout.layout();
  TableArea tableRegion=(TableArea)header.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getAllocatedHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      addArea(area);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (bandStatus == IBandContent.BAND_GROUP_HEADER) {
    return;
  }
  if (!((IGroupContent)content).isHeaderRepeat()) {
    return;
  }
  IBandContent header=((IGroupContent)content).getHeader();
  if (header == null || header.getChildren().isEmpty()) {
    return;
  }
  TableRegionLayout rLayout=tableLM.getTableRegionLayout();
  rLayout.initialize(header);
  rLayout.layout();
  TableArea tableRegion=(TableArea)header.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getAllocatedHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    TableContext tableContext=(TableContext)tableLM.contextList.getLast();
    while (iter.hasNext()) {
      ContainerArea area=(ContainerArea)iter.next();
      Iterator rowIter=area.getChildren();
      while (rowIter.hasNext()) {
        AbstractArea row=(AbstractArea)rowIter.next();
        if (row instanceof RowArea) {
          tableContext.layout.addRow((RowArea)row);
        }
      }
    }
    iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      addArea(area);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}
Program: 72107
Project: 72107
Buggy source:
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  TableContext tableContext=(TableContext)currentContext;
  int borderHeight=0;
  if (tableContext.layout != null) {
    int height=tableContext.layout.resolveAll();
    if (0 != height) {
      currentContext.currentBP=currentContext.currentBP + height;
    }
    borderHeight=tableContext.layout.resolveBottomBorder();
    tableContext.layout.remove((TableArea)currentContext.root);
  }
  currentContext.root.setHeight(currentContext.currentBP + getOffsetY() + borderHeight);
  parent.addToRoot(currentContext.root,index);
}

Fixed version (ground truth):
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  if (currentContext.root == null || currentContext.root.getChildrenCount() == 0) {
    return;
  }
  TableContext tableContext=(TableContext)currentContext;
  int borderHeight=0;
  if (tableContext.layout != null) {
    int height=tableContext.layout.resolveAll();
    if (0 != height) {
      currentContext.currentBP=currentContext.currentBP + height;
    }
    borderHeight=tableContext.layout.resolveBottomBorder();
    tableContext.layout.remove((TableArea)currentContext.root);
  }
  currentContext.root.setHeight(currentContext.currentBP + getOffsetY() + borderHeight);
  parent.addToRoot(currentContext.root,index);
}
Program: 72108
Project: 72108
Buggy source:
public boolean supportDataType(int dataType){
  if (dataType == DataType.ANY_TYPE || dataType == DataType.UNKNOWN_TYPE)   return true;
  for (int i=0; i < supportedDataTypes.length; i++) {
    if (supportedDataTypes[i] == dataType) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean supportDataType(int dataType){
  if (dataType == DataType.UNKNOWN_TYPE)   return true;
  for (int i=0; i < supportedDataTypes.length; i++) {
    if (supportedDataTypes[i] == DataType.ANY_TYPE || supportedDataTypes[i] == dataType) {
      return true;
    }
  }
  return false;
}
Program: 72109
Project: 72109
Buggy source:
protected boolean valid(int row,int col){
  if (col >= getColumnCount() || row > getColumnSize(col)) {
    return false;
  }
  int start=((Integer)colrow.get(new Integer(col))).intValue();
  return (row >= start && row < getColumnSize(col) && col < getColumnCount());
}

Fixed version (ground truth):
protected boolean valid(int row,int col){
  if (col >= getColumnCount() || row > getColumnSize(col)) {
    return false;
  }
  int start=((Integer)columnId2StartLine.get(new Integer(col))).intValue();
  return (row >= start && row < getColumnSize(col) && col < getColumnCount());
}
Program: 72110
Project: 72110
Buggy source:
public void addData(int col,Object data){
  List column=(List)columns.get(col);
  column.add(data);
  if (data instanceof Data) {
    BookmarkDef bookmark=((Data)data).getBookmark();
    if (null == bookmark) {
      return;
    }
    int rowNo=((Integer)colrow.get(new Integer(col))).intValue() + getColumnSize(col);
    bookmark.setColumnNo(col + 1);
    bookmark.setRowNo(rowNo);
    bookmarks.add(bookmark);
  }
}

Fixed version (ground truth):
public void addData(int col,Object data){
  if ((getColumnSize(col) > height) || (col >= getColumnCount())) {
    emitter.outputSheet();
    clearCachedSheetData();
  }
  List column=(List)columns.get(col);
  column.add(data);
  if (data instanceof Data) {
    BookmarkDef bookmark=((Data)data).getBookmark();
    if (null == bookmark) {
      return;
    }
    int rowNo=((Integer)columnId2StartLine.get(new Integer(col))).intValue() + getColumnSize(col);
    bookmark.setColumnNo(col + 1);
    bookmark.setRowNo(rowNo);
    bookmarks.add(bookmark);
  }
}
Program: 72111
Project: 72111
Buggy source:
public void insertColumns(int col,int size){
  if (size == 0) {
    return;
  }
  int c_width=getColumnCount();
  Integer collen=new Integer(getColumnSize(col));
  int m_start=col + 1;
  int m_size=c_width - m_start;
  m_size=Math.max(0,m_size);
  Object[] mcol=new Object[m_size];
  Map temp=new HashMap();
  for (int i=m_start, j=0; j < m_size; i++, j++) {
    Integer column=new Integer(i);
    Object row=colrow.get(column);
    int npos=i + size;
    if (npos < width) {
      temp.put(new Integer(npos),row);
      mcol[j]=columns.get(m_start);
    }
    columns.remove(m_start);
  }
  colrow.putAll(temp);
  for (int i=m_start; i <= col + size; i++) {
    if (i < width) {
      if (i > columns.size()) {
        columns.add(new ArrayList());
        colrow.put(new Integer(columns.size() - 1),collen);
      }
 else {
        columns.add(i,new ArrayList());
        colrow.put(new Integer(i),collen);
      }
    }
  }
  for (int i=0; i < mcol.length; i++) {
    if (mcol[i] == null) {
      continue;
    }
    columns.add(mcol[i]);
  }
}

Fixed version (ground truth):
public void insertColumns(int col,int size){
  if (size == 0) {
    return;
  }
  int columnCount=getColumnCount();
  int m_start=col + 1;
  int m_size=columnCount - m_start;
  m_size=Math.max(0,m_size);
  ArrayList[] mcol=new ArrayList[m_size];
  Map<Integer,Integer> temp=new HashMap<Integer,Integer>();
  for (int i=m_start, j=0; j < m_size; i++, j++) {
    Integer column=new Integer(i);
    Integer row=columnId2StartLine.get(column);
    int npos=i + size;
    if (npos < width) {
      temp.put(new Integer(npos),row);
      mcol[j]=columns.get(m_start);
    }
    columns.remove(m_start);
  }
  columnId2StartLine.putAll(temp);
  Integer rowCount=new Integer(getColumnSize(col));
  for (int i=m_start; i <= col + size; i++) {
    if (i < width) {
      if (i > columns.size()) {
        columns.add(new ArrayList());
        columnId2StartLine.put(new Integer(columns.size() - 1),rowCount);
      }
 else {
        columns.add(i,new ArrayList());
        columnId2StartLine.put(new Integer(i),rowCount);
      }
    }
  }
  for (int i=0; i < mcol.length; i++) {
    if (mcol[i] == null) {
      continue;
    }
    columns.add(mcol[i]);
  }
}
Program: 72112
Project: 72112
Buggy source:
public int getColumnSize(int column){
  if (column < getColumnCount()) {
    return ((Integer)colrow.get(new Integer(column))).intValue() + ((List)columns.get(column)).size();
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
public int getColumnSize(int column){
  if (column < getColumnCount()) {
    return ((Integer)columnId2StartLine.get(new Integer(column))).intValue() + ((List)columns.get(column)).size();
  }
 else {
    return -1;
  }
}
Program: 72113
Project: 72113
Buggy source:
public ArrayList getBookmarks(){
  return bookmarks;
}

Fixed version (ground truth):
public List<BookmarkDef> getBookmarks(){
  return bookmarks;
}
Program: 72114
Project: 72114
Buggy source:
public DataCache(int width){
  Integer start=new Integer(0);
  columns.add(new ArrayList());
  colrow.put(start,start);
  this.width=width;
}

Fixed version (ground truth):
public DataCache(int width,int height,ExcelEmitter emitter){
  columns.add(new ArrayList<Data>());
  columnId2StartLine.put(0,0);
  this.width=width;
  this.height=height;
  this.emitter=emitter;
}
Program: 72115
Project: 72115
Buggy source:
public Object getData(int col,int row){
  if (!valid(row,col)) {
    return null;
  }
 else {
    int start=((Integer)colrow.get(new Integer(col))).intValue();
    List data=(List)columns.get(col);
    if (data.size() > (row - start)) {
      return data.get(row - start);
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
public Object getData(int col,int row){
  if (!valid(row,col)) {
    return null;
  }
 else {
    int start=((Integer)columnId2StartLine.get(new Integer(col))).intValue();
    List data=(List)columns.get(col);
    if (data.size() > (row - start)) {
      return data.get(row - start);
    }
 else {
      return null;
    }
  }
}
Program: 72116
Project: 72116
Buggy source:
public void end(IReportContent report){
  engine.complete();
  boolean isRTLSheet=false;
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  ExcelWriter writer=new ExcelWriter(out,context,isRTLSheet);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  startSheet(writer);
  int count=0;
  while (count < engine.getRowCount()) {
    if ((count % (engine.MAX_ROW + 1)) == 0 && count != 0) {
      endSheet(writer);
      startSheet(writer);
    }
    outputData(engine.getRow(count),writer);
    count++;
  }
  endSheet(writer);
  writer.close(true);
  sheetIndex=1;
}

Fixed version (ground truth):
public void end(IReportContent report){
  engine.complete();
  boolean isRTLSheet=false;
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  ExcelWriter writer=new ExcelWriter(out,context,isRTLSheet);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  int count=0;
  if (tempWriter != null) {
    tempWriter.close(false);
    File file=new File(tempfilePath);
    writer.insertSheet(file);
    file.delete();
  }
  if (engine.getRowCount() != 0) {
    startSheet(writer);
    while (count < engine.getRowCount()) {
      outputData(engine.getRow(count),writer);
      count++;
    }
    endSheet(writer);
  }
  writer.close(true);
  sheetIndex=1;
}
Program: 72117
Project: 72117
Buggy source:
public void start(IReportContent report){
  setupRenderOptions();
  IStyle style=report.getRoot().getComputedStyle();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  engine=new ExcelLayoutEngine(new PageDef(master,style),context);
}

Fixed version (ground truth):
public void start(IReportContent report){
  setupRenderOptions();
  IStyle style=report.getRoot().getComputedStyle();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  engine=new ExcelLayoutEngine(new PageDef(master,style),context,this);
  tempfilePath=System.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ Thread.currentThread().getId();
}
Program: 72118
Project: 72118
Buggy source:
private void initalize(PageDef page){
  axis=new AxisProcessor();
  axis.addCoordinate(page.contentwidth);
  setCacheSize();
  Rule rule=new Rule(0,page.contentwidth);
  cache=new DataCache(MAX_COLUMN);
  engine=new StyleEngine(this);
  containers.push(createContainer(rule,page.style));
}

Fixed version (ground truth):
private void initalize(PageDef page){
  axis=new AxisProcessor();
  axis.addCoordinate(page.contentwidth);
  setCacheSize();
  Rule rule=new Rule(0,page.contentwidth);
  cache=new DataCache(MAX_COLUMN,MAX_ROW,emitter);
  engine=new StyleEngine(this);
  containers.push(createContainer(rule,page.style));
}
Program: 72119
Project: 72119
Buggy source:
public ExcelLayoutEngine(PageDef page,ExcelContext context){
  this.context=context;
  initalize(page);
}

Fixed version (ground truth):
public ExcelLayoutEngine(PageDef page,ExcelContext context,ExcelEmitter emitter){
  this.context=context;
  this.emitter=emitter;
  initalize(page);
}
Program: 72120
Project: 72120
Buggy source:
public void addTable(TableInfo table,IStyle style){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int[] npos=new int[table.getColumnCount() + 1];
  npos[0]=start;
  for (int i=1; i <= table.getColumnCount(); i++) {
    npos[i]=npos[i - 1] + table.getColumnWidth(i - 1);
  }
  int[] scale=axis.getRange(start,rule.getEnd());
  for (int i=0; i < scale.length - 1; i++) {
    int sp=scale[i];
    int se=scale[i + 1];
    int[] range=inRange(sp,se,npos);
    if (range.length > 0) {
      int pos=axis.getCoordinateIndex(sp);
      cache.insertColumns(pos,range.length);
      for (int j=0; j < range.length; j++) {
        axis.addCoordinate(range[j]);
      }
    }
  }
  XlsContainer container=createContainer(rule,style);
  XlsTable tcontainer=new XlsTable(table,container);
  addContainer(tcontainer);
  tables.push(tcontainer);
}

Fixed version (ground truth):
public void addTable(TableInfo table,IStyle style){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int[] npos=new int[table.getColumnCount() + 1];
  npos[0]=start;
  for (int i=1; i <= table.getColumnCount(); i++) {
    npos[i]=npos[i - 1] + table.getColumnWidth(i - 1);
  }
  int[] scale=axis.getRange(start,rule.getEnd());
  for (int i=0; i < scale.length - 1; i++) {
    int startPosition=scale[i];
    int endPostion=scale[i + 1];
    int[] range=inRange(startPosition,endPostion,npos);
    if (range.length > 0) {
      int pos=axis.getCoordinateIndex(startPosition);
      cache.insertColumns(pos,range.length);
      for (int j=0; j < range.length; j++) {
        axis.addCoordinate(range[j]);
      }
    }
  }
  XlsContainer container=createContainer(rule,style);
  XlsTable tcontainer=new XlsTable(table,container);
  addContainer(tcontainer);
  tables.push(tcontainer);
}
Program: 72121
Project: 72121
Buggy source:
public ArrayList getNamesRefer(){
  return cache.getBookmarks();
}

Fixed version (ground truth):
public List<BookmarkDef> getNamesRefer(){
  return cache.getBookmarks();
}
Program: 72123
Project: 72123
Buggy source:
protected void resolveTotalPage(IContentEmitter emitter){
  IContent con=context.getUnresolvedContent();
  if (!(con instanceof IAutoTextContent)) {
    return;
  }
  IAutoTextContent totalPageContent=(IAutoTextContent)con;
  if (null != totalPageContent) {
    NumberFormatter nf=new NumberFormatter();
    String patternStr=totalPageContent.getComputedStyle().getNumberFormat();
    nf.applyPattern(patternStr);
    long totalPageCount=context.totalPage > 0 ? context.totalPage : context.pageCount;
    totalPageContent.setText(nf.format(totalPageCount));
    AbstractArea totalPageArea=null;
    ChunkGenerator cg=new ChunkGenerator(context.getFontManager(),totalPageContent,true,true);
    if (cg.hasMore()) {
      Chunk c=cg.getNext();
      Dimension d=new Dimension((int)(c.getFontInfo().getWordWidth(c.getText()) * PDFConstants.LAYOUT_TO_PDF_RATIO),(int)(c.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO));
      totalPageArea=(AbstractArea)AreaFactory.createTextArea(totalPageContent,c.getFontInfo(),false);
      totalPageArea.setWidth(Math.min(context.getMaxWidth(),d.getWidth()));
      totalPageArea.setHeight(Math.min(context.getMaxHeight(),d.getHeight()));
    }
    totalPageContent.setExtension(IContent.LAYOUT_EXTENSION,totalPageArea);
    emitter.startAutoText(totalPageContent);
  }
}

Fixed version (ground truth):
protected void resolveTotalPage(IContentEmitter emitter){
  IContent con=context.getUnresolvedContent();
  if (!(con instanceof IAutoTextContent)) {
    return;
  }
  IAutoTextContent totalPageContent=(IAutoTextContent)con;
  if (null != totalPageContent) {
    NumberFormatter nf=new NumberFormatter();
    String patternStr=totalPageContent.getComputedStyle().getNumberFormat();
    nf.applyPattern(patternStr);
    long totalPageCount=0;
    if (context.autoPageBreak) {
      totalPageCount=context.pageCount;
    }
 else {
      totalPageCount=context.totalPage > 0 ? context.totalPage : context.pageCount;
    }
    totalPageContent.setText(nf.format(totalPageCount));
    AbstractArea totalPageArea=null;
    ChunkGenerator cg=new ChunkGenerator(context.getFontManager(),totalPageContent,true,true);
    if (cg.hasMore()) {
      Chunk c=cg.getNext();
      Dimension d=new Dimension((int)(c.getFontInfo().getWordWidth(c.getText()) * PDFConstants.LAYOUT_TO_PDF_RATIO),(int)(c.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO));
      totalPageArea=(AbstractArea)AreaFactory.createTextArea(totalPageContent,c.getFontInfo(),false);
      totalPageArea.setWidth(Math.min(context.getMaxWidth(),d.getWidth()));
      totalPageArea.setHeight(Math.min(context.getMaxHeight(),d.getHeight()));
    }
    totalPageContent.setExtension(IContent.LAYOUT_EXTENSION,totalPageArea);
    emitter.startAutoText(totalPageContent);
  }
}
Program: 72124
Project: 72124
Buggy source:
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  IContent row=generateCaptionRow(tableContent.getCaption());
  rLayout.initialize(row);
  rLayout.layout();
  TableArea tableRegion=(TableArea)row.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  IContent row=generateCaptionRow(tableContent.getCaption());
  rLayout.initialize(row);
  rLayout.layout();
  TableArea tableRegion=(TableArea)row.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea);
    }
  }
  row.setExtension(IContent.LAYOUT_EXTENSION,null);
  regionLayout=null;
}
Program: 72125
Project: 72125
Buggy source:
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper){
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0) {
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k],true);
      paramList.add(paramDefn);
    }
  }
  IParameterDefn[] params=new IParameterDefn[paramList.size()];
  paramList.toArray(params);
  aggrWrapper.setParameterDefn(params);
}

Fixed version (ground truth):
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper) throws DataException {
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0 && paramFlags != null) {
    if (paramInfos.length != paramFlags.length)     throw new DataException(ResourceConstants.INCONSISTENT_AGGREGATION_ARGUMENT_DEFINITION);
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k],true);
      paramList.add(paramDefn);
    }
  }
  IParameterDefn[] params=new IParameterDefn[paramList.size()];
  paramList.toArray(params);
  aggrWrapper.setParameterDefn(params);
}
Program: 72126
Project: 72126
Buggy source:
/** 
 * @param subElems
 * @throws DataException
 */
private void populateDeprecatedAggregations(IConfigurationElement[] subElems) throws DataException {
  if (subElems == null)   return;
  for (int j=0; j < subElems.length; j++) {
    try {
      IAggregation aggrFunc=(IAggregation)subElems[j].createExecutableExtension(ATTRIBUTE_AGGREGATION_CLASS);
      String name=aggrFunc.getName().toUpperCase();
      AggrFunctionWrapper aggrWrapper=new AggrFunctionWrapper(aggrFunc);
      populateExtendedAggrInfo(name,aggrFunc,subElems[j],aggrWrapper);
      if (aggrMap.put(name,aggrWrapper) != null)       throw new DataException(ResourceConstants.DUPLICATE_AGGREGATION_NAME,name);
      allAggrNames.add(name);
    }
 catch (    FrameworkException exception) {
    }
  }
}

Fixed version (ground truth):
/** 
 * @param subElems
 * @throws DataException
 */
private void populateDeprecatedAggregations(IConfigurationElement[] subElems) throws DataException {
  if (subElems == null)   return;
  for (int j=0; j < subElems.length; j++) {
    try {
      IAggregation aggrFunc=(IAggregation)subElems[j].createExecutableExtension(ATTRIBUTE_AGGREGATION_CLASS);
      String name=aggrFunc.getName().toUpperCase();
      AggrFunctionWrapper aggrWrapper=new AggrFunctionWrapper(aggrFunc);
      populateExtendedAggrInfo(name,aggrFunc,subElems[j],aggrWrapper);
      if (aggrMap.put(name,aggrWrapper) != null)       throw new DataException(ResourceConstants.DUPLICATE_AGGREGATION_NAME,name);
      allAggrNames.add(name);
    }
 catch (    Exception e) {
      logger.logp(Level.WARNING,AggrFunctionWrapper.class.getName(),"String_Node_Str","String_Node_Str",e);
    }
  }
}
Program: 72127
Project: 72127
Buggy source:
public IModelEventProcessor getModelProcessor(){
  return new DesignerOutlineEventProcessor(this);
}

Fixed version (ground truth):
public IModelEventProcessor getModelProcessor(){
  return new DesignerOutlineEventProcessor(this){
    @Override public void clear(){
      super.clear();
      if (isDispose()) {
        return;
      }
      getTreeViewer().refresh();
    }
  }
;
}
Program: 72128
Project: 72128
Buggy source:
public Object getAdapter(Class key){
  if (key == IModelEventProcessor.class) {
    return new GraphicsViewModelEventProcessor(this){
      public void clear(){
        super.clear();
        SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getOldEditorModel());
        Object obj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getCurrentEditorModel();
        if (obj instanceof DesignElementHandle && ((DesignElementHandle)obj).getContainer() != null) {
          c=new SetCurrentEditModelCommand(obj);
        }
        c.execute();
      }
    }
;
  }
  return super.getAdapter(key);
}

Fixed version (ground truth):
public Object getAdapter(Class key){
  if (key == IModelEventProcessor.class) {
    return new GraphicsViewModelEventProcessor(this){
      public void clear(){
        Object oldObj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getOldEditorModel();
        SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(oldObj);
        Object obj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getCurrentEditorModel();
        if (obj instanceof DesignElementHandle && ((DesignElementHandle)obj).getContainer() != null) {
          c=new SetCurrentEditModelCommand(obj);
        }
 else         if (oldObj instanceof DesignElementHandle && ((DesignElementHandle)oldObj).getContainer() == null) {
          c=new SetCurrentEditModelCommand(null);
        }
        c.execute();
      }
    }
;
  }
  return super.getAdapter(key);
}
Program: 72129
Project: 72129
Buggy source:
public void clear(){
  super.clear();
  SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getOldEditorModel());
  Object obj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getCurrentEditorModel();
  if (obj instanceof DesignElementHandle && ((DesignElementHandle)obj).getContainer() != null) {
    c=new SetCurrentEditModelCommand(obj);
  }
  c.execute();
}

Fixed version (ground truth):
public void clear(){
  Object oldObj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getOldEditorModel();
  SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(oldObj);
  Object obj=HandleAdapterFactory.getInstance().getLibraryHandleAdapter().getCurrentEditorModel();
  if (obj instanceof DesignElementHandle && ((DesignElementHandle)obj).getContainer() != null) {
    c=new SetCurrentEditModelCommand(obj);
  }
 else   if (oldObj instanceof DesignElementHandle && ((DesignElementHandle)oldObj).getContainer() == null) {
    c=new SetCurrentEditModelCommand(null);
  }
  c.execute();
}
Program: 72130
Project: 72130
Buggy source:
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  PageArea page=(PageArea)currentContext.root;
  int overFlowType=context.getPageOverflow();
  if (overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE) {
    float scale=calculatePageScale(currentContext,page);
    if (1f == scale) {
      ((PageContext)currentContext).pageContent.setExtension(IContent.LAYOUT_EXTENSION,page);
      return;
    }
    page.setScale(scale);
    updatePageDimension(scale,page);
  }
 else   if (overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE) {
    updatePageDimension(page);
  }
  ((PageContext)currentContext).pageContent.setExtension(IContent.LAYOUT_EXTENSION,page);
  outputPage(((PageContext)currentContext).pageContent);
}

Fixed version (ground truth):
protected void closeLayout(ContainerContext currentContext,int index,boolean finished){
  PageArea page=(PageArea)currentContext.root;
  int overFlowType=context.getPageOverflow();
  if (overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE) {
    float scale=calculatePageScale(currentContext,page);
    if (1f == scale) {
      ((PageContext)currentContext).pageContent.setExtension(IContent.LAYOUT_EXTENSION,page);
      outputPage(((PageContext)currentContext).pageContent);
      return;
    }
    page.setScale(scale);
    updatePageDimension(scale,page);
  }
 else   if (overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE) {
    updatePageDimension(page);
  }
  ((PageContext)currentContext).pageContent.setExtension(IContent.LAYOUT_EXTENSION,page);
  outputPage(((PageContext)currentContext).pageContent);
}
Program: 72132
Project: 72132
Buggy source:
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  IContent row=generateCaptionRow(tableContent.getCaption());
  rLayout.initialize(row);
  rLayout.layout();
  TableArea tableRegion=(TableArea)content.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  IContent row=generateCaptionRow(tableContent.getCaption());
  rLayout.initialize(row);
  rLayout.layout();
  TableArea tableRegion=(TableArea)row.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}
Program: 72133
Project: 72133
Buggy source:
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    paramUtil=new SPParameterPositionUtil(command,'@');
    this.callStat=conn.prepareCall(command);
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.cachedParameterMetaData=null;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}

Fixed version (ground truth):
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    paramUtil=new SPParameterPositionUtil(command,conn.getMetaData().getIdentifierQuoteString());
    this.callStat=conn.prepareCall(command);
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.cachedParameterMetaData=null;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}
Program: 72136
Project: 72136
Buggy source:
protected MasterPageDesign getMasterPage(IReportContent report){
  MasterPageDesign pageDesign=null;
  if (masterPageName != null && !"String_Node_Str".equals(masterPageName)) {
    pageDesign=report.getDesign().findMasterPage(masterPageName);
    if (pageDesign != null) {
      return pageDesign;
    }
  }
  return getDefaultMasterPage(report);
}

Fixed version (ground truth):
protected MasterPageDesign getMasterPage(IReportContent report){
  if (masterPage != null) {
    return masterPage;
  }
  return getDefaultMasterPage(report);
}
Program: 72137
Project: 72137
Buggy source:
public PageLayout(IReportExecutor executor,LayoutEngineContext context,ContainerLayout parent,IContent content){
  super(context,parent,content);
  this.reportExecutor=executor;
  pageContent=(IPageContent)content;
  masterPageName=pageContent.getName();
  report=pageContent.getReportContent();
}

Fixed version (ground truth):
public PageLayout(IReportExecutor executor,LayoutEngineContext context,ContainerLayout parent,IContent content){
  super(context,parent,content);
  this.reportExecutor=executor;
  pageContent=(IPageContent)content;
  masterPage=(MasterPageDesign)pageContent.getGenerateBy();
  report=pageContent.getReportContent();
}
Program: 72139
Project: 72139
Buggy source:
public EditPart createEditPart(EditPart context,Object model){
  EditPart editPart=null;
  if (model instanceof LibraryHandle) {
    return new LibraryReportDesignEditPart(model);
  }
  if (ignoreModel(model)) {
    editPart=new EmptyEditPart(model);
  }
  if (editPart != null) {
    return editPart;
  }
  editPart=super.createEditPart(context,model);
  if (!(editPart instanceof DestroyEditPart) && (editPart == null || editPart instanceof DummyEditpart)) {
    editPart=new EmptyEditPart(model);
  }
  return editPart;
}

Fixed version (ground truth):
public EditPart createEditPart(EditPart context,Object model){
  EditPart editPart=null;
  if (model instanceof LibraryHandle) {
    return new LibraryReportDesignEditPart(model);
  }
  if (ignoreModel(model)) {
    editPart=new EmptyEditPart(model);
  }
  if (editPart != null) {
    return editPart;
  }
  editPart=super.createEditPart(context,model);
  if (!(editPart instanceof DestroyEditPart) && (editPart == null || editPart instanceof DummyEditpart)) {
    editPart=new EmptyEditPart(model);
  }
  if (editPart instanceof AreaEditPart) {
    editPart=new EmptyEditPart(model);
  }
  return editPart;
}
Program: 72140
Project: 72140
Buggy source:
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle,boolean keepDataSetFilter,boolean disAllowAggregation) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  BaseDataSetDesign baseDS=this.modelAdaptor.adaptDataSet(handle);
  if (useResultHints == false && handle.equals(major)) {
    baseDS.getResultSetHints().clear();
  }
  if (!keepDataSetFilter) {
    if (baseDS.getFilters() != null)     baseDS.getFilters().clear();
  }
  if (disAllowAggregation) {
    List computedColumns=baseDS.getComputedColumns();
    if (computedColumns != null && computedColumns.size() != 0) {
      Iterator it=computedColumns.iterator();
      while (it.hasNext()) {
        IComputedColumn computedColumn=(IComputedColumn)it.next();
        if (computedColumn.getAggregateFunction() != null)         it.remove();
      }
    }
  }
  dataEngine.defineDataSet(baseDS);
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle,boolean keepDataSetFilter,boolean disAllowAggregation) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  BaseDataSetDesign baseDS=this.modelAdaptor.adaptDataSet(handle);
  if (useResultHints == false && handle.equals(major)) {
    baseDS.getResultSetHints().clear();
  }
  if (!keepDataSetFilter) {
    if (baseDS.getFilters() != null)     baseDS.getFilters().clear();
  }
  if (disAllowAggregation) {
    List computedColumns=baseDS.getComputedColumns();
    if (computedColumns != null && computedColumns.size() != 0) {
      for (int i=0; i < computedColumns.size(); i++) {
        IComputedColumn computedColumn=(IComputedColumn)computedColumns.get(i);
        if (computedColumn.getAggregateFunction() != null) {
          computedColumns.set(i,new ComputedColumn(computedColumn.getName(),"String_Node_Str"));
        }
      }
    }
  }
  dataEngine.defineDataSet(baseDS);
}
Program: 72141
Project: 72141
Buggy source:
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    if (arg.getValue() != null)     argument.add(new ScriptExpression(arg.getValue()));
 else     argument.add(new ScriptExpression("String_Node_Str"));
  }
  return argument;
}

Fixed version (ground truth):
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    if (arg.getValue() != null)     argument.add(new ScriptExpression(arg.getValue()));
 else     argument.add(new ScriptExpression(null));
  }
  return argument;
}