nus-yam/ex-repair huggingface dataset:
Program: 76015
Project: 76015
Buggy source:
protected void startGroupTOCEntry(IGroupContent group){
  TOCBuilder tocBuilder=context.getTOCBuilder();
  if (tocBuilder != null) {
    TOCEntry entry=getParentTOCEntry();
    String hiddenFormats=group.getStyle().getVisibleFormat();
    long elementId=((ReportElementDesign)group.getGenerateBy()).getID();
    tocEntry=tocBuilder.startGroupEntry(entry,group.getTOC(),group.getBookmark(),hiddenFormats,elementId);
    String tocId=tocEntry.getNode().getNodeID();
    if (group.getBookmark() == null) {
      group.setBookmark(tocId);
    }
  }
}

Fixed version (ground truth):
protected void startGroupTOCEntry(IGroupContent group){
  TOCBuilder tocBuilder=context.getTOCBuilder();
  if (tocBuilder != null) {
    TOCEntry entry=getParentTOCEntry();
    String hiddenFormats=group.getStyle().getVisibleFormat();
    long elementId=getElementId(group);
    tocEntry=tocBuilder.startGroupEntry(entry,group.getTOC(),group.getBookmark(),hiddenFormats,elementId);
    String tocId=tocEntry.getNode().getNodeID();
    if (group.getBookmark() == null) {
      group.setBookmark(tocId);
    }
  }
}
Program: 76018
Project: 76018
Buggy source:
/** 
 * @param extension
 * @param object
 * @return
 */
public static Object doExtension(IExtension extension,Object object){
  List list=ExtensionPointManager.getInstance().getExtendedElementPoints();
  if (list == null || list.size() == 0) {
    return null;
  }
  Object retValue=null;
  if (PALETTE_DESIGNER.equals(extension.getExtendsionIdentify()) || PALETTE_MASTERPAGE.equals(extension.getExtendsionIdentify())) {
    retValue=doPalette(object,extension.getExtendsionIdentify());
  }
 else   if (DESIGNER_FACTORY.equals(extension.getExtendsionIdentify())) {
    retValue=doDesignerFactory(object);
  }
  return retValue;
}

Fixed version (ground truth):
/** 
 * @param extension
 * @param object
 * @return
 */
public static Object doExtension(IExtension extension,Object object){
  Object retValue=null;
  if (PALETTE_DESIGNER.equals(extension.getExtendsionIdentify()) || PALETTE_MASTERPAGE.equals(extension.getExtendsionIdentify())) {
    retValue=doPalette(object,extension.getExtendsionIdentify());
  }
 else   if (DESIGNER_FACTORY.equals(extension.getExtendsionIdentify())) {
    retValue=doDesignerFactory(object);
  }
  return retValue;
}
Program: 76023
Project: 76023
Buggy source:
public Object get(String arg0,Scriptable scope){
  try {
    return cursor.getObject(arg0);
  }
 catch (  OLAPException e) {
    return null;
  }
}

Fixed version (ground truth):
public Object get(String arg0,Scriptable scope){
  try {
    return it.getValue(arg0);
  }
 catch (  BirtException e) {
    return null;
  }
}
Program: 76024
Project: 76024
Buggy source:
/** 
 * This method is used to register the Java Script Objects which are defined in the scope of source ResultSet ( might be IResultSet or CubeCursor ) to target scope. One possible client of this method is Report Engine. A classic use case is that instead of register its own "row" object  the Report Engine can simply call this method with proper argument so that the "row" object registered in IResultIterator's scope, that is, JSResultSetRow, can be accessed by engine using engine scope. 
 * @param targetScope
 * @param source
 */
public static void registerJSObject(Scriptable targetScope,Object source){
  if (source instanceof IResultIterator) {
    Scriptable scope=((IResultIterator)source).getScope();
    targetScope.put("String_Node_Str",targetScope,scope.get("String_Node_Str",scope));
  }
 else   if (source instanceof CubeCursor) {
    targetScope.put("String_Node_Str",targetScope,new JSCubeBindingObject((CubeCursor)source));
  }
}

Fixed version (ground truth):
/** 
 * This method is used to register the Java Script Objects which are defined in the scope of source ResultSet ( might be IResultSet or CubeCursor ) to target scope. One possible client of this method is Report Engine. A classic use case is that instead of register its own "row" object  the Report Engine can simply call this method with proper argument so that the "row" object registered in IResultIterator's scope, that is, JSResultSetRow, can be accessed by engine using engine scope. 
 * @param targetScope
 * @param source
 */
