nus-yam/ex-repair huggingface dataset:
Program: 70408
Project: 70408
Buggy source:
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=getLabel().copyInstance();
  final String sPreviousValue=la.getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  la.setEllipsis(1);
  Map<Label,LabelLimiter> mapLimiter=rtc.getState(RunTimeContext.StateKey.LABEL_LIMITER_LOOKUP_KEY);
  LabelLimiter lbLimiter=mapLimiter.get(getLabel());
  lbLimiter.computeWrapping(xs,la);
  LabelLimiter lbLimiterNew=lbLimiter.limitLabelSize(xs,la,EnumSet.of(LabelLimiter.Option.FIX_WIDTH));
  mapLimiter.put(getLabel(),lbLimiterNew);
  return lbLimiterNew.getBounding(null);
}

Fixed version (ground truth):
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=getLabel().copyInstance();
  final String sPreviousValue=la.getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  la.setEllipsis(1);
  Map<Label,LabelLimiter> mapLimiter=rtc.getState(RunTimeContext.StateKey.LABEL_LIMITER_LOOKUP_KEY);
  LabelLimiter lbLimiter=mapLimiter.get(getLabel());
  lbLimiter.computeWrapping(xs,la);
  int iTitileAnchor=getAnchor().getValue();
  EnumSet<LabelLimiter.Option> option=iTitileAnchor == Anchor.EAST || iTitileAnchor == Anchor.WEST ? EnumSet.of(LabelLimiter.Option.FIX_HEIGHT) : EnumSet.of(LabelLimiter.Option.FIX_WIDTH);
  LabelLimiter lbLimiterNew=lbLimiter.limitLabelSize(xs,la,option);
  mapLimiter.put(getLabel(),lbLimiterNew);
  return lbLimiterNew.getBounding(null);
}
Program: 70409
Project: 70409
Buggy source:
public void widgetSelected(SelectionEvent e){
  Object oSource=e.getSource();
  if (oSource.equals(cmbAnchor)) {
    getBlockForProcessing().setAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbAnchor.getText())));
  }
 else   if (oSource.equals(cmbStretch)) {
    getBlockForProcessing().setStretch(Stretch.getByName(LiteralHelper.stretchSet.getNameByDisplayName(cmbStretch.getText())));
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Object oSource=e.getSource();
  if (oSource.equals(cmbAnchor)) {
    boolean bAnchorVerticalOld=isAnchorVertical(getBlockForProcessing().getAnchor());
    getBlockForProcessing().setAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbAnchor.getText())));
    boolean bAnchorVerticalNew=isAnchorVertical(getBlockForProcessing().getAnchor());
    if (bAnchorVerticalOld != bAnchorVerticalNew) {
      double rotationOld=getBlockForProcessing().getLabel().getCaption().getFont().getRotation();
      double rotationNew=rotationOld >= 0 ? 90 - rotationOld : -90 - rotationOld;
      getBlockForProcessing().getLabel().getCaption().getFont().setRotation(rotationNew);
    }
  }
 else   if (oSource.equals(cmbStretch)) {
    getBlockForProcessing().setStretch(Stretch.getByName(LiteralHelper.stretchSet.getNameByDisplayName(cmbStretch.getText())));
  }
}
Program: 70410
Project: 70410
Buggy source:
private void switchDataSet(String datasetName) throws ChartException {
  if (isCubeMode()) {
    return;
  }
  try {
    tablePreview.clearContents();
    if (datasetName == null) {
      datasetName=getDataServiceProvider().getReportDataSet();
    }
    if (datasetName != null) {
      switchDataTable();
    }
 else {
      tablePreview.createDummyTable();
    }
    tablePreview.layout();
  }
 catch (  Throwable t) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_BINDING,t);
  }
  DataDefinitionTextManager.getInstance().refreshAll();
  fireEvent(tablePreview,EVENT_PREVIEW);
}

Fixed version (ground truth):
private void switchDataSet(String datasetName) throws ChartException {
  if (isCubeMode()) {
    return;
  }
  try {
    tablePreview.clearContents();
    tableViewerColumns.setInput(null);
    if (datasetName == null) {
      datasetName=getDataServiceProvider().getReportDataSet();
    }
    if (datasetName != null) {
      switchDataTable();
    }
 else {
      tablePreview.createDummyTable();
    }
    tablePreview.layout();
  }
 catch (  Throwable t) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.DATA_BINDING,t);
  }
  DataDefinitionTextManager.getInstance().refreshAll();
  fireEvent(tablePreview,EVENT_PREVIEW);
}
Program: 70411
Project: 70411
Buggy source:
private void createDropDownComponent(){
  Point pLoc=UIHelper.getScreenLocation(btnDropDown.getParent());
  int iXLoc=pLoc.x;
  int iYLoc=pLoc.y + btnDropDown.getParent().getSize().y;
  int iShellWidth=MARKER_BLOCK_HEIGHT * MARKER_ROW_MAX_NUMBER + 15;
  int iShellHeight=150;
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  if (iXLoc + iShellWidth > this.getDisplay().getClientArea().width) {
    iXLoc=this.getDisplay().getClientArea().width - iShellWidth;
  }
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  shell.setLocation(iXLoc,iYLoc);
  cmpDropDown=new MarkerDropDownEditorComposite(shell,SWT.NONE);
  shell.layout();
  shell.open();
}

