nus-yam/ex-repair huggingface dataset:
Program: 76596
Project: 76596
Buggy source:
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_fieldCount=projectedColumns.size();
  projectedCols=new ResultFieldMetadata[m_fieldCount];
  nameToIdMapping=new HashMap();
  this.originalAnyTypeField=new ArrayList();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    projectedCols[i]=(ResultFieldMetadata)projectedColumns.get(i);
    ResultFieldMetadata column=projectedCols[i];
    if (isOfAnyType(column)) {
      this.hasAny=true;
      this.originalAnyTypeField.add(Integer.valueOf(i + 1));
    }
    String upperCaseName=column.getName();
    Integer index=new Integer(i + 1);
    if (!nameToIdMapping.containsKey(upperCaseName)) {
      nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !nameToIdMapping.containsKey(upperCaseAlias)) {
      nameToIdMapping.put(upperCaseAlias,index);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_fieldCount=projectedColumns.size();
  projectedCols=new ResultFieldMetadata[m_fieldCount];
  nameToIdMapping=new HashMap();
  this.originalAnyTypeField=new ArrayList();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    projectedCols[i]=(ResultFieldMetadata)projectedColumns.get(i);
    ResultFieldMetadata column=projectedCols[i];
    if (isOfAnyType(column)) {
      this.hasAny=true;
      this.originalAnyTypeField.add(new Integer(i + 1));
    }
    String upperCaseName=column.getName();
    Integer index=new Integer(i + 1);
    if (!nameToIdMapping.containsKey(upperCaseName)) {
      nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !nameToIdMapping.containsKey(upperCaseAlias)) {
      nameToIdMapping.put(upperCaseAlias,index);
    }
  }
}
Program: 76597
Project: 76597
Buggy source:
public void setProperty(String name,String value) throws OdaException {
  if (name == null)   throw new NullPointerException("String_Node_Str");
  if (name.equals("String_Node_Str")) {
    if (value != null && value.length() > 0) {
      try {
        double secs=Double.parseDouble(value);
        this.preStat.setQueryTimeout((int)secs);
      }
 catch (      SQLException e) {
        logger.log(Level.FINE,"String_Node_Str",e);
      }
    }
  }
 else {
    OdaException e=new OdaException("String_Node_Str" + name);
    logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
public void setProperty(String name,String value) throws OdaException {
  if (name == null)   throw new NullPointerException("String_Node_Str");
  if (name.equals("String_Node_Str")) {
    if (value != null && value.length() > 0) {
      try {
        double secs=Double.parseDouble(value);
        this.preStat.setQueryTimeout((int)secs);
      }
 catch (      SQLException e) {
        logger.log(Level.FINE,"String_Node_Str",e);
      }
    }
  }
 else   if (name.equals(ConnectionProfileProperty.PROFILE_NAME_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PROP_KEY) || name.equals(ConnectionProfileProperty.PROFILE_STORE_FILE_PATH_PROP_KEY)) {
  }
 else {
    OdaException e=new OdaException("String_Node_Str" + name);
    logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
}
Program: 76599
Project: 76599
Buggy source:
/** 
 * Test cases: Test the getAllBookmarks method on the ModuleHandle which returns all the bookmarks defined in the report design.
 * @throws Exception
 */
public void testGetBookmarksAndTocs() throws Exception {
  openDesign("String_Node_Str");
  List bookmarks=designHandle.getAllBookmarks();
  assertEquals(3,bookmarks.size());
  assertEquals("String_Node_Str",bookmarks.get(0));
  assertEquals("String_Node_Str",bookmarks.get(1));
  assertEquals("String_Node_Str",bookmarks.get(2));
  List tocs=designHandle.getAllTocs();
  assertEquals(3,tocs.size());
  assertEquals("String_Node_Str",tocs.get(0));
  assertEquals("String_Node_Str",tocs.get(1));
  assertEquals("String_Node_Str",tocs.get(2));
}

Fixed version (ground truth):
/** 
 * Test cases: Test the getAllBookmarks method on the ModuleHandle which returns all the bookmarks defined in the report design.
 * @throws Exception
 */
public void testGetBookmarksAndTocs() throws Exception {
  openDesign("String_Node_Str");
  List bookmarks=designHandle.getAllBookmarks();
  assertEquals(4,bookmarks.size());
  assertEquals("String_Node_Str",bookmarks.get(0));
  assertEquals("String_Node_Str",bookmarks.get(1));
  assertEquals("String_Node_Str",bookmarks.get(2));
  assertEquals("String_Node_Str",bookmarks.get(3));
  List tocs=designHandle.getAllTocs();
  assertEquals(3,tocs.size());
  assertEquals("String_Node_Str",tocs.get(0));
  assertEquals("String_Node_Str",tocs.get(1));
  assertEquals("String_Node_Str",tocs.get(2));
}
Program: 76600
Project: 76600
Buggy source:
protected void parseRenderOptions() throws Exception {
  assert(mode.equalsIgnoreCase("String_Node_Str"));
  if (results.hasOption('f')) {
    format=results.getOptionValue('f');
  }
  if (results.hasOption('t')) {
    htmlType=results.getOptionValue('t');
  }
  if (results.hasOption('o')) {
    targetFile=results.getOptionValue('o');
  }
  if (results.hasOption('l')) {
    locale=results.getOptionValue('l');
  }
  if (results.hasOption('e')) {
    encoding=results.getOptionValue('e');
  }
  if (results.hasOption('p')) {
    pageNumber=Long.parseLong(results.getOptionValue('p'));
  }
  parseParameterOptions();
}

Fixed version (ground truth):
protected void parseRenderOptions() throws Exception {
  assert(mode.equalsIgnoreCase("String_Node_Str"));
  if (results.hasOption('f')) {
    format=results.getOptionValue('f');
  }
  if (results.hasOption('t')) {
    htmlType=results.getOptionValue('t');
  }
  if (results.hasOption('o')) {
    targetFile=results.getOptionValue('o');
  }
  if (results.hasOption('l')) {
    locale=results.getOptionValue('l');
  }
  if (results.hasOption('e')) {
    encoding=results.getOptionValue('e');
  }
  if (results.hasOption('p')) {
    String paramPageNumber=results.getOptionValue('p');
    try {
      pageNumber=Long.parseLong(paramPageNumber);
    }
 catch (    NumberFormatException nfe) {
      logger.log(Level.SEVERE,"String_Node_Str" + paramPageNumber + "String_Node_Str");
    }
  }
  parseParameterOptions();
}
Program: 76601
Project: 76601
Buggy source:
/** 
 * Initializes the data view page.
 */
protected void initPage(){
  createContextMenus();
  treeViewer.setSorter(new ItemSorter());
  treeViewer.getTree().addMouseTrackListener(new MouseTrackAdapter(){
    public void mouseHover(    MouseEvent event){
      Widget widget=event.widget;
      if (widget == treeViewer.getTree()) {
        Point pt=new Point(event.x,event.y);
        TreeItem item=treeViewer.getTree().getItem(pt);
        treeViewer.getTree().setToolTipText(getTooltip(item));
      }
    }
  }
);
  IEclipsePreferences rootNode=(IEclipsePreferences)Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE);
  final String reportName=ReportPlugin.getDefault().getBundle().getSymbolicName();
  try {
    if (rootNode.nodeExists(reportName)) {
      reportPreferenceNode=(IEclipsePreferences)rootNode.node(reportName);
      reportPreferenceNode.addPreferenceChangeListener(this);
    }
  }
 catch (  BackingStoreException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the data view page.
 */
protected void initPage(){
  createContextMenus();
  treeViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof LibraryHandle) {
        return 1;
      }
      return super.category(element);
    }
  }
);
  treeViewer.getTree().addMouseTrackListener(new MouseTrackAdapter(){
    public void mouseHover(    MouseEvent event){
      Widget widget=event.widget;
      if (widget == treeViewer.getTree()) {
        Point pt=new Point(event.x,event.y);
        TreeItem item=treeViewer.getTree().getItem(pt);
        treeViewer.getTree().setToolTipText(getTooltip(item));
      }
    }
  }
);
  IEclipsePreferences rootNode=(IEclipsePreferences)Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE);
  final String reportName=ReportPlugin.getDefault().getBundle().getSymbolicName();
  try {
    if (rootNode.nodeExists(reportName)) {
      reportPreferenceNode=(IEclipsePreferences)rootNode.node(reportName);
      reportPreferenceNode.addPreferenceChangeListener(this);
    }
  }
 catch (  BackingStoreException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 76603
Project: 76603
Buggy source:
/** 
 * shuts down the report engine
 */
public void destroy();

Fixed version (ground truth):
/** 
 * shut down the engine, release all the resources.
 */
public void destroy();
Program: 76604
Project: 76604
Buggy source:
/** 
 * shut down the engine, release all the resources.
 */
public void shutdown();

Fixed version (ground truth):
/** 
 * shut down the engine, release all the resources.
 * @deprecated
 */
public void shutdown();
Program: 76605
Project: 76605
Buggy source:
/** 
 * shut down the engine, release all the resources.
 */
public void shutdown(){
  engine.shutdown();
}

Fixed version (ground truth):
/** 
 * shut down the engine, release all the resources.
 * @deprecated
 */
public void shutdown(){
  engine.shutdown();
}
Program: 76606
Project: 76606
Buggy source:
/** 
 * shut down the engine, release all the resources.
 */
public void shutdown(){
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * shut down the engine, release all the resources.
 * @deprecated
 */
public void shutdown(){
  destroy();
}
Program: 76610
Project: 76610
Buggy source:
public void keyReleased(KeyEvent e){
  cancelTimer();
  if (e.keyCode == SWT.F2 && e.stateMask == 0) {
    if (selectedItem != null) {
      new RenameAction(sourceViewer).run();
    }
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
  cancelTimer();
  if (e.keyCode == SWT.F2 && e.stateMask == 0) {
    if (selectedItem != null) {
      RenameAction action=new RenameAction(sourceViewer);
      if (action.isEnabled() && action.isHandled())       action.run();
    }
  }
}
Program: 76612
Project: 76612
Buggy source:
/** 
 * Returns a localized message based on an error code. Overwrite this method if you do not want to pass in the resource bundle
 * @param errorCode the error code
 * @return Localized display message.
 */
protected String getLocalizedMessage(String errorCode){
  String localizedMessage;
  Locale locale=null;
  if (rb == null) {
    localizedMessage="String_Node_Str" + errorCode;
  }
 else {
    locale=rb.getLocale();
    try {
      localizedMessage=rb.getString(errorCode);
    }
 catch (    Exception e) {
      localizedMessage=errorCode;
    }
  }
  try {
    MessageFormat form=new MessageFormat(localizedMessage,locale == null ? Locale.getDefault() : locale);
    return form.format(oaMessageArguments);
  }
 catch (  Throwable ex) {
    return localizedMessage;
  }
}

Fixed version (ground truth):
/** 
 * Returns a localized message based on an error code. Overwrite this method if you do not want to pass in the resource bundle
 * @param errorCode the error code
 * @return Localized display message.
 */
protected String getLocalizedMessage(String errorCode){
  String localizedMessage;
  Locale locale=null;
  if (rb == null) {
    localizedMessage=errorCode;
  }
 else {
    locale=rb.getLocale();
    try {
      localizedMessage=rb.getString(errorCode);
    }
 catch (    Exception e) {
      localizedMessage=errorCode;
    }
  }
  try {
    MessageFormat form=new MessageFormat(localizedMessage,locale == null ? Locale.getDefault() : locale);
    return form.format(oaMessageArguments);
  }
 catch (  Throwable ex) {
    return localizedMessage;
  }
}
Program: 76614
Project: 76614
Buggy source:
/** 
 * Determine the report design and doc 's timestamp
 * @param request
 * @throws Exception
 */
protected void processReport(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(this.requestType) || IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath()))   return;
  File reportDocFile=new File(this.reportDocumentName);
  long lastModifiedOfDesign=getLastModifiedOfDesign(request);
  if (lastModifiedOfDesign != -1L && reportDocFile != null && reportDocFile.exists() && reportDocFile.isFile()) {
    if (lastModifiedOfDesign > reportDocFile.lastModified() || ParameterAccessor.isOverwrite(request)) {
      reportDocFile.delete();
    }
  }
}

Fixed version (ground truth):
/** 
 * Determine the report design and doc 's timestamp
 * @param request
 * @throws Exception
 */
protected void processReport(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(this.requestType) || IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath()))   return;
  if (this.reportDocumentName == null)   return;
  File reportDocFile=new File(this.reportDocumentName);
  long lastModifiedOfDesign=getLastModifiedOfDesign(request);
  if (lastModifiedOfDesign != -1L && reportDocFile != null && reportDocFile.exists() && reportDocFile.isFile()) {
    if (lastModifiedOfDesign > reportDocFile.lastModified() || ParameterAccessor.isOverwrite(request)) {
      reportDocFile.delete();
    }
  }
}
Program: 76617
Project: 76617
Buggy source:
/** 
 * If set isWorkingFolderAccessOnly as true, check the file if exist in working folder.
 * @param filePath
 * @return boolean
 */