public static void registerJSObject(Scriptable targetScope,Object source){
  if (source instanceof IResultIterator) {
    targetScope.put("String_Node_Str",targetScope,new JSResultIteratorObject((IResultIterator)source));
  }
 else   if (source instanceof ICubeCursor) {
    Scriptable scope=((ICubeCursor)source).getScope();
    targetScope.put("String_Node_Str",targetScope,scope.get("String_Node_Str",scope));
    targetScope.put("String_Node_Str",targetScope,scope.get("String_Node_Str",scope));
    targetScope.put("String_Node_Str",targetScope,scope.get("String_Node_Str",scope));
  }
}
Program: 76025
Project: 76025
Buggy source:
public void testRegisterJSObject(){
  try {
    Context cx=Context.enter();
    Scriptable target=new ImporterTopLevel(cx);
    Scriptable source=new ImporterTopLevel(cx);
    assertFalse(target.get("String_Node_Str",target) instanceof DummyJSObject);
    DummyResultIterator ri=new DummyResultIterator(source);
    assertFalse(target.get("String_Node_Str",target) instanceof DummyJSObject);
    assertTrue(source.get("String_Node_Str",source) instanceof DummyJSObject);
    DataAdapterUtil.registerJSObject(target,ri);
    assertTrue(source.get("String_Node_Str",source) instanceof DummyJSObject);
    assertTrue(target.get("String_Node_Str",target) instanceof DummyJSObject);
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
public void testRegisterJSObject(){
  try {
  }
  finally {
    Context.exit();
  }
}
Program: 76026
Project: 76026
Buggy source:
public JSMeasureAccessor(ICubeQueryDefinition defn,CubeCursor cursor) throws OLAPException {
  this.cursor=cursor;
}

Fixed version (ground truth):
public JSMeasureAccessor(CubeCursor cursor) throws OLAPException {
  this.cursor=cursor;
}
Program: 76027
Project: 76027
Buggy source:
public void buildStyle(IContent element,StringBuffer styleBuffer){
  IStyle style;
  if (isEmbeddable) {
    style=element.getStyle();
  }
 else {
    style=element.getInlineStyle();
  }
  AttributeBuilder.buildStyle(styleBuffer,style,parentEmitter);
  AttributeBuilder.checkHyperlinkTextDecoration(style,styleBuffer);
}

Fixed version (ground truth):
public void buildStyle(IContent element,StringBuffer styleBuffer){
  IStyle style;
  if (isEmbeddable) {
    style=element.getStyle();
  }
 else {
    style=element.getInlineStyle();
  }
  AttributeBuilder.buildStyle(styleBuffer,style,parentEmitter);
  AttributeBuilder.checkHyperlinkTextDecoration(element.getComputedStyle(),styleBuffer);
}
Program: 76028
Project: 76028
Buggy source:
/** 
 * Build the style of foreign content.
 */
public void buildForeignStyle(IForeignContent foreign,StringBuffer styleBuffer,int display,String url){
  IStyle style=foreign.getStyle();
  handleShrink(display,style,foreign.getHeight(),foreign.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(style,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=foreign.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  buildStyle(foreign,styleBuffer);
  if (!isEmbeddable) {
    AttributeBuilder.checkHyperlinkTextDecoration(style,styleBuffer);
  }
}

Fixed version (ground truth):
/** 
 * Build the style of foreign content.
 */
public void buildForeignStyle(IForeignContent foreign,StringBuffer styleBuffer,int display,String url){
  IStyle style=foreign.getStyle();
  handleShrink(display,style,foreign.getHeight(),foreign.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=foreign.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  buildStyle(foreign,styleBuffer);
  AttributeBuilder.checkHyperlinkTextDecoration(foreign.getComputedStyle(),styleBuffer);
}
Program: 76029
Project: 76029
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(style,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=text.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  buildStyle(text,styleBuffer);
  if (!isEmbeddable) {
    AttributeBuilder.checkHyperlinkTextDecoration(style,styleBuffer);
  }
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=text.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  buildStyle(text,styleBuffer);
  AttributeBuilder.checkHyperlinkTextDecoration(text.getComputedStyle(),styleBuffer);
}
Program: 76030
Project: 76030
Buggy source:
public void drawTotalPage(String text,int textX,int textY,int width,int height,TextStyle textInfo){
  if (totalPageTemplate != null)   drawText(text,textX,textY,width,height,textInfo.getFontInfo(),textInfo.getLetterSpacing(),textInfo.getWordSpacing(),textInfo.getColor(),textInfo.isLinethrough(),textInfo.isOverline(),textInfo.isUnderline(),textInfo.getAlign(),true);
}

Fixed version (ground truth):
private void drawTotalPage(String text,float textX,float textY,float width,float height,TextStyle textInfo){
  drawText(text,textX,textY,width,height,textInfo.getFontInfo(),textInfo.getLetterSpacing(),textInfo.getWordSpacing(),textInfo.getColor(),textInfo.isLinethrough(),textInfo.isOverline(),textInfo.isUnderline(),textInfo.getAlign(),true);
}
Program: 76031
Project: 76031
Buggy source:
/** 
 * @param measureList
 * @param functionList
 * @param levelView
 * @return
 * @throws SemanticException
 */
public CrosstabCellHandle addSubTotal(List measureList,List functionList) throws SemanticException {
  if (focus == null || !isValidParameters(functionList,measureList))   return null;
  if (focus.isInnerMost()) {
    focus.getLogger().log(Level.WARNING,"String_Node_Str" + focus.getModelHandle().getName() + "String_Node_Str");
    return null;
  }
  if (focus.getAggregationHeader() != null) {
    focus.getLogger().log(Level.INFO,"String_Node_Str");
  }
  CommandStack stack=focus.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    if (focus.getAggregationHeader() == null)     focus.getAggregationHeaderProperty().add(CrosstabExtendedItemFactory.createCrosstabCell(focus.getModuleHandle()));
    if (crosstab != null && measureList != null) {
      addMeasureAggregations(focus,measureList,functionList,false);
    }
    validateCrosstab();
  }
 catch (  SemanticException e) {
    focus.getLogger().log(Level.WARNING,e.getMessage(),e);
    stack.rollback();
    throw e;
  }
  stack.commit();
  return focus.getAggregationHeader();
}

Fixed version (ground truth):
/** 
 * @param measureList
 * @param functionList
 * @param levelView
 * @return
 * @throws SemanticException
 */
public CrosstabCellHandle addSubTotal(List measureList,List functionList) throws SemanticException {
  if (focus == null || !isValidParameters(functionList,measureList))   return null;
  verifyTotalMeasureFunctions(focus.getAxisType(),functionList,measureList);
  if (focus.isInnerMost()) {
    focus.getLogger().log(Level.WARNING,"String_Node_Str" + focus.getModelHandle().getName() + "String_Node_Str");
    return null;
  }
  if (focus.getAggregationHeader() != null) {
    focus.getLogger().log(Level.INFO,"String_Node_Str");
  }
  CommandStack stack=focus.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    if (focus.getAggregationHeader() == null)     focus.getAggregationHeaderProperty().add(CrosstabExtendedItemFactory.createCrosstabCell(focus.getModuleHandle()));
    if (crosstab != null && measureList != null) {
      addMeasureAggregations(focus,measureList,functionList,false);
    }
    validateCrosstab();
  }
 catch (  SemanticException e) {
    focus.getLogger().log(Level.WARNING,e.getMessage(),e);
    stack.rollback();
    throw e;
  }
  stack.commit();
  return focus.getAggregationHeader();
}
Program: 76033
Project: 76033
Buggy source:
/** 
 * @param dimensionView
 * @throws SemanticException
 */
public void removeDimension(DimensionViewHandle dimensionView) throws SemanticException {
  if (dimensionView == null || dimensionView.getContainer() != crosstabView)   return;
  CommandStack stack=crosstabView.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  int count=dimensionView.getLevelCount();
  try {
    if (crosstab != null) {
      for (int i=0; i < count; i++) {
        dimensionView.removeLevel(0);
      }
    }
    dimensionView.getModelHandle().drop();
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}

Fixed version (ground truth):
/** 
 * @param dimensionView
 * @throws SemanticException
 */
public void removeDimension(DimensionViewHandle dimensionView) throws SemanticException {
  if (dimensionView == null || dimensionView.getContainer() != crosstabView)   return;
  CommandStack stack=crosstabView.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  int count=dimensionView.getLevelCount();
  try {
    if (crosstab != null) {
      for (int i=0; i < count; i++) {
        dimensionView.removeLevel(0);
      }
    }
    dimensionView.getModelHandle().drop();
    if (crosstabView.getDimensionCount() == 0) {
      crosstabView.removeGrandTotal();
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}
Program: 76034
Project: 76034
Buggy source:
/** 
 * Removes grand total from crosstab if it is not empty, otherwise do nothing.
 */
public void removeGrandTotal() throws SemanticException {
  PropertyHandle propHandle=crosstabView.getGrandTotalProperty();
  if (propHandle.getContentCount() > 0) {
    CommandStack stack=crosstabView.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
    try {
      if (crosstab != null && CrosstabModelUtil.getAllLevelCount(crosstab,crosstabView.getAxisType()) > 0) {
        removeMeasureAggregations(crosstabView.getAxisType());
      }
      propHandle.drop(0);
    }
 catch (    SemanticException e) {
      crosstabView.getLogger().log(Level.INFO,e.getMessage(),e);
      stack.rollback();
      throw e;
    }
    stack.commit();
  }
}

Fixed version (ground truth):
/** 
 * Removes grand total from crosstab if it is not empty, otherwise do nothing.
 */
public void removeGrandTotal() throws SemanticException {
  PropertyHandle propHandle=crosstabView.getGrandTotalProperty();
  if (propHandle.getContentCount() > 0) {
    CommandStack stack=crosstabView.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
    try {
      if (crosstab != null) {
        removeMeasureAggregations(crosstabView.getAxisType());
      }
      propHandle.drop(0);
    }
 catch (    SemanticException e) {
      crosstabView.getLogger().log(Level.INFO,e.getMessage(),e);
      stack.rollback();
      throw e;
    }
    stack.commit();
  }
}
Program: 76035
Project: 76035
Buggy source:
/** 
 * Convert parameter to Object with pattern
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validateWithPattern(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  if (isLocale) {
    validateWithLocale(dataType,format,value,locale);
  }
 else {
    if (format == null)     format=getDefaultDateFormat(dataType);
    obj=ParameterValidationUtil.validate(dataType,format,value);
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Convert parameter to Object with pattern
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validateWithPattern(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  if (isLocale) {
    obj=validateWithLocale(dataType,format,value,locale);
  }
 else {
    if (format == null)     format=getDefaultDateFormat(dataType);
    obj=ParameterValidationUtil.validate(dataType,format,value);
  }
  return obj;
}
Program: 76036
Project: 76036
Buggy source:
/** 
 * Convert parameter to Object
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validate(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  if (isLocale) {
    validateWithLocale(dataType,format,value,locale);
  }
 else {
    obj=ParameterValidationUtil.validate(dataType,getDefaultDateFormat(dataType),value);
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Convert parameter to Object
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validate(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  if (isLocale) {
    obj=validateWithLocale(dataType,format,value,locale);
  }
 else {
    obj=ParameterValidationUtil.validate(dataType,getDefaultDateFormat(dataType),value);
  }
  return obj;
}
Program: 76037
Project: 76037
Buggy source:
/** 
 * Test FilterByRow#testAccept case 2
 * @throws Exception
 */
public void testAccept2() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() + value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}

Fixed version (ground truth):
/** 
 * Test FilterByRow#testAccept case 2
 * @throws Exception
 */
public void testAccept2() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null,false);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() + value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}
Program: 76038
Project: 76038
Buggy source:
/** 
 * Test FilterByRow#testAccept case 3
 * @throws Exception
 */
public void testAccept3() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() * value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}

Fixed version (ground truth):
/** 
 * Test FilterByRow#testAccept case 3
 * @throws Exception
 */
public void testAccept3() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null,false);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() * value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}
Program: 76039
Project: 76039
Buggy source:
/** 
 * Test FilterByRow#testAccept case 4
 * @throws Exception
 */