Fixed version (ground truth):
private void createDropDownComponent(){
  Point pLoc=UIHelper.getScreenLocation(btnDropDown.getParent());
  int iXLoc=pLoc.x;
  int iYLoc=pLoc.y + btnDropDown.getParent().getSize().y;
  int iShellWidth=MARKER_BLOCK_HEIGHT * MARKER_ROW_MAX_NUMBER + 15;
  int iShellHeight=175;
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  if (iXLoc + iShellWidth > this.getDisplay().getClientArea().width) {
    iXLoc=this.getDisplay().getClientArea().width - iShellWidth;
  }
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  shell.setLocation(iXLoc,iYLoc);
  cmpDropDown=new MarkerDropDownEditorComposite(shell,SWT.NONE);
  shell.layout();
  shell.open();
}
Program: 70415
Project: 70415
Buggy source:
/** 
 * Drop embedded image.
 * @throws Exception
 */
public void testDrop() throws Exception {
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.ENGLISH);
  ReportDesignHandle designHandle=sessionHandle.openDesign(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ filename);
  SimpleValueHandle propHandle=(SimpleValueHandle)designHandle.getPropertyHandle(ReportDesign.IMAGES_PROP);
  EmbeddedImageHandle image1handle=(EmbeddedImageHandle)designHandle.findImage("String_Node_Str").getHandle(propHandle);
  EmbeddedImageHandle image2handle=(EmbeddedImageHandle)designHandle.findImage("String_Node_Str").getHandle(propHandle);
  image1handle.drop();
  List value=propHandle.getListValue();
  assertEquals(1,value.size());
  assertEquals(image2handle.getStructure(),value.get(0));
  assertNull(image1handle.getStructure());
  image2handle.drop();
  assertEquals(0,value.size());
  assertNull(image2handle.getStructure());
}

Fixed version (ground truth):
/** 
 * Drop embedded image.
 * @throws Exception
 */
public void testDrop() throws Exception {
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.ENGLISH);
  ReportDesignHandle designHandle=sessionHandle.openDesign(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ filename);
  SimpleValueHandle propHandle=(SimpleValueHandle)designHandle.getPropertyHandle(ReportDesign.IMAGES_PROP);
  EmbeddedImageHandle image1handle=(EmbeddedImageHandle)designHandle.findImage("String_Node_Str").getHandle(propHandle);
  EmbeddedImageHandle image2handle=(EmbeddedImageHandle)designHandle.findImage("String_Node_Str").getHandle(propHandle);
  image1handle.drop();
  List value=propHandle.getListValue();
  assertEquals(1,value.size());
  assertEquals(image2handle.getStructure(),value.get(0));
  assertNull(image1handle.getStructure());
  image2handle.drop();
  List value1=propHandle.getListValue();
  assertEquals(0,value1.size());
  assertNull(image2handle.getStructure());
}
Program: 70416
Project: 70416
Buggy source:
/** 
 * Test parameters in joindataset
 * @throws Exception
 */
public void testParameter() throws Exception {
  openDesign(filename2);
  JointDataSetHandle jointds=designHandle.findJointDataSet("String_Node_Str");
  DataSetHandle ds1=designHandle.findDataSet("String_Node_Str");
  DataSetHandle ds2=designHandle.findDataSet("String_Node_Str");
  DataSetParameterHandle param1=(DataSetParameterHandle)ds1.parametersIterator().next();
  DataSetParameterHandle param2=(DataSetParameterHandle)ds2.parametersIterator().next();
  jointds.addDataSet("String_Node_Str");
  jointds.addDataSet("String_Node_Str");
  assertFalse(jointds.paramBindingsIterator().hasNext());
  List list=jointds.getListProperty(JointDataSet.DATA_SETS_PROP);
  assertSame(design.findDataSet("String_Node_Str"),((ElementRefValue)list.get(0)).getElement());
  assertSame(design.findDataSet("String_Node_Str"),((ElementRefValue)list.get(1)).getElement());
  assertEquals("String_Node_Str",param1.getName());
  assertEquals("String_Node_Str",param2.getName());
}

Fixed version (ground truth):
/** 
 * Test parameters in joindataset
 * @throws Exception
 */
public void testParameter() throws Exception {
  openDesign(filename2);
  JointDataSetHandle jointds=designHandle.findJointDataSet("String_Node_Str");
  DataSetHandle ds1=designHandle.findDataSet("String_Node_Str");
  DataSetHandle ds2=designHandle.findDataSet("String_Node_Str");
  DataSetParameterHandle param1=(DataSetParameterHandle)ds1.parametersIterator().next();
  DataSetParameterHandle param2=(DataSetParameterHandle)ds2.parametersIterator().next();
  jointds.addDataSet("String_Node_Str");
  jointds.addDataSet("String_Node_Str");
  assertFalse(jointds.paramBindingsIterator().hasNext());
  List list=jointds.getElement().getListProperty(design,JointDataSet.DATA_SETS_PROP);
  assertSame(design.findDataSet("String_Node_Str"),((ElementRefValue)list.get(0)).getElement());
  assertSame(design.findDataSet("String_Node_Str"),((ElementRefValue)list.get(1)).getElement());
  assertEquals("String_Node_Str",param1.getName());
  assertEquals("String_Node_Str",param2.getName());
}
Program: 70417
Project: 70417
Buggy source:
/** 
 * Returns a singleton instance of the plugin settings framework with specific configuration. Initializes the OSGi Platform framework to load chart extension bundles unless the STANDALONE flag was set in PlatformConfig property.
 * @return A singleton instance of the plugin settings framework
 */