public static boolean isValidFilePath(String filePath){
}

Fixed version (ground truth):
/** 
 * If set isWorkingFolderAccessOnly as true, check the file if exist in working folder.
 * @param filePath
 * @return boolean
 */
public static boolean isValidFilePath(String filePath){
  if (filePath == null)   return false;
  if (isWorkingFolderAccessOnly) {
    File docFile=new File(filePath);
    if (!docFile.isAbsolute())     return true;
    File docFolder=new File(workingFolder);
    if (docFolder.isAbsolute()) {
      String absolutePath=docFile.getAbsolutePath();
      String docFolderPath=docFolder.getAbsolutePath();
      if (isWindowsPlatform()) {
        absolutePath=absolutePath.toLowerCase();
        docFolderPath=docFolderPath.toLowerCase();
      }
      return absolutePath.startsWith(docFolderPath);
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 76618
Project: 76618
Buggy source:
public void visitGraphicMasterPage(GraphicMasterPageHandle handle){
  GraphicMasterPageDesign page=new GraphicMasterPageDesign();
  setupMasterPage(page,handle);
  page.setColumns(handle.getColumnCount());
  DimensionType spacing=createDimension(handle.getColumnSpacing());
  page.setColumnSpacing(spacing);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      page.addContent((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
  Assert.isTrue(false,"String_Node_Str");
}

Fixed version (ground truth):
public void visitGraphicMasterPage(GraphicMasterPageHandle handle){
  GraphicMasterPageDesign page=new GraphicMasterPageDesign();
  setupMasterPage(page,handle);
  page.setColumns(handle.getColumnCount());
  DimensionType spacing=createDimension(handle.getColumnSpacing(),true);
  page.setColumnSpacing(spacing);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      page.addContent((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
  Assert.isTrue(false,"String_Node_Str");
}
Program: 76619
Project: 76619
Buggy source:
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupStyledElement(col,handle);
  DimensionType width=createDimension(handle.getWidth());
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  setupHighlight(col,null);
  currentElement=col;
}

Fixed version (ground truth):
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupStyledElement(col,handle);
  DimensionType width=createDimension(handle.getWidth(),false);
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  setupHighlight(col,null);
  currentElement=col;
}
Program: 76620
Project: 76620
Buggy source:
/** 
 * setup the master page object from the base master page handle.
 * @param page page object
 * @param handle page handle
 */
private void setupMasterPage(MasterPageDesign page,MasterPageHandle handle){
  setupStyledElement(page,handle);
  page.setPageType(handle.getPageType());
  DimensionValue effectWidth=handle.getPageWidth();
  DimensionValue effectHeight=handle.getPageHeight();
  DimensionType width=null;
  DimensionType height=null;
  if (effectWidth != null) {
    width=new DimensionType(effectWidth.getMeasure(),effectWidth.getUnits());
  }
  if (effectHeight != null) {
    height=new DimensionType(effectHeight.getMeasure(),effectHeight.getUnits());
  }
  page.setPageSize(width,height);
  page.setOrientation(handle.getOrientation());
  DimensionType top=createDimension(handle.getTopMargin());
  DimensionType left=createDimension(handle.getLeftMargin());
  DimensionType bottom=createDimension(handle.getBottomMargin());
  DimensionType right=createDimension(handle.getRightMargin());
  page.setMargin(top,left,bottom,right);
}

Fixed version (ground truth):
/** 
 * setup the master page object from the base master page handle.
 * @param page page object
 * @param handle page handle
 */
private void setupMasterPage(MasterPageDesign page,MasterPageHandle handle){
  setupStyledElement(page,handle);
  page.setPageType(handle.getPageType());
  DimensionValue effectWidth=handle.getPageWidth();
  DimensionValue effectHeight=handle.getPageHeight();
  DimensionType width=null;
  DimensionType height=null;
  if (effectWidth != null) {
    width=new DimensionType(effectWidth.getMeasure(),effectWidth.getUnits());
  }
  if (effectHeight != null) {
    height=new DimensionType(effectHeight.getMeasure(),effectHeight.getUnits());
  }
  page.setPageSize(width,height);
  page.setOrientation(handle.getOrientation());
  DimensionType top=createDimension(handle.getTopMargin(),true);
  DimensionType left=createDimension(handle.getLeftMargin(),true);
  DimensionType bottom=createDimension(handle.getBottomMargin(),true);
  DimensionType right=createDimension(handle.getRightMargin(),true);
  page.setMargin(top,left,bottom,right);
}
Program: 76621
Project: 76621
Buggy source:
protected DimensionType createDimension(DimensionHandle handle){
  if (handle == null || !handle.isSet()) {
    return null;
  }
  if (handle.isKeyword()) {
    return new DimensionType(handle.getStringValue());
  }
  double measure=handle.getMeasure();
  String unit=handle.getUnits();
  return new DimensionType(measure,unit);
}

Fixed version (ground truth):
protected DimensionType createDimension(DimensionHandle handle,boolean useDefault){
  if (handle == null || !useDefault && !handle.isSet()) {
    return null;
  }
  if (handle.isKeyword()) {
    return new DimensionType(handle.getStringValue());
  }
  double measure=handle.getMeasure();
  String unit=handle.getUnits();
  return new DimensionType(measure,unit);
}
Program: 76622
Project: 76622
Buggy source:
/** 
 * setup the attribute of report item
 * @param item Engine's Report Item
 * @param handle DE's report item.
 */
private void setupReportItem(ReportItemDesign item,ReportItemHandle handle){
  setupStyledElement(item,handle);
  DimensionType height=createDimension(handle.getHeight());
  DimensionType width=createDimension(handle.getWidth());
  DimensionType x=createDimension(handle.getX());
  DimensionType y=createDimension(handle.getY());
  item.setHeight(height);
  item.setWidth(width);
  item.setX(x);
  item.setY(y);
  String toc=handle.getTocExpression();
  item.setTOC(createExpression(toc));
  String bookmark=handle.getBookmark();
  item.setBookmark(createExpression(bookmark));
  String onCreate=handle.getOnCreate();
  item.setOnCreate(createExpression(onCreate));
  item.setOnRender(handle.getOnRender());
  item.setOnPageBreak(handle.getOnPageBreak());
  Iterator visibilityIter=handle.visibilityRulesIterator();
  VisibilityDesign visibility=createVisibility(visibilityIter);
  item.setVisibility(visibility);
  setupHighlight(item,null);
}

Fixed version (ground truth):
/** 
 * setup the attribute of report item
 * @param item Engine's Report Item
 * @param handle DE's report item.
 */
private void setupReportItem(ReportItemDesign item,ReportItemHandle handle){
  setupStyledElement(item,handle);
  DimensionType height=createDimension(handle.getHeight(),false);
  DimensionType width=createDimension(handle.getWidth(),false);
  DimensionType x=createDimension(handle.getX(),false);
  DimensionType y=createDimension(handle.getY(),false);
  item.setHeight(height);
  item.setWidth(width);
  item.setX(x);
  item.setY(y);
  String toc=handle.getTocExpression();
  item.setTOC(createExpression(toc));
  String bookmark=handle.getBookmark();
  item.setBookmark(createExpression(bookmark));
  String onCreate=handle.getOnCreate();
  item.setOnCreate(createExpression(onCreate));
  item.setOnRender(handle.getOnRender());
  item.setOnPageBreak(handle.getOnPageBreak());
  Iterator visibilityIter=handle.visibilityRulesIterator();
  VisibilityDesign visibility=createVisibility(visibilityIter);
  item.setVisibility(visibility);
  setupHighlight(item,null);
}
Program: 76623
Project: 76623
Buggy source:
public void visitSimpleMasterPage(SimpleMasterPageHandle handle){
  SimpleMasterPageDesign page=new SimpleMasterPageDesign();
  setupMasterPage(page,handle);
  page.setHeaderHeight(createDimension(handle.getHeaderHeight()));
  page.setFooterHeight(createDimension(handle.getFooterHeight()));
  page.setShowFooterOnLast(handle.showFooterOnLast());
  page.setShowHeaderOnFirst(handle.showHeaderOnFirst());
  page.setFloatingFooter(handle.isFloatingFooter());
  SlotHandle headerSlot=handle.getPageHeader();
  for (int i=0; i < headerSlot.getCount(); i++) {
    apply(headerSlot.get(i));
    if (currentElement != null) {
      page.addHeader((ReportItemDesign)currentElement);
    }
  }
  SlotHandle footerSlot=handle.getPageFooter();
  for (int i=0; i < footerSlot.getCount(); i++) {
    apply(footerSlot.get(i));
    if (currentElement != null) {
      page.addFooter((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
}

Fixed version (ground truth):
public void visitSimpleMasterPage(SimpleMasterPageHandle handle){
  SimpleMasterPageDesign page=new SimpleMasterPageDesign();
  setupMasterPage(page,handle);
  page.setHeaderHeight(createDimension(handle.getHeaderHeight(),true));
  page.setFooterHeight(createDimension(handle.getFooterHeight(),true));
  page.setShowFooterOnLast(handle.showFooterOnLast());
  page.setShowHeaderOnFirst(handle.showHeaderOnFirst());
  page.setFloatingFooter(handle.isFloatingFooter());
  SlotHandle headerSlot=handle.getPageHeader();
  for (int i=0; i < headerSlot.getCount(); i++) {
    apply(headerSlot.get(i));
    if (currentElement != null) {
      page.addHeader((ReportItemDesign)currentElement);
    }
  }
  SlotHandle footerSlot=handle.getPageFooter();
  for (int i=0; i < footerSlot.getCount(); i++) {
    apply(footerSlot.get(i));
    if (currentElement != null) {
      page.addFooter((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
}
Program: 76624
Project: 76624
Buggy source:
public void visitRow(RowHandle handle){
  RowDesign row=new RowDesign();
  setupStyledElement(row,handle);
  DimensionType height=createDimension(handle.getHeight());
  row.setHeight(height);
  String bookmark=handle.getBookmark();
  row.setBookmark(createExpression(bookmark));
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  row.setVisibility(visibility);
  SlotHandle cellSlot=handle.getCells();
  for (int i=0; i < cellSlot.getCount(); i++) {
    apply(cellSlot.get(i));
    if (currentElement != null) {
      row.addCell((CellDesign)currentElement);
    }
  }
  String onCreate=handle.getOnCreate();
  row.setOnCreate(createExpression(onCreate));
  row.setOnRender(((RowHandle)handle).getOnRender());
  setupHighlight(row,null);
  currentElement=row;
}

Fixed version (ground truth):
public void visitRow(RowHandle handle){
  RowDesign row=new RowDesign();
  setupStyledElement(row,handle);
  DimensionType height=createDimension(handle.getHeight(),false);
  row.setHeight(height);
  String bookmark=handle.getBookmark();
  row.setBookmark(createExpression(bookmark));
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  row.setVisibility(visibility);
  SlotHandle cellSlot=handle.getCells();
  for (int i=0; i < cellSlot.getCount(); i++) {
    apply(cellSlot.get(i));
    if (currentElement != null) {
      row.addCell((CellDesign)currentElement);
    }
  }
  String onCreate=handle.getOnCreate();
  row.setOnCreate(createExpression(onCreate));
  row.setOnRender(((RowHandle)handle).getOnRender());
  setupHighlight(row,null);
  currentElement=row;
}
Program: 76625
Project: 76625
Buggy source:
/** 
 * Test compatibility of page breaks.
 * @throws Exception
 */
public void testCompatibilityOfPageBreaks() throws Exception {
  openDesign("String_Node_Str");
  TableHandle table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_ALWAYS,((GroupHandle)table.getGroups().get(0)).getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_AUTO,table.getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals(DesignChoiceConstants.PAGE_BREAK_BEFORE_ALWAYS,table.getProperty(IStyleModel.PAGE_BREAK_BEFORE_PROP));
}

Fixed version (ground truth):
/** 
 * Test compatibility of page breaks.
 * @throws Exception
 */
public void testCompatibilityOfPageBreaks() throws Exception {
  openDesign("String_Node_Str");
  TableHandle table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_AUTO,table.getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals(DesignChoiceConstants.PAGE_BREAK_BEFORE_ALWAYS,table.getProperty(IStyleModel.PAGE_BREAK_BEFORE_PROP));
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_AUTO,((GroupHandle)table.getGroups().get(0)).getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals("String_Node_Str",((GroupHandle)table.getGroups().get(0)).getHeader().get(0).getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_ALWAYS,((GroupHandle)table.getGroups().get(0)).getFooter().get(0).getProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
}
Program: 76626
Project: 76626
Buggy source:
/** 
 * Returns line number in design file, where error is found. Note: For INVALID_XML, the line number is not accurate. Basically, the error can be found after the indicated line a bit.
 * @return line number in design file
 */
public int getLineNo(){
  if (lineNo == 0) {
    Module root=element.getRoot();
    if (root != null)     return root.getLineNo(element);
 else     return 1;
  }
 else   return lineNo;
}

Fixed version (ground truth):
/** 
 * Returns line number in design file, where error is found. Note: For INVALID_XML, the line number is not accurate. Basically, the error can be found after the indicated line a bit.
 * @return line number in design file
 */
public int getLineNo(){
  if (lineNo == 0) {
    if (element == null)     return 1;
    Module root=element.getRoot();
    if (root != null)     return root.getLineNo(element);
 else     return 1;
  }
 else   return lineNo;
}
Program: 76627
Project: 76627
Buggy source:
protected boolean getBooleanOption(String name,boolean defaultValue){
  Object value=options.get(name);
  if (value instanceof Boolean) {
    return ((Boolean)value).booleanValue();
  }
  return defaultValue;
}

Fixed version (ground truth):
protected boolean getBooleanOption(String name,boolean defaultValue){
  Object value=options.get(name);
  if (value instanceof Boolean) {
    return ((Boolean)value).booleanValue();
  }
 else   if (value instanceof String) {
    return "String_Node_Str".equalsIgnoreCase((String)value);
  }
  return defaultValue;
}
Program: 76628
Project: 76628
Buggy source:
/** 
 * Fills dynamic options with parameters from request.
 */
private void initializeEmitterConfigs(HttpServletRequest request,Map config){
  if (config == null) {
    return;
  }
  for (Iterator itr=request.getParameterMap().entrySet().iterator(); itr.hasNext(); ) {
    Entry entry=(Entry)itr.next();
    String name=String.valueOf(entry.getKey());
    if (name.startsWith("String_Node_Str")) {
      name=name.substring(2);
      config.put(name,entry.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Fills dynamic options with parameters from request.
 */
private void initializeEmitterConfigs(HttpServletRequest request,Map config){
  if (config == null) {
    return;
  }
  for (Iterator itr=request.getParameterMap().entrySet().iterator(); itr.hasNext(); ) {
    Entry entry=(Entry)itr.next();
    String name=String.valueOf(entry.getKey());
    if (name.startsWith("String_Node_Str")) {
      config.put(name.substring(2),ParameterAccessor.getParameter(request,name));
    }
  }
}
Program: 76629
Project: 76629
Buggy source:
/** 
 * test case to test the parser,especially the capability to parse the Page Setup. To get the content about Page Setup from an external file and then compare the expected result with the real result of each property of Page Setup. If they are the same,that means the IR is correct, otherwise, there exists errors in the parser
 */
public void testMasterPage() throws Exception {
  PageSetupDesign pageSetup=report.getPageSetup();
  assertEquals(pageSetup.getMasterPageCount(),1);
  SimpleMasterPageDesign page=(SimpleMasterPageDesign)pageSetup.getMasterPage(0);
  assertEquals("String_Node_Str",page.getName());
  assertEquals(29.7,page.getPageHeight().convertTo(DimensionType.UNITS_CM),0.1);
  assertEquals(21,page.getPageWidth().convertTo(DimensionType.UNITS_CM),0.1);
  assertEquals("String_Node_Str",page.getBottomMargin().toString());
  assertEquals("String_Node_Str",page.getTopMargin().toString());
  assertEquals("String_Node_Str",page.getLeftMargin().toString());
  assertEquals("String_Node_Str",page.getRightMargin().toString());
}

Fixed version (ground truth):
/** 
 * test case to test the parser,especially the capability to parse the Page Setup. To get the content about Page Setup from an external file and then compare the expected result with the real result of each property of Page Setup. If they are the same,that means the IR is correct, otherwise, there exists errors in the parser
 */
public void testMasterPage() throws Exception {
  PageSetupDesign pageSetup=report.getPageSetup();
  assertEquals(pageSetup.getMasterPageCount(),2);
  SimpleMasterPageDesign page=(SimpleMasterPageDesign)pageSetup.getMasterPage(0);
  assertEquals("String_Node_Str",page.getName());
  assertEquals(29.7,page.getPageHeight().convertTo(DimensionType.UNITS_CM),0.1);
  assertEquals(21,page.getPageWidth().convertTo(DimensionType.UNITS_CM),0.1);
  assertEquals("String_Node_Str",page.getBottomMargin().toString());
  assertEquals("String_Node_Str",page.getTopMargin().toString());
  assertEquals("String_Node_Str",page.getLeftMargin().toString());
  assertEquals("String_Node_Str",page.getRightMargin().toString());
  page=(SimpleMasterPageDesign)pageSetup.getMasterPage(1);
  assertEquals("String_Node_Str",page.getName());
  assertEquals("String_Node_Str",page.getBottomMargin().toString());
  assertEquals("String_Node_Str",page.getTopMargin().toString());
  assertEquals("String_Node_Str",page.getLeftMargin().toString());
  assertEquals("String_Node_Str",page.getRightMargin().toString());
  assertEquals("String_Node_Str",page.getHeaderHeight().toString());
  assertEquals("String_Node_Str",page.getFooterHeight().toString());
}
Program: 76633
Project: 76633
Buggy source:
/** 
 * Get report page from Http request. If frameset pattern, default page is 1.
 * @param request http request
 * @return report page number
 */
public static int getPage(HttpServletRequest request){
  int page=getParameterAsInt(request,PARAM_PAGE);
  if (page > 0)   return page;
  String servletPath=request.getServletPath();
  if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(servletPath)) {
    page=1;
  }
 else {
    page=0;
  }
  return page;
}

Fixed version (ground truth):
/** 
 * Get report page from Http request. If frameset pattern, default page is 1.
 * @param request http request
 * @return report page number
 */
public static int getPage(HttpServletRequest request){
  int page=getParameterAsInt(request,PARAM_PAGE);
  if (page > 0)   return page;
  String servletPath=request.getServletPath();
  if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(servletPath) && PARAM_FORMAT_HTML.equalsIgnoreCase(getFormat(request))) {
    page=1;
  }
 else {
    page=0;
  }
  return page;
}
Program: 76635
Project: 76635
Buggy source:
/** 
 * New extended item from library.
 * @throws Exception
 */
public void testNewExtendedItemFrom() throws Exception {
  new PeerExtensionLoader().load();
  openDesign("String_Node_Str");
  LibraryHandle libraryHandle=designHandle.getLibrary("String_Node_Str");
  ExtendedItemHandle extendedItem=(ExtendedItemHandle)libraryHandle.getElementByID(77);
  DesignElementHandle handle=designHandle.getElementFactory().newElementFrom(extendedItem,"String_Node_Str");
  assertNotNull(handle);
  assertEquals("String_Node_Str",handle.getName());
}

Fixed version (ground truth):
/** 
 * New extended item from library.
 * @throws Exception
 */
public void testNewExtendedItemFrom() throws Exception {
  openDesign("String_Node_Str");
  LibraryHandle libraryHandle=designHandle.getLibrary("String_Node_Str");
  ExtendedItemHandle extendedItem=(ExtendedItemHandle)libraryHandle.getElementByID(77);
  DesignElementHandle handle=designHandle.getElementFactory().newElementFrom(extendedItem,"String_Node_Str");
  assertNotNull(handle);
  assertEquals("String_Node_Str",handle.getName());
}
Program: 76636
Project: 76636
Buggy source:
/** 
 * Service provided by the fragment. This is the entry point of engine framgent. It generally includes a JSP page to render a certain part of web viewer.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, BirtException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  if (attrBean != null && !attrBean.isMissingParameter() && !this.__checkHTMLFormat(request)) {
    this.doPreService(request,response);
    this.doService(request,response);
    this.doPostService(request,response);
  }
 else {
    super.doPreService(request,response);
    super.doService(request,response);
    String target=super.doPostService(request,response);
    if (target != null && target.length() > 0) {
      RequestDispatcher rd=request.getRequestDispatcher(target);
      rd.include(request,response);
    }
  }
}

Fixed version (ground truth):
/** 
 * Service provided by the fragment. This is the entry point of engine framgent. It generally includes a JSP page to render a certain part of web viewer.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, BirtException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  if (attrBean != null && !attrBean.isShowParameterPage() && !this.__checkHTMLFormat(request)) {
    this.doPreService(request,response);
    this.doService(request,response);
    this.doPostService(request,response);
  }
 else {
    super.doPreService(request,response);
    super.doService(request,response);
    String target=super.doPostService(request,response);
    if (target != null && target.length() > 0) {
      RequestDispatcher rd=request.getRequestDispatcher(target);
      rd.include(request,response);
    }
  }
}
Program: 76637
Project: 76637
Buggy source:
public void testFont() throws IOException, FactoryConfigurationError, ParserConfigurationException, SAXException {
  String configFile="String_Node_Str";
  fontMappingManager=getFontMappingManager(configFile);
  assertTrue(isMappedTo((char)1,"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo((char)1,"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo((char)1,"String_Node_Str","String_Node_Str"));
  assertTrue(isDefaultMappedTo((char)0x501,"String_Node_Str","String_Node_Str"));
  assertTrue(isDefaultMappedTo((char)0x501,"String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testFont() throws IOException, FactoryConfigurationError, ParserConfigurationException, SAXException {
  String configFile="String_Node_Str";
  fontMappingManager=getFontMappingManager(configFile);
  assertTrue(isMappedTo('1',"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo('1',"String_Node_Str","String_Node_Str"));
  assertTrue(isDefaultMappedTo((char)0xe81,"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo('1',"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo('1',"String_Node_Str","String_Node_Str"));
  assertTrue(isMappedTo('1',"String_Node_Str","String_Node_Str"));
  assertTrue(isDefaultMappedTo((char)0x501,"String_Node_Str","String_Node_Str"));
  assertTrue(isDefaultMappedTo((char)0x501,"String_Node_Str","String_Node_Str"));
}
Program: 76638
Project: 76638
Buggy source:
private String getMappedFont(String fontFamilyName,Map fontMap){
  String mappedFontFamily=(String)fontMap.get(fontFamilyName);
  if (mappedFontFamily == null) {
    mappedFontFamily=(String)fontMap.get(FONT_NAME_ALL_FONTS);
  }
  return mappedFontFamily;
}

Fixed version (ground truth):
private BaseFont getMappedFont(char c,int fontStyle,String fontFamilyName){
  String fontName=getMappedFontName(fontFamilyName,fontMapping);
  fontName=fontName == null ? fontFamilyName : fontName;
  BaseFont candidateFont=getBaseFont(fontName,c,fontStyle);
  return candidateFont;
}
Program: 76639
Project: 76639
Buggy source:
protected BaseFont getMappedFontByFontName(char c,CSSValueList fontFamilies,int fontStyle){
  String fontName=null;
  BaseFont candidateFont=null;
  for (int i=0; i < fontFamilies.getLength(); i++) {
    String fontFamilyName=fontFamilies.item(i).getCssText();
    fontName=getMappedFont(fontFamilyName,fontMapping);
    candidateFont=getBaseFont(fontName,c,fontStyle);
    if (null != candidateFont)     return candidateFont;
  }
  return null;
}

Fixed version (ground truth):
protected BaseFont getMappedFontByFontName(char c,CSSValueList fontFamilies,int fontStyle){
  BaseFont candidateFont=null;
  for (int i=0; i < fontFamilies.getLength(); i++) {
    String fontFamilyName=fontFamilies.item(i).getCssText();
    candidateFont=getMappedFont(c,fontStyle,fontFamilyName);
    if (null != candidateFont)     return candidateFont;
    candidateFont=getMappedFont(c,fontStyle,FONT_NAME_ALL_FONTS);
    if (candidateFont != null) {
      return candidateFont;
    }
  }
  return null;
}
Program: 76640
Project: 76640
Buggy source:
/** 
 * Gets font for the character which is not listed in "all-fonts" blocks.
 * @param fontFamilies the font families used for the character
 * @param fontStyle the font style.
 * @return the default font.
 */
public BaseFont getDefaultFont(CSSValueList fontFamilies,int fontStyle){
  BaseFont result=null;
  for (int i=0; i < fontFamilies.getLength(); i++) {
    String fontFamilyName=fontFamilies.item(i).getCssText();
    String fontName=getMappedFont(fontFamilyName,defaultFonts);
    if (fontName != null)     result=createFont(fontName,fontStyle);
  }
  if (result == null) {
    result=createFont(DEFAULT_FONT,fontStyle);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets font for the character which is not listed in "all-fonts" blocks.
 * @param fontFamilies the font families used for the character
 * @param fontStyle the font style.
 * @return the default font.
 */
public BaseFont getDefaultFont(CSSValueList fontFamilies,int fontStyle){
  BaseFont result=null;
  for (int i=0; i < fontFamilies.getLength(); i++) {
    String fontFamilyName=fontFamilies.item(i).getCssText();
    String fontName=getMappedFontName(fontFamilyName,defaultFonts);
    if (fontName != null)     result=createFont(fontName,fontStyle);
  }
  if (result == null) {
    result=createFont(getMappedFontName(FONT_NAME_ALL_FONTS,defaultFonts),fontStyle);
  }
  return result;
}
Program: 76641
Project: 76641
Buggy source:
/** 
 * Tests cases for reading and setting properties of report design.
 * @throws Exception if any exception.
 */
public void testReportDesignProperties() throws Exception {
  assertEquals("String_Node_Str",designHandle.getBase());
  assertEquals("String_Node_Str",designHandle.getFileName());
  designHandle.setBase("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getBase());
  assertEquals("String_Node_Str",designHandle.getAuthor());
  assertEquals("String_Node_Str",designHandle.getHelpGuide());
  assertEquals("String_Node_Str",designHandle.getCreatedBy());
  assertEquals(30,designHandle.getRefreshRate());
  designHandle.setAuthor("String_Node_Str");
  designHandle.setHelpGuide("String_Node_Str");
  designHandle.setCreatedBy("String_Node_Str");
  designHandle.setRefreshRate(50);
  assertEquals("String_Node_Str",designHandle.getAuthor());
  assertEquals("String_Node_Str",designHandle.getHelpGuide());
  assertEquals("String_Node_Str",designHandle.getCreatedBy());
  assertEquals(50,designHandle.getRefreshRate());
}

Fixed version (ground truth):
/** 
 * Tests cases for reading and setting properties of report design.
 * @throws Exception if any exception.
 */
public void testReportDesignProperties() throws Exception {
  designHandle.setBase("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getBase());
  assertEquals("String_Node_Str",designHandle.getAuthor());
  assertEquals("String_Node_Str",designHandle.getHelpGuide());
  assertEquals("String_Node_Str",designHandle.getCreatedBy());
  assertEquals(30,designHandle.getRefreshRate());
  designHandle.setAuthor("String_Node_Str");
  designHandle.setHelpGuide("String_Node_Str");
  designHandle.setCreatedBy("String_Node_Str");
  designHandle.setRefreshRate(50);
  assertEquals("String_Node_Str",designHandle.getAuthor());
  assertEquals("String_Node_Str",designHandle.getHelpGuide());
  assertEquals("String_Node_Str",designHandle.getCreatedBy());
  assertEquals(50,designHandle.getRefreshRate());
}
Program: 76642
Project: 76642
Buggy source:
/** 
 * Tests <code>setFileName</code> function. Cases are <ul> <li>setFileName with HTTP protocol</li> <li>setFileName with HTTP protocol and Chinese character.</li> <li>setFileName with unix file schema.</li> <li>setFileName with windows file schema.</li> </ul>
 * @throws Exception
 */
public void testSetFileName() throws Exception {
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals(new File("String_Node_Str").getParentFile().toURL().toString(),designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
}

Fixed version (ground truth):
/** 
 * Tests <code>setFileName</code> function. Cases are <ul> <li>setFileName with HTTP protocol</li> <li>setFileName with HTTP protocol and Chinese character.</li> <li>setFileName with unix file schema.</li> <li>setFileName with windows file schema.</li> </ul>
 * @throws Exception
 */
public void testSetFileName() throws Exception {
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals("String_Node_Str",designHandle.getModule().getSystemId().toString());
  designHandle.setFileName("String_Node_Str");
  assertEquals(new File("String_Node_Str").getParentFile().toURL().toString(),designHandle.getModule().getSystemId().toString());
}
Program: 76643
Project: 76643
Buggy source:
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_132938() throws DesignFileException, SemanticException, IOException {
  openDesign(INPUT);
  LabelHandle label=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",label.getText());
  openLibrary(LIBRARY_A);
  LabelHandle label_A=(LabelHandle)libraryHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",label_A.getText());
  openLibrary(LIBRARY_B);
  LabelHandle label_B=(LabelHandle)libraryHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",label_B.getText());
  label_B.setText("String_Node_Str");
  libraryHandle.saveAs(getTempFolder() + "String_Node_Str" + GOLDEN_FOLDER+ "String_Node_Str"+ LIBRARY_B);
  System.out.println(getResource(INPUT_FOLDER + "String_Node_Str" + LIBRARY_B).toString());
  copyFile(getTempFolder() + "String_Node_Str" + GOLDEN_FOLDER+ "String_Node_Str"+ LIBRARY_B,LIBRARY_B);
  designHandle.reloadLibraries();
  LabelHandle label_1=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",label_1.getText());
  copyFile(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY_B,LIBRARY_B);
  designHandle.reloadLibraries();
}

Fixed version (ground truth):
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_132938() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libB=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY_B;
  sessionHandle=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.ENGLISH);
  designHandle=sessionHandle.openDesign(report);
  designHandle.includeLibrary(LIBRARY_A,"String_Node_Str");
  libraryHandle=designHandle.getLibrary("String_Node_Str");
  LabelHandle label=(LabelHandle)libraryHandle.findElement("String_Node_Str");
  assertNotNull(label);
  ElementFactory factory=designHandle.getElementFactory();
  LabelHandle rLabel=(LabelHandle)factory.newElementFrom(label,"String_Node_Str");
  assertEquals("String_Node_Str",rLabel.getText());
  designHandle.saveAs(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT);
  libraryHandle=sessionHandle.openLibrary(libB);
  LabelHandle label_lib2=(LabelHandle)libraryHandle.findElement("String_Node_Str");
  label_lib2.setText("String_Node_Str");
  libraryHandle.saveAs(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY_B);
  designHandle.reloadLibrary(libraryHandle);
  ElementFactory factory1=designHandle.getElementFactory();
  LabelHandle l=(LabelHandle)factory1.newElementFrom(label,"String_Node_Str");
  assertEquals("String_Node_Str",l.getText());
}