public void testAccept4() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_GT,"String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() * value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}

Fixed version (ground truth):
/** 
 * Test FilterByRow#testAccept case 4
 * @throws Exception
 */
public void testAccept4() throws Exception {
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ConditionalExpression("String_Node_Str",ConditionalExpression.OP_GT,"String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,null,null,false);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() * value1.intValue() > value2.intValue());
  }
  resultIterator.close();
}
Program: 76040
Project: 76040
Buggy source:
/** 
 * Execute Query
 * @return IResultIterator
 * @throws Exception
 */
private IResultIterator getResultIterator(FilterDefinition[] filterDefn,String[] bindingNameFilter,IBaseExpression[] bindingExprFilter) throws Exception {
  QueryDefinition queryDefn=(QueryDefinition)getDefaultQueryDefn(this.dataSet.getName());
  if (filterDefn != null) {
    if (bindingNameFilter != null)     for (int i=0; i < bindingNameFilter.length; i++)     queryDefn.addResultSetExpression(bindingNameFilter[i],bindingExprFilter[i]);
    for (int i=0; i < filterDefn.length; i++)     queryDefn.addFilter(filterDefn[i]);
  }
  return executeQuery(queryDefn);
}

Fixed version (ground truth):
/** 
 * Execute Query
 * @return IResultIterator
 * @throws Exception
 */