public static synchronized PluginSettings instance(PlatformConfig config){
  if (ps == null) {
    ps=new PluginSettings();
    if (config != null) {
      ps.bStandalone=config.getProperty(PROP_STANDALONE) != null;
      String loggingDir=(String)config.getProperty(PROP_LOGGING_DIR);
      Level loggingLevel=(Level)config.getProperty(PROP_LOGGING_LEVEL);
      initFileLogger(loggingDir,loggingLevel);
    }
    if (!ps.bStandalone) {
      try {
        Platform.startup(config);
      }
 catch (      BirtException e) {
        logger.log(e);
      }
    }
  }
  return ps;
}

Fixed version (ground truth):
/** 
 * Returns a singleton instance of the plugin settings framework with specific configuration. Initializes the OSGi Platform framework to load chart extension bundles unless the STANDALONE flag was set in PlatformConfig property.
 * @return A singleton instance of the plugin settings framework
 */
public static synchronized PluginSettings instance(PlatformConfig config){
  if (ps == null) {
    ps=new PluginSettings();
    String loggingDir=null;
    Level loggingLevel=null;
    if (config != null) {
      ps.bStandalone=config.getProperty(PROP_STANDALONE) != null;
      loggingDir=(String)config.getProperty(PROP_LOGGING_DIR);
      loggingLevel=(Level)config.getProperty(PROP_LOGGING_LEVEL);
    }
    if (!ps.bStandalone) {
      try {
        Platform.startup(config);
      }
 catch (      BirtException e) {
        logger.log(e);
      }
    }
    ps.initFileLogger(loggingDir,loggingLevel);
  }
  return ps;
}
Program: 70418
Project: 70418
Buggy source:
private static void initFileLogger(String loggingDir,Level loggingLevel){
  if (loggingLevel != null && loggingLevel == Level.OFF) {
    return;
  }
  try {
    String dir=loggingDir != null ? loggingDir : ChartEnginePlugin.getInstance().getStateLocation().toOSString();
    JavaUtilLoggerImpl.initFileHandler(dir,loggingLevel);
  }
 catch (  SecurityException e) {
    logger.log(e);
  }
catch (  IOException e) {
    logger.log(e);
  }
}

Fixed version (ground truth):
private void initFileLogger(String loggingDir,Level loggingLevel){
  if (loggingLevel != null && loggingLevel == Level.OFF) {
    return;
  }
  try {
    String dir=null;
    if (loggingDir != null) {
      dir=loggingDir;
    }
 else     if (inEclipseEnv()) {
      dir=ChartEnginePlugin.getInstance().getStateLocation().toOSString();
    }
    if (dir != null) {
      JavaUtilLoggerImpl.initFileHandler(dir,loggingLevel);
    }
  }
 catch (  SecurityException e) {
    logger.log(e);
  }
catch (  IOException e) {
    logger.log(e);
  }
}
Program: 70419
Project: 70419
Buggy source:
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(getColumnCount());
  captionRow.setParent(this);
  captionRow.setWidth(width);
  CellArea captionCell=new CellArea();
  captionCell.setColSpan(getColumnCount());
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setHeight(h);
  captionRow.setHeight(h);
  add(captionRow);
  repeatList.add(captionRow);
  update(captionRow);
}

Fixed version (ground truth):
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(getColumnCount());
  captionRow.setParent(this);
  captionRow.setWidth(width);
  CellArea captionCell=new CellArea();
  captionCell.setColSpan(getColumnCount());
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setContentHeight(h);
  captionRow.setHeight(captionCell.getAllocatedHeight());
  add(captionRow);
  repeatList.add(captionRow);
  update(captionRow);
}
Program: 70420
Project: 70420
Buggy source:
private String[] getPreviewHeader(boolean isExpression) throws ChartException {
  String[] exps=getPreviewHeader();
  if (isExpression) {
    for (int i=0; i < exps.length; i++) {
      exps[i]=ExpressionUtil.createJSRowExpression(exps[i]);
    }
  }
  return exps;
}

Fixed version (ground truth):
private String[] getPreviewHeader(boolean isExpression) throws ChartException {
  ColumnBindingInfo[] cbis=getPreviewHeadersInfo();
  String[] exps=new String[cbis.length];
  int i=0;
  for (  ColumnBindingInfo cbi : cbis) {
    if (isExpression) {
      exps[i]=ExpressionUtil.createJSRowExpression(cbi.getName());
    }
 else {
      exps[i]=cbi.getName();
    }
    i++;
  }
  return exps;
}
Program: 70421
Project: 70421
Buggy source:
private void updateDragDataSource(){
  if (isCubeMode()) {
    stackLayout.topControl=cmpCubeTree;
    cubeTreeViewer.setInput(getCube());
  }
 else   if (getContext().isShowingDataPreview()) {
    boolean showDataPreview=true;
    try {
      if (!getContext().isSetShowingDataPreview() && getDataServiceProvider().getPreviewHeadersInfo().length >= 6) {
        showDataPreview=false;
      }
    }
 catch (    NullPointerException e) {
    }
catch (    ChartException e) {
      WizardBase.showException(e.getMessage());
    }
    if (showDataPreview) {
      stackLayout.topControl=cmpDataPreview;
      refreshTablePreview();
    }
 else {
      stackLayout.topControl=cmpColumnsList;
      refreshColumnsListView();
      getContext().setShowingDataPreview(false);
    }
  }
 else {
    stackLayout.topControl=cmpColumnsList;
    refreshColumnsListView();
  }
  btnShowDataPreviewA.setSelection(getContext().isShowingDataPreview());
  btnShowDataPreviewB.setSelection(getContext().isShowingDataPreview());
  cmpStack.layout();
}

