nus-yam/ex-repair huggingface dataset:
Program: 74260
Project: 74260
Buggy source:
/** 
 * Log engine error message in problem view
 * @param request
 * @param errors
 */
public static void error(HttpServletRequest request,List errors){
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   return;
  String systemId=getSystemId(request);
  if (systemId == null)   return;
  clearErrors(systemId);
  if (errors == null || errors.size() <= 0)   return;
  Iterator it=errors.iterator();
  while (it.hasNext()) {
    Exception e=(Exception)it.next();
    if (e != null) {
      error(systemId,getDetailMessage(e),IBirtConstants.UNKNOWN_POSITION);
    }
  }
}

Fixed version (ground truth):
/** 
 * Log engine error message in problem view
 * @param request
 * @param errors
 */
public static void error(HttpServletRequest request,List errors){
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   return;
  String systemId=getSystemId(request);
  if (systemId == null)   return;
  String isCleared=(String)request.getAttribute(VIEWER_MARKER_CLEARED);
  if (isCleared == null) {
    clearErrors(systemId);
    request.setAttribute(VIEWER_MARKER_CLEARED,"String_Node_Str");
  }
  if (errors == null || errors.size() <= 0)   return;
  Iterator it=errors.iterator();
  while (it.hasNext()) {
    Exception e=(Exception)it.next();
    if (e != null) {
      error(systemId,getDetailMessage(e),IBirtConstants.UNKNOWN_POSITION);
    }
  }
}
Program: 74261
Project: 74261
Buggy source:
/** 
 * @throws Exception
 */
private void preBasic() throws Exception {
  IQueryResults qr=myPreDataEngine.getQueryResults(queryResultID);
  assert(qr.getResultMetaData() != null);
  IResultIterator ri=qr.getResultIterator();
  assert(ri.getResultMetaData() != null);
  checkResult1(ri);
  ri.close();
  myPreDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
private void preBasic() throws Exception {
  IQueryResults qr=myPreDataEngine.getQueryResults(queryResultID);
  assertTrue(qr.getResultMetaData() != null);
  assertTrue(qr.getPreparedQuery() != null);
  IResultIterator ri=qr.getResultIterator();
  assertTrue(ri.getResultMetaData() != null);
  checkResult1(ri);
  ri.close();
  myPreDataEngine.shutdown();
}
Program: 74262
Project: 74262
Buggy source:
public IPreparedQuery getPreparedQuery(){
  return null;
}

Fixed version (ground truth):
public IPreparedQuery getPreparedQuery(){
  if (this.dummyPreparedQuery == null)   this.dummyPreparedQuery=this.populateDummyPreparedQuery();
  return this.dummyPreparedQuery;
}
Program: 74263
Project: 74263
Buggy source:
/** 
 * Evaluate a BIRT expression
 * @param expr the expression to be evaluated
 * @param name the file name
 * @param lineNo the line number
 * @return the result if no error exists, otherwise null.
 */
public Object evaluate(String expr,String name,int lineNo){
  if (expr != null) {
    try {
      return scriptContext.eval(expr,name,lineNo);
    }
 catch (    Throwable e) {
      log.log(Level.SEVERE,e.getMessage(),e);
      addException(new EngineException(MessageConstants.SCRIPT_EVALUATION_ERROR,expr,e));
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Evaluate a BIRT expression
 * @param expr the expression to be evaluated
 * @param name the file name
 * @param lineNo the line number
 * @return the result if no error exists, otherwise null.
 */
public Object evaluate(String expr,String name,int lineNo){
  if (expr != null) {
    try {
      return scriptContext.eval(expr,name,lineNo);
    }
 catch (    Throwable e) {
      log.log(Level.SEVERE,e.getMessage(),e);
      addException(new EngineException(MessageConstants.SCRIPT_EVALUATION_ERROR,new String[]{expr,e.getMessage()},e));
    }
  }
  return null;
}
Program: 74265
Project: 74265
Buggy source:
public BlankResultSet(IQueryResultSet rset){
  this.rset=rset;
}

Fixed version (ground truth):
public BlankResultSet(){
}
Program: 74266
Project: 74266
Buggy source:
public void close(){
  if (rset != null) {
    rset.close();
  }
}

Fixed version (ground truth):
public void close(){
}
Program: 74267
Project: 74267
Buggy source:
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return listContent;
}

Fixed version (ground truth):
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  if (rsetEmpty) {
    processEmptyQuery();
  }
  prepareToExecuteChildren();
  return listContent;
}
Program: 74268
Project: 74268
Buggy source:
protected void createQueryForShowIfBlank(){
  IQueryResultSet blankRset=new BlankResultSet(rset);
  rset=blankRset;
  context.setResultSet(rset);
  rsetEmpty=false;
}

Fixed version (ground truth):
protected void createQueryForShowIfBlank(){
  IQueryResultSet blankRset=new BlankResultSet();
  rset=blankRset;
  context.setResultSet(rset);
  rsetEmpty=false;
}
Program: 74269
Project: 74269
Buggy source:
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return tableContent;
}

Fixed version (ground truth):
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  if (rsetEmpty) {
    processEmptyQuery();
  }
  prepareToExecuteChildren();
  return tableContent;
}
Program: 74270
Project: 74270
Buggy source:
protected void doExecute() throws Exception {
  executeQuery();
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  executeQuery();
  if (rsetEmpty) {
    processEmptyQuery();
  }
}
Program: 74271
Project: 74271
Buggy source:
protected void createQueryForShowIfBlank(){
  IBaseResultSet[] blankRsets=new IBaseResultSet[1];
  blankRsets[0]=new BlankResultSet((IQueryResultSet)rsets[0]);
  rsets=blankRsets;
  context.setResultSets(rsets);
  rsetEmpty=false;
}