private IResultIterator getResultIterator(FilterDefinition[] filterDefn,String[] bindingNameFilter,IBaseExpression[] bindingExprFilter,boolean needCache) throws Exception {
  QueryDefinition queryDefn=(QueryDefinition)getDefaultQueryDefn(this.dataSet.getName());
  queryDefn.setNeedCache(needCache);
  if (filterDefn != null) {
    if (bindingNameFilter != null)     for (int i=0; i < bindingNameFilter.length; i++)     queryDefn.addResultSetExpression(bindingNameFilter[i],bindingExprFilter[i]);
    for (int i=0; i < filterDefn.length; i++)     queryDefn.addFilter(filterDefn[i]);
  }
  return executeQuery(queryDefn);
}
Program: 76041
Project: 76041
Buggy source:
/** 
 * Test FilterByRow#testAccept case 1
 * @throws Exception
 */
public void testAccept1() throws Exception {
  String[] bindingNameFilter=new String[3];
  bindingNameFilter[0]="String_Node_Str";
  bindingNameFilter[1]="String_Node_Str";
  bindingNameFilter[2]="String_Node_Str";
  IBaseExpression[] bindingExprFilter=new IBaseExpression[3];
  bindingExprFilter[0]=new ScriptExpression("String_Node_Str");
  bindingExprFilter[1]=new ScriptExpression("String_Node_Str");
  bindingExprFilter[2]=new ScriptExpression("String_Node_Str");
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str")),new FilterDefinition(new ScriptExpression("String_Node_Str")),new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,bindingNameFilter,bindingExprFilter);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() > 0);
    assertTrue(value1.intValue() > 1);
    assertTrue(value2.intValue() > 0);
  }
  resultIterator.close();
}