Fixed version (ground truth):
private void updateDragDataSource(){
  if (isCubeMode()) {
    stackLayout.topControl=cmpCubeTree;
    cubeTreeViewer.setInput(getCube());
    cmpStack.layout();
    return;
  }
  try {
    if (!getContext().isSetShowingDataPreview() && getDataServiceProvider().getPreviewHeadersInfo().length >= 6) {
      getContext().setShowingDataPreview(false);
    }
  }
 catch (  NullPointerException e) {
  }
catch (  ChartException e) {
    WizardBase.showException(e.getMessage());
  }
  btnShowDataPreviewA.setSelection(getContext().isShowingDataPreview());
  btnShowDataPreviewB.setSelection(getContext().isShowingDataPreview());
  if (getContext().isShowingDataPreview()) {
    stackLayout.topControl=cmpDataPreview;
  }
 else {
    stackLayout.topControl=cmpColumnsList;
  }
  refreshDataPreviewPane();
  cmpStack.layout();
}
Program: 70423
Project: 70423
Buggy source:
public void layout(IContent content) throws BirtException {
  visitChildren(content,this);
  int height=current.getHeight();
  int bp=current.getCurrentBP();
  if (height < bp) {
    current.setHeight(bp);
  }
}

Fixed version (ground truth):
public void layout(IContent content) throws BirtException {
  current.initialize();
  visitChildren(content,this);
  current.close();
}
Program: 70424
Project: 70424
Buggy source:
/** 
 * layout page header area
 */