Fixed version (ground truth):
protected void createQueryForShowIfBlank(){
  IBaseResultSet[] blankRsets=new IBaseResultSet[1];
  blankRsets[0]=new BlankResultSet();
  rsets=blankRsets;
  context.setResultSets(rsets);
  rsetEmpty=false;
}
Program: 74272
Project: 74272
Buggy source:
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
  if (rsetEmpty) {
    processEmptyQuery();
  }
}
Program: 74273
Project: 74273
Buggy source:
/** 
 * exit the scripting context
 */
public void exit(){
  if (context != null) {
    Context.exit();
    context=null;
    compiledScripts.clear();
  }
}

Fixed version (ground truth):
/** 
 * exit the scripting context
 */
public void exit(){
  if (context != null) {
    Context.exit();
    context=null;
  }
}
Program: 74274
Project: 74274
Buggy source:
/** 
 * evaluates a script
 */
public Object eval(String source,String name,int lineNo){
  assert(this.context != null);
  Script script=(Script)compiledScripts.get(source);
  if (script == null) {
    script=context.compileString(source,name,lineNo,null);
    compiledScripts.put(source,script);
  }
  Object value=script.exec(context,scope);
  return jsToJava(value);
}

Fixed version (ground truth):
/** 
 * evaluates a script
 */
public Object eval(ScriptExpression expr){
  assert(this.context != null);
  if (null == expr) {
    return null;
  }
  Script script=expr.getCompiledScript();
  if (script == null) {
    script=context.compileString(expr.getScriptText(),expr.getId(),expr.getLineNumber(),null);
    expr.setCompiledScript(script);
  }
  Object value=script.exec(context,scope);
  return jsToJava(value);
}
Program: 74275
Project: 74275
Buggy source:
private void handleOnPrepare(RowHandle handle){
  boolean hasJavaScript=(handle.getOnPrepare() != null) && (handle.getOnPrepare().length() != 0);
  boolean hasJavaCode=(handle.getEventHandlerClass() != null) && (handle.getEventHandlerClass().length() != 0);
  if (!hasJavaScript && !hasJavaCode)   return;
  executionContext.pushHandle(handle);
  if (hasJavaScript) {
    IDesignElement element=SimpleElementFactory.getInstance().getElement(handle);
    try {
      if (element != null) {
        executionContext.newScope(element);
      }
      if (handle.getOnPrepare() != null) {
        executionContext.evaluate((String)handle.getOnPrepare());
      }
      return;
    }
  finally {
      if (element != null) {
        executionContext.exitScope();
      }
    }
  }
  try {
    RowScriptExecutor.handleOnPrepare(handle,executionContext);
  }
  finally {
    executionContext.popHandle();
  }
}

Fixed version (ground truth):
private void handleOnPrepare(RowHandle handle){
  boolean hasJavaScript=(handle.getOnPrepare() != null) && (handle.getOnPrepare().length() != 0);
  boolean hasJavaCode=(handle.getEventHandlerClass() != null) && (handle.getEventHandlerClass().length() != 0);
  if (!hasJavaScript && !hasJavaCode)   return;
  executionContext.pushHandle(handle);
  if (hasJavaScript) {
    IDesignElement element=SimpleElementFactory.getInstance().getElement(handle);
    try {
      if (element != null) {
        executionContext.newScope(element);
      }
      if (handle.getOnPrepare() != null) {
        String scriptText=handle.getOnPrepare();
        if (null != scriptText) {
          String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ITableRowModel.ON_PREPARE_METHOD));
          ScriptExpression expr=new ScriptExpression(scriptText,id);
          executionContext.evaluate(expr);
        }
      }
      return;
    }
  finally {
      if (element != null) {
        executionContext.exitScope();
      }
    }
  }
  try {
    RowScriptExecutor.handleOnPrepare(handle,executionContext);
  }
  finally {
    executionContext.popHandle();
  }
}
Program: 74277
Project: 74277
Buggy source:
protected void writeColumns(ITableContent table){
  for (int i=0; i < table.getColumnCount(); i++) {
    IColumn column=table.getColumn(i);
    if (isColumnHidden(column)) {
      continue;
    }
    writer.openTag(HTMLTags.TAG_COL);
    if (enableAgentStyleEngine) {
      String styleClass=column.getStyleClass();
      setStyleName(styleClass);
    }
    StringBuffer styleBuffer=new StringBuffer();
    htmlEmitter.buildColumnStyle(column,styleBuffer);
    writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    htmlEmitter.handleColumnAlign(column);
    if (enableMetadata) {
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        writer.attribute("String_Node_Str",iid.toString());
      }
    }
    writer.closeNoEndTag();
  }
}