Fixed version (ground truth):
/** 
 * Test FilterByRow#testAccept case 1
 * @throws Exception
 */
public void testAccept1() throws Exception {
  String[] bindingNameFilter=new String[3];
  bindingNameFilter[0]="String_Node_Str";
  bindingNameFilter[1]="String_Node_Str";
  bindingNameFilter[2]="String_Node_Str";
  IBaseExpression[] bindingExprFilter=new IBaseExpression[3];
  bindingExprFilter[0]=new ScriptExpression("String_Node_Str");
  bindingExprFilter[1]=new ScriptExpression("String_Node_Str");
  bindingExprFilter[2]=new ScriptExpression("String_Node_Str");
  FilterDefinition[] filterDefn=new FilterDefinition[]{new FilterDefinition(new ScriptExpression("String_Node_Str")),new FilterDefinition(new ScriptExpression("String_Node_Str")),new FilterDefinition(new ScriptExpression("String_Node_Str"))};
  IResultIterator resultIterator=getResultIterator(filterDefn,bindingNameFilter,bindingExprFilter,false);
  while (resultIterator.next()) {
    Integer value0=resultIterator.getInteger(getBindingExpressionName()[0]);
    Integer value1=resultIterator.getInteger(getBindingExpressionName()[1]);
    Integer value2=resultIterator.getInteger(getBindingExpressionName()[2]);
    assertTrue(value0.intValue() > 0);
    assertTrue(value1.intValue() > 1);
    assertTrue(value2.intValue() > 0);
  }
  resultIterator.close();
}
Program: 76043
Project: 76043
Buggy source:
private void createHyperlink(IArea area,int x,int y){
  IContent content=area.getContent();
  if (null != content) {
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    String systemId=reportRunnable == null ? null : reportRunnable.getReportName();
    if (null != hlAction)     try {
      int width=getWidth(area);
      int height=getHeight(area);
      String hyperlink=hlAction.getHyperlink();
      String bookmark=hlAction.getBookmark();
      String targetWindow=hlAction.getTargetWindow();
      int type=hlAction.getType();
switch (type) {
case IHyperlinkAction.ACTION_BOOKMARK:
        currentPage.createHyperlink(hyperlink,bookmark,targetWindow,type,x,y,width,height);
      break;
case IHyperlinkAction.ACTION_HYPERLINK:
    currentPage.createHyperlink(hyperlink,null,targetWindow,type,x,y,width,height);
  break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
Action act=new Action(systemId,hlAction);
IHTMLActionHandler actionHandler=null;
Object ac=services.getOption(RenderOption.ACTION_HANDLER);
if (ac != null && ac instanceof IHTMLActionHandler) {
actionHandler=(IHTMLActionHandler)ac;
}
String link=actionHandler.getURL(act,context);
currentPage.createHyperlink(link,null,targetWindow,type,x,y,width,height);
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}

Fixed version (ground truth):
private void createHyperlink(IArea area,int x,int y){
  IContent content=area.getContent();
  if (null != content) {
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    String systemId=reportRunnable == null ? null : reportRunnable.getReportName();
    if (null != hlAction)     try {
      int width=getWidth(area);
      int height=getHeight(area);
      String bookmark=hlAction.getBookmark();
      String targetWindow=hlAction.getTargetWindow();
      int type=hlAction.getType();
      Action act=new Action(systemId,hlAction);
      String link=null;
      IHTMLActionHandler actionHandler=null;
      Object ac=services.getOption(RenderOption.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
      }
      if (actionHandler != null) {
        link=actionHandler.getURL(act,context);
      }
 else {
        link=hlAction.getHyperlink();
      }
switch (type) {
case IHyperlinkAction.ACTION_BOOKMARK:
        currentPage.createHyperlink(link,bookmark,targetWindow,type,x,y,width,height);
      break;
case IHyperlinkAction.ACTION_HYPERLINK:
    currentPage.createHyperlink(link,null,targetWindow,type,x,y,width,height);
  break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
currentPage.createHyperlink(link,null,targetWindow,type,x,y,width,height);
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}
Program: 76045
Project: 76045
Buggy source:
/** 
 * Computes value precision if more precise than existing one For instance 3.4 has a precision of 0.1 and 1400 has a precision of 100. That is the position where the first significant digit appears, or in double representation, the value of the exponent
 * @param precision
 * @param value
 * @return
 */
protected static double getPrecision(double precision,double value){
  if (value == 0) {
    if (precision < 0)     return precision;
 else     if (precision >= 0)     return 1;
  }
  if (precision == 0) {
    precision=Math.pow(10,Math.floor(Math.log(value) / Math.log(10)));
  }
  double check=value / precision;
  int loopCounter=0;
  while (Math.floor(check) != check && loopCounter < 20) {
    loopCounter++;
    precision/=10;
    check=value / precision;
  }
  if (loopCounter == 20)   logger.log(ILogger.WARNING,"String_Node_Str" + value);
  return precision;
}

Fixed version (ground truth):
/** 
 * Computes value precision if more precise than existing one For instance 3.4 has a precision of 0.1 and 1400 has a precision of 100. That is the position where the first significant digit appears, or in double representation, the value of the exponent
 * @param precision
 * @param value
 * @return
 */
protected static double getPrecision(double precision,double pValue){
  double value=Math.abs(pValue);
  if (value == 0) {
    if (precision < 0)     return precision;
 else     if (precision >= 0)     return 1;
  }
  if (precision == 0) {
    precision=Math.pow(10,Math.floor(Math.log(value) / Math.log(10)));
  }
  double check=value / precision;
  int loopCounter=0;
  while (Math.floor(check) != check && loopCounter < 20) {
    loopCounter++;
    precision/=10;
    check=value / precision;
  }
  if (loopCounter == 20)   logger.log(ILogger.WARNING,"String_Node_Str" + value);
  return precision;
}
Program: 76049
Project: 76049
Buggy source:
/** 
 * Returns the user value of current DataPointHintes.
 * @param key
 * @return
 */
public final Object getUserValue(String key){
  if (userValueMap == null) {
    return null;
  }
  return userValueMap.get(key);
}

Fixed version (ground truth):
/** 
 * Returns the user value of current DataPointHintes.
 * @param key
 * @return
 */
public final Object getUserValue(String key){
  if (userValueMap == null) {
    return null;
  }
  Object value=userValueMap.get(key);
  if (value instanceof CDateTime) {
    return ((CDateTime)value).getTime();
  }
  return value;
}
Program: 76050
Project: 76050
Buggy source:
/** 
 * Returns the data type associated with a single column resultset subset. Note the result is only valid for single column subset.
 * @return A data type associated with a single column resultset
 */
int getDataType();

Fixed version (ground truth):
/** 
 * Returns the data type of a given column associated with a multi-column resultset subset.
 * @return A data type associated with a multi-column resultset
 */
int getDataType(int columnIndex);
Program: 76051
Project: 76051
Buggy source:
/** 
 * Populates the trigger datasets from given data source. Only Text data is supported now.
 * @param oResultSetDef
 * @throws ChartException
 */
public DataSet[] populate(Object oResultSetDef) throws ChartException {
  DataSet[] ds=new DataSet[0];
  if (oResultSetDef instanceof IResultSetDataSet) {
    final IResultSetDataSet rsds=(IResultSetDataSet)oResultSetDef;
    final long lRowCount=rsds.getSize();
    if (lRowCount <= 0) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.ZERO_DATASET,"String_Node_Str",Messages.getResourceBundle());
    }
    final int columnCount=rsds.getColumnCount();
    ds=new DataSet[columnCount];
    final String[][] saDataSet=new String[columnCount][(int)lRowCount];
    int i=0;
    while (rsds.hasNext()) {
      Object[] nextRow=rsds.next();
      for (int k=0; k < columnCount; k++) {
        saDataSet[k][i]=ChartUtil.stringValue(nextRow[k]);
      }
      i++;
    }
    for (int k=0; k < columnCount; k++) {
      ds[k]=TextDataSetImpl.create(saDataSet[k]);
    }
  }
 else {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle());
  }
  return ds;
}

Fixed version (ground truth):
/** 
 * Populates the trigger datasets from given data source. Only Text data is supported now.
 * @param oResultSetDef
 * @throws ChartException
 */
public DataSet[] populate(Object oResultSetDef) throws ChartException {
  DataSet[] ds=new DataSet[0];
  if (oResultSetDef instanceof IResultSetDataSet) {
    final IResultSetDataSet rsds=(IResultSetDataSet)oResultSetDef;
    final long lRowCount=rsds.getSize();
    if (lRowCount <= 0) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.ZERO_DATASET,"String_Node_Str",Messages.getResourceBundle());
    }
    final int columnCount=rsds.getColumnCount();
    ds=new DataSet[columnCount];
    for (int k=0; k < columnCount; k++) {
switch (rsds.getDataType(k)) {
case IConstants.TEXT:
        final String[] saDataSet=new String[(int)lRowCount];
      ds[k]=TextDataSetImpl.create(saDataSet);
    break;
case IConstants.DATE_TIME:
  final Calendar[] caDataSet=new Calendar[(int)lRowCount];
ds[k]=DateTimeDataSetImpl.create(caDataSet);
break;
case IConstants.NUMERICAL:
final Double[] doaDataSet=new Double[(int)lRowCount];
ds[k]=NumberDataSetImpl.create(doaDataSet);
break;
default :
throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_SET,"String_Node_Str");
}
}
int i=0;
while (rsds.hasNext()) {
Object row[]=rsds.next();
for (int k=0; k < columnCount; k++) {
Object value=null;
switch (rsds.getDataType(k)) {
case IConstants.TEXT:
value=(String)row[k];
break;
case IConstants.DATE_TIME:
value=Methods.asDateTime(row[k]);
break;
case IConstants.NUMERICAL:
value=Methods.asDouble(row[k]);
break;
default :
throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_SET,"String_Node_Str");
}
((Object[])ds[k].getValues())[i]=value;
}
i++;
}
}
 else {
throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle());
}
return ds;
}
Program: 76060
Project: 76060
Buggy source:
private void testDimensionFind(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.key[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.dimensionPos,i);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
  }
}