protected void layoutHeader(){
  IContent headerContent=pageContent.getPageHeader();
  boolean autoPageBreak=context.isAutoPageBreak();
  context.setAutoPageBreak(false);
  RegionLayoutEngine rle=new RegionLayoutEngine(header,context);
  try {
    rle.layout(headerContent);
  }
 catch (  BirtException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  context.setAutoPageBreak(autoPageBreak);
}

Fixed version (ground truth):
/** 
 * layout page header area
 */
protected void layoutHeader(){
  IContent headerContent=pageContent.getPageHeader();
  DimensionType h=pageContent.getHeaderHeight();
  if (h == null) {
    h=new DimensionType(0.5f,DimensionType.UNITS_IN);
  }
  headerContent.setHeight(h);
  header.content=headerContent;
  boolean autoPageBreak=context.isAutoPageBreak();
  context.setAutoPageBreak(false);
  RegionLayoutEngine rle=new RegionLayoutEngine(header,context);
  try {
    rle.layout(headerContent);
  }
 catch (  BirtException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  context.setAutoPageBreak(autoPageBreak);
}
Program: 70425
Project: 70425
Buggy source:
public void setHeader(ContainerArea header){
  this.header=header;
}

Fixed version (ground truth):
public void setHeader(RegionArea header){
  this.header=header;
}
Program: 70427
Project: 70427
Buggy source:
public void setFooter(ContainerArea footer){
  this.footer=footer;
}

Fixed version (ground truth):
public void setFooter(RegionArea footer){
  this.footer=footer;
}
Program: 70428
Project: 70428
Buggy source:
protected void update() throws BirtException {
  if (parent != null) {
    checkPageBreak();
    parent.update(this);
  }
}

Fixed version (ground truth):
protected void update() throws BirtException {
  if (context.isFixedLayout() && height > specifiedHeight && specifiedHeight > 0) {
    setHeight(specifiedHeight);
    setNeedClip(true);
  }
  if (parent != null) {
    checkPageBreak();
    parent.update(this);
  }
}
Program: 70429
Project: 70429
Buggy source:
public void close() throws DataException {
  if (this.resultSet != null) {
    this.resultSet.close();
    this.resultSet=null;
  }
  if (this.dataSetStream != null) {
    try {
      if (dataSetStream instanceof RAOutputStream) {
        ((RAOutputStream)dataSetStream).seek(rowCountOffset);
        IOUtil.writeInt(dataSetStream,rowCount);
      }
      OutputStream exprValueStream=this.streamsWrapper.getStreamManager().getOutStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
      if (exprValueStream instanceof RAOutputStream) {
        ((RAOutputStream)exprValueStream).seek(0);
        IOUtil.writeInt(exprValueStream,rowCount);
      }
      dataSetStream.close();
    }
 catch (    Exception e) {
    }
    dataSetStream=null;
  }
  if (this.dataSetLenStream != null) {
    try {
      dataSetLenStream.close();
    }
 catch (    Exception e) {
    }
    dataSetLenStream=null;
  }
}

Fixed version (ground truth):
public void close() throws DataException {
  if (this.resultSet != null) {
    this.resultSet.close();
    this.resultSet=null;
  }
  if (this.dataSetStream != null) {
    try {
      if (dataSetStream instanceof RAOutputStream) {
        ((RAOutputStream)dataSetStream).seek(rowCountOffset);
        IOUtil.writeInt(dataSetStream,rowCount);
      }
      OutputStream exprValueStream=this.streamsWrapper.getStreamManager().getOutStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
      if (exprValueStream instanceof RAOutputStream) {
        ((RAOutputStream)exprValueStream).seek(0);
        IOUtil.writeInt(exprValueStream,rowCount);
      }
      exprValueStream.close();
      dataSetStream.close();
    }
 catch (    Exception e) {
    }
    dataSetStream=null;
  }
  if (this.dataSetLenStream != null) {
    try {
      dataSetLenStream.close();
    }
 catch (    Exception e) {
    }
    dataSetLenStream=null;
  }
}
Program: 70430
Project: 70430
Buggy source:
public TextArea(String text,TextStyle style){
  this.text=text;
  this.style=style;
  this.height=(int)(style.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO);
}

Fixed version (ground truth):
public TextArea(TextStyle style){
  this.style=style;
  this.height=(int)(style.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO);
}
Program: 70431
Project: 70431
Buggy source:
private String calculateText(){
  if (textLength == 0) {
    return "String_Node_Str";
  }
 else {
    return text.substring(offset,offset + textLength);
  }
}

Fixed version (ground truth):
private String calculateText(){
  if (blankLine) {
    return "String_Node_Str";
  }
 else {
    return text.substring(offset,offset + textLength);
  }
}
Program: 70433
Project: 70433
Buggy source:
/** 
 * saveEditorContentsDE - saves the current editor contents to ROM using DE API
 * @param desHdl
 * @return true if updated else false.
 */
private boolean saveEditorContentsDE(DesignElementHandle desHdl){
  if (desHdl != null && getEditorText() != null) {
    try {
      if (cmbItemLastSelected != null) {
        String name=cmbItemLastSelected.getName();
        desHdl.setStringProperty(name,getEditorText());
        setEditorText(desHdl.getStringProperty(name));
      }
      selectionMap.put(getModel(),cmbExprListViewer.getSelection());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * saveEditorContentsDE - saves the current editor contents to ROM using DE API
 * @param desHdl
 * @return true if updated else false.
 */
private boolean saveEditorContentsDE(DesignElementHandle desHdl,boolean isSaveScript){
  if (desHdl != null && getEditorText() != null) {
    try {
      if (cmbItemLastSelected != null) {
        String name=cmbItemLastSelected.getName();
        desHdl.setStringProperty(name,getEditorText());
        if (!isSaveScript) {
          setEditorText(desHdl.getStringProperty(name));
        }
      }
      selectionMap.put(getModel(),cmbExprListViewer.getSelection());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
      return false;
    }
  }
  return true;
}
Program: 70434
Project: 70434
Buggy source:
/** 
 * Saves input code to model
 */
private void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle && !isSaveScript) {
    saveEditorContentsDE((DesignElementHandle)editObject);
  }
  setIsModified(false);
  ((IFormPage)getParentEditor()).getEditor().editorDirtyStateChanged();
  firePropertyChange(PROP_DIRTY);
  SourceViewer viewer=getViewer();
  IUndoManager undoManager=viewer == null ? null : viewer.getUndoManager();
  if (undoManager != null) {
    undoManager.endCompoundChange();
  }
  cleanPoint=getUndoLevel();
}

Fixed version (ground truth):
/** 
 * Saves input code to model
 */
private void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle) {
    saveEditorContentsDE((DesignElementHandle)editObject,isSaveScript);
  }
  setIsModified(false);
  ((IFormPage)getParentEditor()).getEditor().editorDirtyStateChanged();
  firePropertyChange(PROP_DIRTY);
  SourceViewer viewer=getViewer();
  IUndoManager undoManager=viewer == null ? null : viewer.getUndoManager();
  if (undoManager != null) {
    undoManager.endCompoundChange();
  }
  cleanPoint=getUndoLevel();
}
Program: 70435
Project: 70435
Buggy source:
public void dispose(){
  outlineBackup.dispose();
  dataBackup.dispose();
  List list=new ArrayList(pages);
  int size=list.size();
  for (int i=0; i < size; i++) {
    Object obj=list.get(i);
    if (obj instanceof IReportEditorPage) {
      ((IReportEditorPage)obj).dispose();
      pages.remove(obj);
    }
  }
  if (fPalettePage != null) {
    fPalettePage.dispose();
  }
  if (outlinePage != null) {
    outlinePage.dispose();
  }
  if (dataPage != null) {
    dataPage.dispose();
  }
  getSite().setSelectionProvider(null);
  ReportMediator.removeGlobalColleague(this);
  if (getModel() != null) {
    getModel().close();
  }
  IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
  if (synchronizer != null) {
    synchronizer.removeListener(IReportResourceChangeEvent.LibraySaveChange,this);
  }
  PlatformUI.getWorkbench().removeWindowListener(windowListener);
  if (prefs != null) {
    prefs.removePreferenceChangeListener(preferenceChangeListener);
  }
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  outlineBackup.dispose();
  dataBackup.dispose();
  List list=new ArrayList(pages);
  int size=list.size();
  for (int i=0; i < size; i++) {
    Object obj=list.get(i);
    if (obj instanceof IReportEditorPage) {
      ((IReportEditorPage)obj).dispose();
      pages.remove(obj);
    }
  }
  if (fPalettePage != null) {
    fPalettePage.dispose();
  }
  if (outlinePage != null) {
    outlinePage.dispose();
  }
  if (dataPage != null) {
    dataPage.dispose();
  }
  getSite().setSelectionProvider(null);
  ReportMediator.removeGlobalColleague(this);
  if (getModel() != null) {
    getModel().close();
  }
  IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
  if (synchronizer != null) {
    synchronizer.removeListener(IReportResourceChangeEvent.LibraySaveChange | IReportResourceChangeEvent.ImageResourceChange,this);
  }
  PlatformUI.getWorkbench().removeWindowListener(windowListener);
  if (prefs != null) {
    prefs.removePreferenceChangeListener(preferenceChangeListener);
  }
  super.dispose();
}
Program: 70436
Project: 70436
Buggy source:
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  String text=textContent.getText();
  if (text != null) {
    if (text.length() == 0)     textContent.setText("String_Node_Str");
 else     transform(textContent);
  }
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  ContainerArea ancestor=parentLM;
  do {
    if (null == ancestor) {
      comp.setNewLineStatus(true);
      return;
    }
    if (!ancestor.isEmpty()) {
      comp.setNewLineStatus(false);
      return;
    }
    if (ancestor instanceof LineArea) {
      comp.setNewLineStatus(ancestor.isEmpty());
      return;
    }
    ancestor=ancestor.getParent();
  }
 while (true);
}