Fixed version (ground truth):
protected void writeColumns(ITableContent table){
  for (int i=0; i < table.getColumnCount(); i++) {
    IColumn column=table.getColumn(i);
    writer.openTag(HTMLTags.TAG_COL);
    if (enableAgentStyleEngine) {
      String styleClass=column.getStyleClass();
      setStyleName(styleClass);
    }
    StringBuffer styleBuffer=new StringBuffer();
    htmlEmitter.buildColumnStyle(column,styleBuffer);
    writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    htmlEmitter.handleColumnAlign(column);
    if (enableMetadata) {
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        writer.attribute("String_Node_Str",iid.toString());
      }
    }
    writer.closeNoEndTag();
  }
}
Program: 74278
Project: 74278
Buggy source:
public TableContentLayout(ITableContent tableContent,String format,HTMLLayoutContext context){
  this.format=format;
  this.context=context;
  this.colCount=tableContent.getColumnCount();
  for (int i=0; i < colCount; i++) {
    IColumn column=tableContent.getColumn(i);
    if (isColumnHidden(column)) {
      hiddenList.add(new Integer(i));
    }
  }
  this.realColCount=colCount - hiddenList.size();
}

Fixed version (ground truth):
public TableContentLayout(ITableContent tableContent,String format,HTMLLayoutContext context){
  this.format=format;
  this.context=context;
  this.tableContent=tableContent;
  this.colCount=tableContent.getColumnCount();
  this.adjustedColumnIds=new int[colCount];
  for (int i=0; i < colCount; i++) {
    int hiddenColumnCount=hiddenColumnIds.size();
    IColumn column=tableContent.getColumn(i);
    if (isColumnHidden(column)) {
      if (hiddenColumnCount == 0) {
        leastColumnIdToBeAjusted=i;
        hasHiddenColumns=true;
      }
      hiddenColumnIds.add(new Integer(i));
    }
 else {
      visibleColumns.add(column);
    }
    adjustedColumnIds[i]=i - hiddenColumnCount;
  }
  if (hasHiddenColumns) {
    this.wrappedTable=new TableContentWrapper(tableContent,visibleColumns);
  }
  this.realColCount=visibleColumns.size();
}
Program: 74279
Project: 74279
Buggy source:
private boolean isColumnHidden(IColumn column){
  String formats=column.getVisibleFormat();
  if (formats != null && (formats.indexOf(this.format) >= 0 || formats.indexOf(BIRTConstants.BIRT_ALL_VALUE) >= 0)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isColumnHidden(IColumn column){
  return LayoutUtil.isHiddenByVisibility(column,format);
}
Program: 74280
Project: 74280
Buggy source:
public int getColumnCount(){
  return tableContent.getColumnCount();
}

Fixed version (ground truth):
public int getColumnCount(){
  return columns.size();
}
Program: 74281
Project: 74281
Buggy source:
/** 
 * constructor
 * @param item the table deign
 */
public TableContentWrapper(ITableContent content){
  super(content);
  tableContent=content;
}

Fixed version (ground truth):
/** 
 * constructor
 * @param item the table deign
 */
public TableContentWrapper(ITableContent content,List columns){
  super(content);
  this.tableContent=content;
  this.columns=columns;
}
Program: 74282
Project: 74282
Buggy source:
public IColumn getColumn(int index){
  return tableContent.getColumn(index);
}

Fixed version (ground truth):
public IColumn getColumn(int index){
  return (IColumn)columns.get(index);
}
Program: 74283
Project: 74283
Buggy source:
static private boolean isHiddenByVisibility(IColumn column,String format){
  String columnFormats=column.getVisibleFormat();
  if (columnFormats != null) {
    if (contains(columnFormats,EngineIRConstants.FORMAT_TYPE_VIEWER) || contains(columnFormats,BIRTConstants.BIRT_ALL_VALUE) || contains(columnFormats,format)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isHiddenByVisibility(IColumn column,String format){
  String columnFormats=column.getVisibleFormat();
  if (columnFormats != null) {
    if (contains(columnFormats,EngineIRConstants.FORMAT_TYPE_VIEWER) || contains(columnFormats,BIRTConstants.BIRT_ALL_VALUE) || contains(columnFormats,format)) {
      return true;
    }
  }
  return false;
}
Program: 74284
Project: 74284
Buggy source:
protected boolean handleVisibility(){
  boolean ret=super.handleVisibility();
  if (ret && ((HTMLTableLayoutNoNestEmitter)emitter).isLayoutStarted()) {
    emitter.startRow((IRowContent)content);
    emitter.endRow((IRowContent)content);
  }
  return ret;
}

Fixed version (ground truth):
protected boolean handleVisibility(){
  boolean ret=super.handleVisibility();
  if (ret && ((HTMLTableLayoutEmitter)emitter).isLayoutStarted()) {
    emitter.startRow((IRowContent)content);
    emitter.endRow((IRowContent)content);
  }
  return ret;
}
Program: 74285
Project: 74285
Buggy source:
public void initialize(HTMLAbstractLM parent,IContent content,IReportItemExecutor executor,IContentEmitter emitter){
  tableEmitter=new HTMLTableLayoutNoNestEmitter(emitter,context);
  super.initialize(parent,content,executor,tableEmitter);
  isFirstLayout=true;
}

Fixed version (ground truth):
public void initialize(HTMLAbstractLM parent,IContent content,IReportItemExecutor executor,IContentEmitter emitter){
  tableEmitter=new HTMLTableLayoutEmitter(emitter,context);
  super.initialize(parent,content,executor,tableEmitter);
  isFirstLayout=true;
}
Program: 74286
Project: 74286
Buggy source:
public static Object getAdapter(Object adaptableObject,Class adatperType){
  Set adapters=getAdapters(adaptableObject);
  if (adapters == null)   return null;
  List adapterObjects=new ArrayList();
  l:   for (Iterator iter=adapters.iterator(); iter.hasNext(); ) {
    ElementAdapter adapter=(ElementAdapter)iter.next();
    if (adapter.getExpression() != null) {
      EvaluationContext context=new EvaluationContext(null,adaptableObject);
      context.setAllowPluginActivation(true);
      try {
        if (adapter.getExpression().evaluate(context) != EvaluationResult.TRUE)         continue l;
      }
 catch (      CoreException e) {
      }
    }
    Object obj=adapter.getAdater(adaptableObject);
    if (obj != null && adatperType.isAssignableFrom(obj.getClass())) {
      adapterObjects.add(obj);
    }
  }
  return adapterObjects.size() > 0 ? Proxy.newProxyInstance(adatperType.getClassLoader(),new Class[]{adatperType},new ElementAdapterInvocationHandler(adapterObjects)) : null;
}

Fixed version (ground truth):
public static Object getAdapter(Object adaptableObject,Class adatperType){
  List adapterObjects=getAdapterList(adaptableObject,adatperType);
  return (adapterObjects != null && adapterObjects.size() > 0) ? Proxy.newProxyInstance(adatperType.getClassLoader(),new Class[]{adatperType},new ElementAdapterInvocationHandler(adapterObjects)) : null;
}
Program: 74287
Project: 74287
Buggy source:
/** 
 * get the sub query result from the current query.
 * @param query
 * @return
 */
protected IBaseResultSet doExecuteSubQuery(QueryResultSet parent,ISubqueryDefinition subQuery){
}

Fixed version (ground truth):
/** 
 * get the sub query result from the current query.
 * @param query
 * @return
 */
protected IBaseResultSet doExecuteSubQuery(IQueryResultSet parent,ISubqueryDefinition subQuery){
}
Program: 74288
Project: 74288
Buggy source:
public IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache){
  if (query instanceof ISubqueryDefinition) {
    if (parent == null) {
      return null;
    }
 else     if (parent instanceof ICubeResultSet) {
      context.addException(new EngineException("String_Node_Str" + ((ISubqueryDefinition)query).getName()));
    }
    return doExecuteSubQuery((QueryResultSet)parent,(ISubqueryDefinition)query);
  }
 else   if (query instanceof IQueryDefinition) {
    return doExecuteQuery(parent,(IQueryDefinition)query,useCache);
  }
 else   if (query instanceof ICubeQueryDefinition) {
    return doExecuteCube(parent,(ICubeQueryDefinition)query,useCache);
  }
  return null;
}

Fixed version (ground truth):
public IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache){
  if (query instanceof ISubqueryDefinition) {
    if (parent == null) {
      return null;
    }
 else     if (parent instanceof ICubeResultSet) {
      context.addException(new EngineException("String_Node_Str" + ((ISubqueryDefinition)query).getName()));
    }
    return doExecuteSubQuery((IQueryResultSet)parent,(ISubqueryDefinition)query);
  }
 else   if (query instanceof IQueryDefinition) {
    return doExecuteQuery(parent,(IQueryDefinition)query,useCache);
  }
 else   if (query instanceof ICubeQueryDefinition) {
    return doExecuteCube(parent,(ICubeQueryDefinition)query,useCache);
  }
  return null;
}
Program: 74289
Project: 74289
Buggy source:
/** 
 * Delete folder
 * @param dirStr
 */
private void deleteDir(String dirStr){
  File curDir=new File(dirStr);
  if (!curDir.exists())   return;
  File[] files=curDir.listFiles();
  for (int i=0; i < files.length; i++)   files[i].delete();
  curDir.delete();
}

Fixed version (ground truth):
/** 
 * Delete folder
 * @param dirStr
 */
private void deleteDir(String dirStr){
  File curDir=new File(dirStr);
  if (!curDir.exists())   return;
  File[] files=curDir.listFiles();
  for (int i=0; i < files.length; i++)   files[i].delete();
  File parentDir=curDir.getParentFile();
  curDir.delete();
  parentDir.delete();
}
Program: 74290
Project: 74290
Buggy source:
private void setState(boolean enabled){
  lblTitle.setEnabled(enabled);
  txtTitle.setEnabled(enabled && btnTitleVisible.getSelection());
  btnTitleVisible.setEnabled(enabled);
  if (isShowValueEnabled()) {
    lblShowValue.setEnabled(enabled);
    btnShowValue.setEnabled(enabled);
  }
  Iterator buttons=getToggleButtons().iterator();
  while (buttons.hasNext()) {
    Button toggle=(Button)buttons.next();
    toggle.setEnabled(enabled && getContext().isEnabled(toggle.getData().toString()));
  }
  setToggleButtonEnabled(BUTTON_TITLE,btnTitleVisible.getSelection() && enabled);
  setToggleButtonEnabled(BUTTON_INTERACTIVITY,getChart().getInteractivity().isEnable() && enabled);
}

Fixed version (ground truth):
private void setState(boolean enabled){
  lblTitle.setEnabled(enabled);
  txtTitle.setEnabled(enabled && btnTitleVisible.getSelection());
  btnTitleVisible.setEnabled(enabled);
  if (isShowValueEnabled()) {
    lblShowValue.setEnabled(enabled);
    btnShowValue.setEnabled(enabled);
  }
  Iterator buttons=getToggleButtons().iterator();
  while (buttons.hasNext()) {
    Button toggle=(Button)buttons.next();
    toggle.setEnabled(enabled && getContext().isEnabled(SUBTASK_LEGEND + toggle.getData()));
  }
  setToggleButtonEnabled(BUTTON_TITLE,btnTitleVisible.getSelection() && enabled);
  setToggleButtonEnabled(BUTTON_INTERACTIVITY,getChart().getInteractivity().isEnable() && enabled);
}
Program: 74291
Project: 74291
Buggy source:
/** 
 * @return the test
 */
public static Test suite(){
  TestSuite test=new TestSuite();
  test.addTestSuite(CrosstabItemFactoryTest.class);
  return test;
}

Fixed version (ground truth):
/** 
 * @return the test
 */
public static Test suite(){
  TestSuite test=new TestSuite();
  test.addTestSuite(CrosstabItemFactoryTest.class);
  test.addTestSuite(CrosstabViewHandleTest.class);
  test.addTestSuite(MeasureViewHandleTest.class);
  return test;
}
Program: 74292
Project: 74292
Buggy source:
/** 
 * Get background position.
 * @param handle The handle of design element.
 * @return background position
 */
public Object getBackgroundPosition(DesignElementHandle handle){
  int x=0;
  int y=0;
  Object px=handle.getProperty(StyleHandle.BACKGROUND_POSITION_X_PROP);
  Object py=handle.getProperty(StyleHandle.BACKGROUND_POSITION_Y_PROP);
  if (px instanceof String && py instanceof String) {
    return new int[]{getPosition((String)px),getPosition((String)py)};
  }
  if (px instanceof DimensionValue && py instanceof DimensionValue) {
    if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(((DimensionValue)px).getUnits())) {
      if (!(DesignChoiceConstants.UNITS_PERCENTAGE.equals(((DimensionValue)py).getUnits()))) {
        return new int[]{PositionConstants.CENTER,PositionConstants.CENTER};
      }
      return new DimensionValue[]{(DimensionValue)px,(DimensionValue)py};
    }
    x=(int)DEUtil.convertoToPixel(px);
    y=(int)DEUtil.convertoToPixel(py);
    return new Point(x,y);
  }
  return new int[]{PositionConstants.CENTER,PositionConstants.CENTER};
}

Fixed version (ground truth):
/** 
 * Get background position.
 * @param handle The handle of design element.
 * @return background position
 */
public Object[] getBackgroundPosition(DesignElementHandle handle){
  Object x=null;
  Object y=null;
  if (handle != null) {
    Object px=handle.getProperty(StyleHandle.BACKGROUND_POSITION_X_PROP);
    Object py=handle.getProperty(StyleHandle.BACKGROUND_POSITION_Y_PROP);
    if (px instanceof String) {
      x=px;
    }
 else     if (px instanceof DimensionValue) {
      if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(((DimensionValue)px).getUnits())) {
        x=px;
      }
 else {
        x=new Integer((int)DEUtil.convertoToPixel(px));
      }
    }
    if (py instanceof String) {
      y=py;
    }
 else     if (py instanceof DimensionValue) {
      if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(((DimensionValue)py).getUnits())) {
        y=py;
      }
 else {
        y=new Integer((int)DEUtil.convertoToPixel(py));
      }
    }
  }
  return new Object[]{x,y};
}
Program: 74293
Project: 74293
Buggy source:
/** 
 * Get the position from string
 * @param position The given string
 * @return The position
 */