Fixed version (ground truth):
private void testDimensionFind(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.getKey()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.getDimensionPos(),i);
    Member levelMember=realDimension.getRowByPosition(indexKey.getDimensionPos()).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.getOffset()).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
  }
}
Program: 76062
Project: 76062
Buggy source:
private DimensionKey create(int i){
  DimensionKey key=new DimensionKey(3);
  key.keyValues[0]=new Integer(i);
  key.keyValues[1]=String.valueOf(i + 1);
  key.keyValues[2]=new Date(i + 2);
  return key;
}

Fixed version (ground truth):
private DimensionKey create(int i){
  DimensionKey key=new DimensionKey(3);
  key.getKeyValues()[0]=new Integer(i);
  key.getKeyValues()[1]=String.valueOf(i + 1);
  key.getKeyValues()[2]=new Date(i + 2);
  return key;
}
Program: 76063
Project: 76063
Buggy source:
private Member create(int i){
  Member key=new Member();
  key.keyValues=new Object[]{new Integer(i)};
  key.attributes=new Object[2];
  key.attributes[0]=String.valueOf(i + 1);
  key.attributes[1]=new Date(i + 2);
  return key;
}

Fixed version (ground truth):
private Member create(int i){
  Member key=new Member();
  key.setKeyValues(new Object[]{new Integer(i)});
  key.setAttributes(new Object[2]);
  key.getAttributes()[0]=String.valueOf(i + 1);
  key.getAttributes()[1]=new Date(i + 2);
  return key;
}
Program: 76064
Project: 76064
Buggy source:
public void testSaveAndLoad() throws IOException {
  int keyCount=10000;
  BufferedStructureArray bufferedStructureArray=new BufferedStructureArray(Member.getCreator(),2000);
  for (int i=0; i < keyCount; i++) {
    bufferedStructureArray.add(create(i));
  }
  for (int i=0; i < keyCount; i++) {
    Member member1=(Member)bufferedStructureArray.get(i);
    Member member2=create(i);
    assertEquals(member1.compareTo(member2),0);
    assertEquals(member1.attributes[0],member2.attributes[0]);
    assertEquals(member1.attributes[1],member2.attributes[1]);
  }
}