Fixed version (ground truth):
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  String text=textContent.getText();
  if (text != null && text.length() != 0)   transform(textContent);
 else   textContent.setText("String_Node_Str");
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  ContainerArea ancestor=parentLM;
  do {
    if (null == ancestor) {
      comp.setNewLineStatus(true);
      return;
    }
    if (!ancestor.isEmpty()) {
      comp.setNewLineStatus(false);
      return;
    }
    if (ancestor instanceof LineArea) {
      comp.setNewLineStatus(ancestor.isEmpty());
      return;
    }
    ancestor=ancestor.getParent();
  }
 while (true);
}
Program: 70437
Project: 70437
Buggy source:
/** 
 * return all emitter info through BIRT engine emitter extension
 * @return all emitter info through BIRT engine emitter extension
 */
public EmitterInfo[] getEmitterInfo(){
  return extensionMgr.getEmitterInfo();
}

Fixed version (ground truth):
/** 
 * return all emitter info through BIRT engine emitter extension. If there are several emitters for a same format, then the default emitter specified by EngineConfig is used, if no default emitter is specified in EngineConfig, then the first emitter is used.
 * @return all emitter info through BIRT engine emitter extension
 */
public EmitterInfo[] getEmitterInfo(){
  if (emitterInfos == null) {
    EngineConfig config=engine.getConfig();
    Map<String,EmitterInfo> emitters=new HashMap<String,EmitterInfo>();
    EmitterInfo[] tempEmitterInfo=extensionMgr.getEmitterInfo();
    for (    EmitterInfo emitterInfo : tempEmitterInfo) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      if (!emitters.containsKey(format) || id.equals(config.getDefaultEmitter(format))) {
        emitters.put(format,emitterInfo);
      }
    }
    emitterInfos=new EmitterInfo[emitters.size()];
    emitters.values().toArray(emitterInfos);
    for (    EmitterInfo emitterInfo : emitterInfos) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      String defaultEmitter=config.getDefaultEmitter(format);
      if (defaultEmitter != null && !defaultEmitter.equals(id)) {
        logger.log(Level.WARNING,"String_Node_Str" + defaultEmitter + "String_Node_Str"+ id+ "String_Node_Str"+ format+ "String_Node_Str");
      }
    }
  }
  return emitterInfos;
}
Program: 70440
Project: 70440
Buggy source:
/** 
 * @see AbstractTextEditor#doSave(IProgressMonitor)
 */
public void doSave(IProgressMonitor monitor){
  saveModel();
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor,boolean chnageText){
  isSaveScript=!chnageText;
  saveModel();
  isSaveScript=false;
}
Program: 70441
Project: 70441
Buggy source:
/** 
 * Saves input code to model
 */
private void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle) {
    saveEditorContentsDE((DesignElementHandle)editObject);
  }
  setIsModified(false);
  ((IFormPage)getParentEditor()).getEditor().editorDirtyStateChanged();
  firePropertyChange(PROP_DIRTY);
  SourceViewer viewer=getViewer();
  IUndoManager undoManager=viewer == null ? null : viewer.getUndoManager();
  if (undoManager != null) {
    undoManager.endCompoundChange();
  }
  cleanPoint=getUndoLevel();
}

Fixed version (ground truth):
/** 
 * Saves input code to model
 */
private void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle && !isSaveScript) {
    saveEditorContentsDE((DesignElementHandle)editObject);
  }
  setIsModified(false);
  ((IFormPage)getParentEditor()).getEditor().editorDirtyStateChanged();
  firePropertyChange(PROP_DIRTY);
  SourceViewer viewer=getViewer();
  IUndoManager undoManager=viewer == null ? null : viewer.getUndoManager();
  if (undoManager != null) {
    undoManager.endCompoundChange();
  }
  cleanPoint=getUndoLevel();
}
Program: 70442
Project: 70442
Buggy source:
public void doSave(IProgressMonitor monitor){
  jsEditor.doSave(monitor);
  IReportProvider provider=getProvider();
  if (provider != null) {
    provider.saveReport(getReportModel(),getEditorInput(),monitor);
    firePropertyChange(PROP_DIRTY);
  }
  markPageStale(IPageStaleType.NONE);
  getEditor().editorDirtyStateChanged();
  UIUtil.doFinishSava(getReportModel());
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (jsEditor instanceof JSEditor) {
    ((JSEditor)jsEditor).doSave(monitor,false);
  }
 else {
    jsEditor.doSave(monitor);
  }
  IReportProvider provider=getProvider();
  if (provider != null) {
    provider.saveReport(getReportModel(),getEditorInput(),monitor);
    firePropertyChange(PROP_DIRTY);
  }
  markPageStale(IPageStaleType.NONE);
  getEditor().editorDirtyStateChanged();
  UIUtil.doFinishSava(getReportModel());
}
Program: 70443
Project: 70443
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
  previouPage=prePage;
  IMediatorState state=SessionHandleAdapter.getInstance().getMediator().getCurrentState();
  ReportRequest request=new ReportRequest(state.getSource());
  List list=state.getSelectionObject();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
  jsEditor.setFocus();
  previouPage=prePage;
  IMediatorState state=SessionHandleAdapter.getInstance().getMediator().getCurrentState();
  ReportRequest request=new ReportRequest(state.getSource());
  List list=state.getSelectionObject();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}