private int getPosition(String position){
  if (DesignChoiceConstants.BACKGROUND_POSITION_LEFT.equals(position)) {
    return PositionConstants.WEST;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_RIGHT.equals(position)) {
    return PositionConstants.EAST;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_TOP.equals(position)) {
    return PositionConstants.NORTH;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_BOTTOM.equals(position)) {
    return PositionConstants.SOUTH;
  }
  return PositionConstants.CENTER;
}

Fixed version (ground truth):
/** 
 * Get the position from string
 * @param position The given string
 * @return The position
 */
public static int getPosition(String position){
  if (DesignChoiceConstants.BACKGROUND_POSITION_LEFT.equals(position)) {
    return PositionConstants.WEST;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_RIGHT.equals(position)) {
    return PositionConstants.EAST;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_TOP.equals(position)) {
    return PositionConstants.NORTH;
  }
  if (DesignChoiceConstants.BACKGROUND_POSITION_BOTTOM.equals(position)) {
    return PositionConstants.SOUTH;
  }
  return PositionConstants.CENTER;
}
Program: 74295
Project: 74295
Buggy source:
protected Object getBackgroundPosition(DesignElementHandle handle){
  return getModelAdapter().getBackgroundPosition(handle);
}

Fixed version (ground truth):
protected Object[] getBackgroundPosition(DesignElementHandle handle){
  return getModelAdapter().getBackgroundPosition(handle);
}
Program: 74296
Project: 74296
Buggy source:
/** 
 * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
 */