Fixed version (ground truth):
public void testSaveAndLoad() throws IOException {
  int keyCount=10000;
  BufferedStructureArray bufferedStructureArray=new BufferedStructureArray(Member.getCreator(),2000);
  for (int i=0; i < keyCount; i++) {
    bufferedStructureArray.add(create(i));
  }
  for (int i=0; i < keyCount; i++) {
    Member member1=(Member)bufferedStructureArray.get(i);
    Member member2=create(i);
    assertEquals(member1.compareTo(member2),0);
    assertEquals(member1.getAttributes()[0],member2.getAttributes()[0]);
    assertEquals(member1.getAttributes()[1],member2.getAttributes()[1]);
  }
}
Program: 76067
Project: 76067
Buggy source:
/** 
 * @throws IOException
 * @throws BirtException
 */
public void testDimensionGetAll() throws IOException, BirtException {
  ILevelDefn[] levelDefs=new ILevelDefn[4];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[3]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  IDocumentManager documentManager=DocumentManagerFactory.createFileDocumentManager();
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new FourLevelDataset(),levelDefs,false);
  assertEquals(dimension.isTime(),false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  IDiskArray result=realDimension.getAllRows();
  for (int i=0; i < result.size(); i++) {
    DimensionRow dimRow=(DimensionRow)(result.get(i));
    assertEquals(dimRow.members[0].keyValues[0],FourLevelDataset.Level1Col[i]);
    assertEquals(dimRow.members[1].keyValues[0],FourLevelDataset.Level2Col[i]);
    assertEquals(dimRow.members[2].keyValues[0],FourLevelDataset.Level3Col[i]);
    assertEquals(dimRow.members[3].keyValues[0],FourLevelDataset.Level4Col[i]);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws BirtException
 */
public void testDimensionGetAll() throws IOException, BirtException {
  ILevelDefn[] levelDefs=new ILevelDefn[4];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[3]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  IDocumentManager documentManager=DocumentManagerFactory.createFileDocumentManager();
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new FourLevelDataset(),levelDefs,false);
  assertEquals(dimension.isTime(),false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  IDiskArray result=realDimension.getAllRows();
  for (int i=0; i < result.size(); i++) {
    DimensionRow dimRow=(DimensionRow)(result.get(i));
    assertEquals(dimRow.getMembers()[0].getKeyValues()[0],FourLevelDataset.Level1Col[i]);
    assertEquals(dimRow.getMembers()[1].getKeyValues()[0],FourLevelDataset.Level2Col[i]);
    assertEquals(dimRow.getMembers()[2].getKeyValues()[0],FourLevelDataset.Level3Col[i]);
    assertEquals(dimRow.getMembers()[3].getKeyValues()[0],FourLevelDataset.Level4Col[i]);
  }
}
Program: 76075
Project: 76075
Buggy source:
private void testDimensionFind(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.key[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.dimensionPos,i);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).members[0];
    assertEquals(levelMember.keyValues[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.attributes[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.attributes[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[0];
    assertEquals(levelMember.keyValues[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.attributes[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.attributes[1],OneLevelDataset.AgeCol[i]);
  }
}

Fixed version (ground truth):
private void testDimensionFind(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.key[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.dimensionPos,i);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
  }
}
Program: 76079
Project: 76079
Buggy source:
private void checkEquals(FactTableRow factTableRow1,FactTableRow factTableRow2){
  assertEquals(factTableRow1,factTableRow2);
  assertEquals(factTableRow1.measures.length,factTableRow2.measures.length);
  for (int i=0; i < factTableRow2.measures.length; i++) {
    assertEquals(factTableRow1.measures[i],factTableRow2.measures[i]);
  }
}

Fixed version (ground truth):
private void checkEquals(FactTableRow factTableRow1,FactTableRow factTableRow2){
  assertEquals(factTableRow1,factTableRow2);
  assertEquals(factTableRow1.getMeasures().length,factTableRow2.getMeasures().length);
  for (int i=0; i < factTableRow2.getMeasures().length; i++) {
    assertEquals(factTableRow1.getMeasures()[i],factTableRow2.getMeasures()[i]);
  }
}