Program: 70446
Project: 70446
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefns
 * @throws DataException
 */
void populateCachedDataSets(DataEngineImpl dataEngine,IDataQueryDefinition[] queryDefns) throws DataException {
  this.cachedDataSetNames.clear();
  if (queryDefns != null) {
    List temp=new ArrayList();
    for (int i=0; i < queryDefns.length; i++) {
      if (queryDefns[i] instanceof IQueryDefinition) {
        IQueryDefinition qd=(IQueryDefinition)queryDefns[i];
        String dataSetName=qd.getDataSetName();
        if (dataSetName != null) {
          this.populateDataSetNames(dataEngine.getDataSetDesign(dataSetName),dataEngine,temp);
        }
      }
    }
    Set tempSet=new HashSet();
    for (int i=0; i < temp.size(); i++) {
      if (tempSet.contains(temp.get(i)))       this.cachedDataSetNames.add(temp.get(i));
 else       tempSet.add(temp.get(i));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefns
 * @throws DataException
 */
void populateCachedDataSets(DataEngineImpl dataEngine,IDataQueryDefinition[] queryDefns) throws DataException {
  if (queryDefns != null) {
    List temp=new ArrayList();
    for (int i=0; i < queryDefns.length; i++) {
      if (queryDefns[i] instanceof IQueryDefinition) {
        IQueryDefinition qd=(IQueryDefinition)queryDefns[i];
        String dataSetName=qd.getDataSetName();
        if (dataSetName != null) {
          this.populateDataSetNames(dataEngine.getDataSetDesign(dataSetName),dataEngine,temp);
        }
      }
    }
    Set tempSet=new HashSet();
    for (int i=0; i < temp.size(); i++) {
      if (tempSet.contains(temp.get(i)))       this.cachedDataSetNames.add(temp.get(i));
 else       tempSet.add(temp.get(i));
    }
  }
}
Program: 70447
Project: 70447
Buggy source:
public static void initFileHandler(String sLogFolder) throws SecurityException, IOException {
  if (sLogFolder.length() > 0 && sLogFolder.lastIndexOf(File.separator) == sLogFolder.length() - 1) {
    sLogFolder=sLogFolder.substring(0,sLogFolder.length() - 1);
  }
  final String sName=ChartEnginePlugin.ID + new SimpleDateFormat("String_Node_Str").format(new Date());
  final String sDir=sLogFolder;
  try {
    fileHandler=AccessController.doPrivileged(new PrivilegedExceptionAction<FileHandler>(){
      public FileHandler run() throws Exception {
        FileHandler fileHandler=new FileHandler(sDir + File.separator + sName+ "String_Node_Str",true);
        fileHandler.setFormatter(new SimpleFormatter());
        fileHandler.setLevel(Level.FINEST);
        return fileHandler;
      }
    }
);
  }
 catch (  PrivilegedActionException e) {
    Exception typedException=e.getException();
    if (typedException instanceof SecurityException) {
      throw (SecurityException)typedException;
    }
 else     if (typedException instanceof IOException) {
      throw (IOException)typedException;
    }
  }
}

Fixed version (ground truth):
public static void initFileHandler(String sLogFolder,final Level level) throws SecurityException, IOException {
  if (sLogFolder.length() > 0 && sLogFolder.lastIndexOf(File.separator) == sLogFolder.length() - 1) {
    sLogFolder=sLogFolder.substring(0,sLogFolder.length() - 1);
  }
  final String sName=ChartEnginePlugin.ID + new SimpleDateFormat("String_Node_Str").format(new Date());
  final String sDir=sLogFolder;
  try {
    fileHandler=AccessController.doPrivileged(new PrivilegedExceptionAction<FileHandler>(){
      public FileHandler run() throws Exception {
        Level logLevel=level != null ? level : Level.FINEST;
        FileHandler fileHandler=new FileHandler(sDir + File.separator + sName+ "String_Node_Str",true);
        fileHandler.setFormatter(new SimpleFormatter());
        fileHandler.setLevel(logLevel);
        return fileHandler;
      }
    }
);
  }
 catch (  PrivilegedActionException e) {
    Exception typedException=e.getException();
    if (typedException instanceof SecurityException) {
      throw (SecurityException)typedException;
    }
 else     if (typedException instanceof IOException) {
      throw (IOException)typedException;
    }
  }
}
Program: 70448
Project: 70448
Buggy source:
public FileHandler run() throws Exception {
  FileHandler fileHandler=new FileHandler(sDir + File.separator + sName+ "String_Node_Str",true);
  fileHandler.setFormatter(new SimpleFormatter());
  fileHandler.setLevel(Level.FINEST);
  return fileHandler;
}

Fixed version (ground truth):
public FileHandler run() throws Exception {
  Level logLevel=level != null ? level : Level.FINEST;
  FileHandler fileHandler=new FileHandler(sDir + File.separator + sName+ "String_Node_Str",true);
  fileHandler.setFormatter(new SimpleFormatter());
  fileHandler.setLevel(logLevel);
  return fileHandler;
}
Program: 70449
Project: 70449
Buggy source:
@Override public void start(BundleContext context) throws Exception {
  super.start(context);
  try {
    JavaUtilLoggerImpl.initFileHandler(this.getStateLocation().toOSString());
  }
 catch (  SecurityException e) {
    logger.log(e);
  }
catch (  IOException e) {
    logger.log(e);
  }
}

Fixed version (ground truth):
@Override public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}
Program: 70450
Project: 70450
Buggy source:
/** 
 * Returns a singleton instance of the plugin settings framework with specific configuration. Initializes the OSGi Platform framework to load chart extension bundles unless the STANDALONE flag was set in PlatformConfig property.
 * @return A singleton instance of the plugin settings framework
 */
public static synchronized PluginSettings instance(PlatformConfig config){
  if (ps == null) {
    ps=new PluginSettings();
    ps.bStandalone=config != null && config.getProperty("String_Node_Str") != null;
    if (!ps.bStandalone) {
      try {
        Platform.startup(config);
      }
 catch (      BirtException e) {
        logger.log(e);
      }
    }
  }
  return ps;
}

Fixed version (ground truth):
/** 
 * Returns a singleton instance of the plugin settings framework with specific configuration. Initializes the OSGi Platform framework to load chart extension bundles unless the STANDALONE flag was set in PlatformConfig property.
 * @return A singleton instance of the plugin settings framework
 */
public static synchronized PluginSettings instance(PlatformConfig config){
  if (ps == null) {
    ps=new PluginSettings();
    if (config != null) {
      ps.bStandalone=config.getProperty(PROP_STANDALONE) != null;
      String loggingDir=(String)config.getProperty(PROP_LOGGING_DIR);
      Level loggingLevel=(Level)config.getProperty(PROP_LOGGING_LEVEL);
      initFileLogger(loggingDir,loggingLevel);
    }
    if (!ps.bStandalone) {
      try {
        Platform.startup(config);
      }
 catch (      BirtException e) {
        logger.log(e);
      }
    }
  }
  return ps;
}
Program: 70451
Project: 70451
Buggy source:
protected void set(Series src){
  if (src.getLabel() != null) {
    setLabel(src.getLabel().copyInstance());
  }
  if (src.getDataDefinition() != null) {
    EList<Query> list=getDataDefinition();
    for (    Query element : src.getDataDefinition()) {
      list.add(element.copyInstance());
    }
  }
  if (src.getDataPoint() != null) {
    setDataPoint(src.getDataPoint().copyInstance());
  }
  if (src.getDataSets() != null) {
    EMap<String,DataSet> map=getDataSets();
    for (    Map.Entry<String,DataSet> entry : src.getDataSets().entrySet()) {
      map.put(entry.getKey(),entry.getValue().copyInstance());
    }
  }
  if (src.getTriggers() != null) {
    EList<Trigger> list=getTriggers();
    for (    Trigger element : src.getTriggers()) {
      list.add(element.copyInstance());
    }
  }
  if (src.getCurveFitting() != null) {
    setCurveFitting(src.getCurveFitting().copyInstance());
  }
  if (src.getCursor() != null) {
    setCursor(src.getCursor().copyInstance());
  }
  visible=src.isVisible();
  visibleESet=src.isSetVisible();
  seriesIdentifier=src.getSeriesIdentifier();
  labelPosition=src.getLabelPosition();
  labelPositionESet=src.isSetLabelPosition();
  stacked=src.isStacked();
  stackedESet=src.isSetStacked();
  translucent=src.isTranslucent();
  translucentESet=src.isSetTranslucent();
}

Fixed version (ground truth):
protected void set(Series src){
  if (src.getLabel() != null) {
    setLabel(src.getLabel().copyInstance());
  }
  if (src.getDataDefinition() != null) {
    EList<Query> list=getDataDefinition();
    for (    Query element : src.getDataDefinition()) {
      list.add(element.copyInstance());
    }
  }
  if (src.getDataPoint() != null) {
    setDataPoint(src.getDataPoint().copyInstance());
  }
  if (src.getDataSets() != null) {
    EMap<String,DataSet> map=getDataSets();
    for (    Map.Entry<String,DataSet> entry : src.getDataSets().entrySet()) {
      DataSet entryValue=entry.getValue() != null ? entry.getValue().copyInstance() : null;
      map.put(entry.getKey(),entryValue);
    }
  }
  if (src.getTriggers() != null) {
    EList<Trigger> list=getTriggers();
    for (    Trigger element : src.getTriggers()) {
      list.add(element.copyInstance());
    }
  }
  if (src.getCurveFitting() != null) {
    setCurveFitting(src.getCurveFitting().copyInstance());
  }
  if (src.getCursor() != null) {
    setCursor(src.getCursor().copyInstance());
  }
  visible=src.isVisible();
  visibleESet=src.isSetVisible();
  seriesIdentifier=src.getSeriesIdentifier();
  labelPosition=src.getLabelPosition();
  labelPositionESet=src.isSetLabelPosition();
  stacked=src.isStacked();
  stackedESet=src.isSetStacked();
  translucent=src.isTranslucent();
  translucentESet=src.isSetTranslucent();
}
Program: 70452
Project: 70452
Buggy source:
public DataSet getDataSet(String userkey){
  return (DataSet)getDataSets().get(userkey);
}

Fixed version (ground truth):
public DataSet getDataSet(String userkey){
  return getDataSets().get(userkey);
}
Program: 70453
Project: 70453
Buggy source:
/** 
 * Tests the method to get relative path. Test cases: <ul> <li>1. absolute base path <li>2. relative base path </ul>
 */
public void testResolveAbsolutePath(){
  if (isWindowsPlatform())   resolveAbsolutePathOnWindows();
 else   resolveAbsolutePathOnUnix();
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests the method to get relative path. Test cases: <ul> <li>1. absolute base path <li>2. relative base path </ul>
 */
public void testResolveAbsolutePath(){
  if (isWindowsPlatform())   resolveAbsolutePathOnWindows();
 else   resolveAbsolutePathOnUnix();
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",URIUtil.resolveAbsolutePath("String_Node_Str","String_Node_Str"));
}