protected void paintFigure(Graphics graphics){
  if (isOpaque()) {
    if (getBorder() instanceof BaseBorder) {
      graphics.fillRectangle(getBounds().getCopy().crop(((BaseBorder)getBorder()).getBorderInsets()));
    }
 else {
      graphics.fillRectangle(getBounds());
    }
  }
  Image image=getImage();
  if (image == null) {
    return;
  }
  int x, y;
  Rectangle area=getClientArea();
  graphics.getClip(PRIVATE_RECT);
  if (!(position.x == -1 && position.y == -1)) {
    x=area.x + position.x;
    y=area.y + position.y;
  }
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
      y=area.y;
    break;
case PositionConstants.SOUTH:
  y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
x=area.x + area.width - size.width;
break;
case PositionConstants.WEST:
x=area.x;
break;
default :
x=(area.width - size.width) / 2 + area.x;
break;
}
}
ArrayList xyList=createImageList(x,y);
Iterator iter=xyList.iterator();
while (iter.hasNext()) {
Point point=(Point)iter.next();
graphics.drawImage(image,point);
}
xyList.clear();
graphics.setClip(PRIVATE_RECT);
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
 */
protected void paintFigure(Graphics graphics){
  if (isOpaque()) {
    if (getBorder() instanceof BaseBorder) {
      graphics.fillRectangle(getBounds().getCopy().crop(((BaseBorder)getBorder()).getBorderInsets()));
    }
 else {
      graphics.fillRectangle(getBounds());
    }
  }
  Image image=getImage();
  if (image == null) {
    return;
  }
  int x, y;
  Rectangle area=getClientArea();
  graphics.getClip(PRIVATE_RECT);
  if (position != null && position.x != -1) {
    x=area.x + position.x;
  }
 else {
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
      x=area.x + area.width - size.width;
    break;
case PositionConstants.WEST:
  x=area.x;
break;
default :
x=(area.width - size.width) / 2 + area.x;
break;
}
}
if (position != null && position.y != -1) {
y=area.y + position.y;
}
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
y=area.y;
break;
case PositionConstants.SOUTH:
y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
}
ArrayList xyList=createImageList(x,y);
Iterator iter=xyList.iterator();
while (iter.hasNext()) {
Point point=(Point)iter.next();
graphics.drawImage(image,point);
}
xyList.clear();
graphics.setClip(PRIVATE_RECT);
}
Program: 74297
Project: 74297
Buggy source:
/** 
 * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
 */
protected void paintFigure(Graphics graphics){
  if (isOpaque()) {
    if (getBorder() instanceof BaseBorder) {
      graphics.fillRectangle(getBounds().getCopy().crop(((BaseBorder)getBorder()).getBorderInsets()));
    }
 else {
      graphics.fillRectangle(getBounds());
    }
  }
  Image image=getImage();
  if (image == null) {
    return;
  }
  int x, y;
  Rectangle area=getBounds();
  if (!(position.x == -1 && position.y == -1)) {
    x=area.x + position.x;
    y=area.y + position.y;
  }
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
      y=area.y;
    break;
case PositionConstants.SOUTH:
  y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
x=area.x + area.width - size.width;
break;
case PositionConstants.WEST:
x=area.x;
break;
default :
x=(area.width - size.width) / 2 + area.x;
break;
}
}
ArrayList xyList=createImageList(x,y);
Iterator iter=xyList.iterator();
while (iter.hasNext()) {
Point point=(Point)iter.next();
graphics.drawImage(image,point);
}
xyList.clear();
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
 */
protected void paintFigure(Graphics graphics){
  if (isOpaque()) {
    if (getBorder() instanceof BaseBorder) {
      graphics.fillRectangle(getBounds().getCopy().crop(((BaseBorder)getBorder()).getBorderInsets()));
    }
 else {
      graphics.fillRectangle(getBounds());
    }
  }
  Image image=getImage();
  if (image == null) {
    return;
  }
  int x, y;
  Rectangle area=getBounds();
  if (position != null && position.x != -1) {
    x=area.x + position.x;
  }
 else {
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
      x=area.x + area.width - size.width;
    break;
case PositionConstants.WEST:
  x=area.x;
break;
default :
x=(area.width - size.width) / 2 + area.x;
break;
}
}
if (position != null && position.y != -1) {
y=area.y + position.y;
}
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
y=area.y;
break;
case PositionConstants.SOUTH:
y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
}
ArrayList xyList=createImageList(x,y);
Iterator iter=xyList.iterator();
while (iter.hasNext()) {
Point point=(Point)iter.next();
graphics.drawImage(image,point);
}
xyList.clear();
}
Program: 74298
Project: 74298
Buggy source:
/** 
 * get count of clients of one <code>DataSetHandle</code> 
 * @param dsHandle
 * @return the size of the clients
 */
private int countNum(DataSetHandle dsHandle){
  DataSet ds=(DataSet)dsHandle.getElement();
  return ds.getClientList().size();
}

Fixed version (ground truth):
/** 
 * get count of clients of one <code>DataSetHandle</code>
 * @param dsHandle
 * @return the size of the clients
 */
private int countNum(DataSetHandle dsHandle){
  DataSet ds=(DataSet)dsHandle.getElement();
  return ds.getClientList().size();
}
Program: 74299
Project: 74299
Buggy source:
/** 
 * Test sematic check.
 * @throws DesignFileException
 */
public void testSematicCheck() throws DesignFileException {
  openDesign(semanticfileName);
  dataSet=(JointDataSetHandle)designHandle.findJointDataSet("String_Node_Str");
  List errors=design.getErrorList();
  assertEquals(2,errors.size());
  ErrorDetail detail=(ErrorDetail)errors.get(0);
  assertSame(dataSet.getElement(),detail.getElement());
  assertEquals(SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET,detail.getErrorCode());
  detail=(ErrorDetail)errors.get(1);
  assertSame(dataSet.getElement(),detail.getElement());
  assertEquals(SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET,detail.getErrorCode());
}

Fixed version (ground truth):
/** 
 * Test sematic check.
 * @throws DesignFileException
 */
public void testSematicCheck() throws DesignFileException {
  openDesign(semanticfileName);
  dataSet=designHandle.findJointDataSet("String_Node_Str");
  List errors=design.getErrorList();
  assertEquals(2,errors.size());
  ErrorDetail detail=(ErrorDetail)errors.get(0);
  assertSame(dataSet.getElement(),detail.getElement());
  assertEquals(SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET,detail.getErrorCode());
  detail=(ErrorDetail)errors.get(1);
  assertSame(dataSet.getElement(),detail.getElement());
  assertEquals(SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET,detail.getErrorCode());
}
Program: 74300
Project: 74300
Buggy source:
/** 
 * Creates a joint data set.
 */
public void setUp() throws DesignFileException {
  openDesign(fileName);
  dataSet=(JointDataSetHandle)designHandle.findJointDataSet("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates a joint data set.
 */
public void setUp() throws DesignFileException {
  openDesign(fileName);
  dataSet=designHandle.findJointDataSet("String_Node_Str");
}
Program: 74302
Project: 74302
Buggy source:
/** 
 * @param resultSet
 * @param rowIndexArray
 * @param dimensionNames
 * @param levelListArray
 * @return
 * @throws IOException
 * @throws DataException
 */
private CubePosFilter getValidPosFilter(IAggregationResultSet resultSet,IDiskArray rowIndexArray,String[] dimensionNames,List[] levelListArray) throws IOException, DataException {
  CubePosFilter cubePosFilter=new ValidCubePosFilter(dimensionNames);
  for (int i=0; i < rowIndexArray.size(); i++) {
    Integer rowIndex=(Integer)rowIndexArray.get(i);
    resultSet.seek(rowIndex.intValue());
    IDiskArray[] dimPositions=new IDiskArray[dimensionNames.length];
    for (int j=0; j < levelListArray.length; j++) {
      for (int k=0; k < levelListArray[j].size(); k++) {
        DimLevel level=(DimLevel)levelListArray[j].get(k);
        int levelIndex=resultSet.getLevelIndex(level);
        Object[] value=resultSet.getLevelKeyValue(levelIndex);
        IDiskArray positions=find(dimensionNames[j],level,value);
        if (dimPositions[j] == null) {
          dimPositions[j]=positions;
        }
 else {
          dimPositions[j]=SetUtil.getIntersection(dimPositions[j],positions);
        }
      }
    }
    cubePosFilter.addDimPositions(dimPositions);
  }
  return cubePosFilter;
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @param rowIndexArray
 * @param dimensionNames
 * @param levelListArray
 * @return
 * @throws IOException
 * @throws DataException
 */
private CubePosFilter getValidPosFilter(IAggregationResultSet resultSet,IDiskArray rowIndexArray,String[] dimensionNames,List[] levelListArray) throws IOException, DataException {
  CubePosFilter cubePosFilter=new ValidCubePosFilter(dimensionNames);
  for (int i=0; i < rowIndexArray.size(); i++) {
    Integer rowIndex=(Integer)rowIndexArray.get(i);
    resultSet.seek(rowIndex.intValue());
    IDiskArray[] dimPositions=new IDiskArray[dimensionNames.length];
    for (int j=0; j < levelListArray.length; j++) {
      for (int k=0; k < levelListArray[j].size(); k++) {
        DimLevel level=(DimLevel)levelListArray[j].get(k);
        int levelIndex=resultSet.getLevelIndex(level);
        Object[] value=resultSet.getLevelKeyValue(levelIndex);
        IDiskArray positions=find(dimensionNames[j],level,value);
        if (dimPositions[j] == null) {
          dimPositions[j]=positions;
        }
 else {
          dimPositions[j]=SetUtil.getIntersection(dimPositions[j],positions);
        }
      }
    }
    cubePosFilter.addDimPositions(dimPositions);
    for (int n=0; n < dimPositions.length; n++) {
      dimPositions[n].close();
    }
  }
  return cubePosFilter;
}
Program: 74303
Project: 74303
Buggy source:
/** 
 * @param resultSet
 * @param rowIndexArray
 * @param dimensionNames
 * @param levelListArray
 * @return
 * @throws IOException
 * @throws DataException
 */
private CubePosFilter getInvalidPosFilter(IAggregationResultSet resultSet,IDiskArray rowIndexArray,String[] dimensionNames,List[] levelListArray) throws IOException, DataException {
  CubePosFilter cubePosFilter=new InvalidCubePosFilter(dimensionNames);
  int rowIndex=0;
  for (int i=0; i < resultSet.length(); i++) {
    if (rowIndex < rowIndexArray.size()) {
      Integer index=(Integer)rowIndexArray.get(rowIndex);
      if (i == index.intValue()) {
        rowIndex++;
        continue;
      }
    }
    resultSet.seek(i);
    IDiskArray[] dimPositions=new IDiskArray[dimensionNames.length];
    for (int j=0; j < levelListArray.length; j++) {
      for (int k=0; k < levelListArray[j].size(); k++) {
        DimLevel level=(DimLevel)levelListArray[j].get(k);
        int levelIndex=resultSet.getLevelIndex(level);
        Object[] value=resultSet.getLevelKeyValue(levelIndex);
        IDiskArray positions=find(dimensionNames[j],level,value);
        if (dimPositions[j] == null) {
          dimPositions[j]=positions;
        }
 else {
          dimPositions[j]=SetUtil.getIntersection(dimPositions[j],positions);
        }
      }
    }
    cubePosFilter.addDimPositions(dimPositions);
  }
  return cubePosFilter;
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @param rowIndexArray
 * @param dimensionNames
 * @param levelListArray
 * @return
 * @throws IOException
 * @throws DataException
 */
private CubePosFilter getInvalidPosFilter(IAggregationResultSet resultSet,IDiskArray rowIndexArray,String[] dimensionNames,List[] levelListArray) throws IOException, DataException {
  CubePosFilter cubePosFilter=new InvalidCubePosFilter(dimensionNames);
  int rowIndex=0;
  for (int i=0; i < resultSet.length(); i++) {
    if (rowIndex < rowIndexArray.size()) {
      Integer index=(Integer)rowIndexArray.get(rowIndex);
      if (i == index.intValue()) {
        rowIndex++;
        continue;
      }
    }
    resultSet.seek(i);
    IDiskArray[] dimPositions=new IDiskArray[dimensionNames.length];
    for (int j=0; j < levelListArray.length; j++) {
      for (int k=0; k < levelListArray[j].size(); k++) {
        DimLevel level=(DimLevel)levelListArray[j].get(k);
        int levelIndex=resultSet.getLevelIndex(level);
        Object[] value=resultSet.getLevelKeyValue(levelIndex);
        IDiskArray positions=find(dimensionNames[j],level,value);
        if (dimPositions[j] == null) {
          dimPositions[j]=positions;
        }
 else {
          dimPositions[j]=SetUtil.getIntersection(dimPositions[j],positions);
        }
      }
    }
    cubePosFilter.addDimPositions(dimPositions);
    for (int n=0; n < dimPositions.length; n++) {
      dimPositions[n].close();
    }
  }
  return cubePosFilter;
}
Program: 74304
Project: 74304
Buggy source:
/** 
 * Create a parameter hint based on Parameter definition and value
 * @param paramDefn
 * @param evaValue
 */
private ParameterHint createParameterHint(IParameterDefinition paramDefn,Object paramValue) throws DataException {
  ParameterHint parameterHint=new ParameterHint(paramDefn.getName(),paramDefn.isInputMode(),paramDefn.isOutputMode());
  if (paramDefn.getPosition() > 0)   parameterHint.setPosition(paramDefn.getPosition());
  parameterHint.setNativeName(paramDefn.getNativeName());
  Class dataTypeClass=DataType.getClass(paramDefn.getType());
  if (dataTypeClass == DataType.AnyType.class || dataTypeClass == Blob.class) {
    dataTypeClass=String.class;
  }
  parameterHint.setDataType(dataTypeClass);
  parameterHint.setNativeDataType(paramDefn.getNativeType());
  parameterHint.setIsInputOptional(paramDefn.isInputOptional());
  if (parameterHint.isInputMode())   parameterHint.setDefaultInputValue(getParameterValueString(dataTypeClass,paramValue));
  parameterHint.setIsNullable(paramDefn.isNullable());
  return parameterHint;
}

Fixed version (ground truth):
/** 
 * Create a parameter hint based on Parameter definition and value
 * @param paramDefn
 * @param evaValue
 */
private ParameterHint createParameterHint(IParameterDefinition paramDefn,Object paramValue) throws DataException {
  ParameterHint parameterHint=new ParameterHint(paramDefn.getName(),paramDefn.isInputMode(),paramDefn.isOutputMode());
  if (paramDefn.getPosition() > 0)   parameterHint.setPosition(paramDefn.getPosition());
  parameterHint.setNativeName(paramDefn.getNativeName());
  Class dataTypeClass=DataType.getClass(paramDefn.getType());
  parameterHint.setNativeDataType(paramDefn.getNativeType());
  parameterHint.setIsInputOptional(paramDefn.isInputOptional());
  if (parameterHint.isInputMode())   parameterHint.setDefaultInputValue(getParameterValueString(dataTypeClass,paramValue));
  parameterHint.setIsNullable(paramDefn.isNullable());
  if (dataTypeClass != AnyType.class) {
    if (dataTypeClass == Blob.class)     parameterHint.setDataType(IBlob.class);
 else     if (dataTypeClass == Clob.class)     parameterHint.setDataType(IClob.class);
 else     parameterHint.setDataType(dataTypeClass);
  }
  return parameterHint;
}
Program: 74305
Project: 74305
Buggy source:
static private boolean contains(String formats,String format){
  int index=formats.indexOf(format);
  if (index != -1) {
    if (index > 0) {
      if (formats.charAt(index - 1) != ';') {
        return false;
      }
    }
    int lastIndex=index + format.length();
    if (lastIndex < formats.length()) {
      if (formats.charAt(lastIndex) != ';') {
        return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
static private boolean contains(String formats,String format){
  int index=formats.indexOf(format);
  if (index != -1) {
    if (index > 0) {
      if (formats.charAt(index - 1) != ',') {
        return false;
      }
    }
    int lastIndex=index + format.length();
    if (lastIndex < formats.length()) {
      if (formats.charAt(lastIndex) != ',') {
        return false;
      }
    }
    return true;
  }
  return false;
}