nus-yam/ex-repair huggingface dataset:
Program: 72859
Project: 72859
Buggy source:
/** 
 * This method is used to filter out the GroupBoundaryInfo instances that are marked as "not accepted" from GroupBoundaryInfos.
 * @param groupArray
 * @return
 */
List[] filterGroupBoundaryInfos(List[] groupArray){
  List[] result=new List[groupArray.length];
  for (int i=0; i < result.length; i++) {
    result[i]=new CachedList(resultPopoulator.getSession().getTempDir(),GroupBoundaryInfo.getCreator());
  }
  for (int i=0; i < groupArray.length; i++) {
    for (int j=0; j < groupArray[i].size(); j++) {
      if (((GroupBoundaryInfo)groupArray[i].get(j)).isAccpted()) {
        result[i].add(groupArray[i].get(j));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method is used to filter out the GroupBoundaryInfo instances that are marked as "not accepted" from GroupBoundaryInfos.
 * @param groupArray
 * @return
 */
List[] filterGroupBoundaryInfos(List[] groupArray){
  List[] result=new List[groupArray.length];
  for (int i=0; i < result.length; i++) {
    result[i]=new CachedList(resultPopoulator.getSession().getTempDir(),DataEngineSession.getCurrentClassLoader(),GroupBoundaryInfo.getCreator());
  }
  for (int i=0; i < groupArray.length; i++) {
    for (int j=0; j < groupArray[i].size(); j++) {
      if (((GroupBoundaryInfo)groupArray[i].get(j)).isAccpted()) {
        result[i].add(groupArray[i].get(j));
      }
    }
  }
  return result;
}
Program: 72860
Project: 72860
Buggy source:
/** 
 * Re-sort the GroupBoundaryInfo instances of a lower group level according the ordering of GroupBoundaryInfo instances of a higher group level .
 * @param higherGroup
 * @param lowerGroup
 * @return
 */
private List mergeTwoGroupBoundaryInfoGroups(List higherGroup,List lowerGroup){
  List result=new CachedList(tempDir,GroupBoundaryInfo.getCreator());
  for (int i=0; i < higherGroup.size(); i++) {
    GroupBoundaryInfo gbi1=(GroupBoundaryInfo)higherGroup.get(i);
    for (int j=0; j < lowerGroup.size(); j++) {
      if (gbi1.isInBoundary((GroupBoundaryInfo)lowerGroup.get(j)))       result.add(lowerGroup.get(j));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Re-sort the GroupBoundaryInfo instances of a lower group level according the ordering of GroupBoundaryInfo instances of a higher group level .
 * @param higherGroup
 * @param lowerGroup
 * @return
 */
private List mergeTwoGroupBoundaryInfoGroups(List higherGroup,List lowerGroup){
  List result=new CachedList(tempDir,DataEngineSession.getCurrentClassLoader(),GroupBoundaryInfo.getCreator());
  for (int i=0; i < higherGroup.size(); i++) {
    GroupBoundaryInfo gbi1=(GroupBoundaryInfo)higherGroup.get(i);
    for (int j=0; j < lowerGroup.size(); j++) {
      if (gbi1.isInBoundary((GroupBoundaryInfo)lowerGroup.get(j)))       result.add(lowerGroup.get(j));
    }
  }
  return result;
}
Program: 72861
Project: 72861
Buggy source:
/** 
 * The structue of a groupBoundaryInfoArray is exactly same as that of GroupCalculationUtil.groups,except that all GroupInfo instances are replaced by GroupBoundaryInfo instances.
 * @return
 * @throws DataException
 */
List[] getGroupBoundaryInfos() throws DataException {
  List[] groupBoundaryInfos=new List[groups.length];
  for (int i=1; i <= groups.length; i++) {
    groupBoundaryInfos[i - 1]=new CachedList(tempDir,GroupBoundaryInfo.getCreator());
    for (int j=0; j < groups[i - 1].size(); j++) {
      groupBoundaryInfos[i - 1].add(getGroupBoundaryInfo(i,j));
    }
  }
  return groupBoundaryInfos;
}

Fixed version (ground truth):
/** 
 * The structue of a groupBoundaryInfoArray is exactly same as that of GroupCalculationUtil.groups,except that all GroupInfo instances are replaced by GroupBoundaryInfo instances.
 * @return
 * @throws DataException
 */
List[] getGroupBoundaryInfos() throws DataException {
  List[] groupBoundaryInfos=new List[groups.length];
  for (int i=1; i <= groups.length; i++) {
    groupBoundaryInfos[i - 1]=new CachedList(tempDir,DataEngineSession.getCurrentClassLoader(),GroupBoundaryInfo.getCreator());
    for (int j=0; j < groups[i - 1].size(); j++) {
      groupBoundaryInfos[i - 1].add(getGroupBoundaryInfo(i,j));
    }
  }
  return groupBoundaryInfos;
}
Program: 72862
Project: 72862
Buggy source:
void readGroupsFromStream(InputStream inputStream) throws IOException {
  int size=IOUtil.readInt(inputStream);
  this.groups=new CachedList[size];
  for (int i=0; i < size; i++) {
    List list=new CachedList(tempDir,GroupInfo.getCreator());
    ;
    int asize=IOUtil.readInt(inputStream);
    for (int j=0; j < asize; j++) {
      GroupInfo groupInfo=new GroupInfo();
      groupInfo.parent=IOUtil.readInt(inputStream);
      groupInfo.firstChild=IOUtil.readInt(inputStream);
      list.add(groupInfo);
    }
    this.groups[i]=list;
  }
}

Fixed version (ground truth):
void readGroupsFromStream(InputStream inputStream) throws IOException {
  int size=IOUtil.readInt(inputStream);
  this.groups=new CachedList[size];
  for (int i=0; i < size; i++) {
    List list=new CachedList(tempDir,DataEngineSession.getCurrentClassLoader(),GroupInfo.getCreator());
    ;
    int asize=IOUtil.readInt(inputStream);
    for (int j=0; j < asize; j++) {
      GroupInfo groupInfo=new GroupInfo();
      groupInfo.parent=IOUtil.readInt(inputStream);
      groupInfo.firstChild=IOUtil.readInt(inputStream);
      list.add(groupInfo);
    }
    this.groups[i]=list;
  }
}
Program: 72863
Project: 72863
Buggy source:
/** 
 * @param cx
 * @param groupBoundaryInfos
 * @param i
 * @param groupedFilters
 * @param j
 * @throws DataException
 */
private void populateGroupBoundaryInfoFilterValues(Context cx,List[] groupBoundaryInfos,int i,List groupedFilters) throws DataException {
  if (i > 1) {
    int passedGroups=0;
    for (int k=0; k < groupBoundaryInfos[i - 2].size(); k++) {
      List currentGroupArray=new CachedList(tempDir,GroupBoundaryInfo.getCreator());
      for (int n=0; n < groupBoundaryInfos[i - 1].size(); n++) {
        if ((((GroupBoundaryInfo)groupBoundaryInfos[i - 2].get(k)).isInBoundary(((GroupBoundaryInfo)groupBoundaryInfos[i - 1].get(n)))))         currentGroupArray.add(groupBoundaryInfos[i - 1].get(n));
      }
      makeAGroupFilteringMultiPass(cx,i,groupedFilters,currentGroupArray,passedGroups);
      passedGroups+=currentGroupArray.size();
    }
  }
 else {
    makeAGroupFilteringMultiPass(cx,i,groupedFilters,groupBoundaryInfos[i - 1],0);
  }
}

Fixed version (ground truth):
/** 
 * @param cx
 * @param groupBoundaryInfos
 * @param i
 * @param groupedFilters
 * @param j
 * @throws DataException
 */
private void populateGroupBoundaryInfoFilterValues(Context cx,List[] groupBoundaryInfos,int i,List groupedFilters) throws DataException {
  if (i > 1) {
    int passedGroups=0;
    for (int k=0; k < groupBoundaryInfos[i - 2].size(); k++) {
      List currentGroupArray=new CachedList(tempDir,DataEngineSession.getCurrentClassLoader(),GroupBoundaryInfo.getCreator());
      for (int n=0; n < groupBoundaryInfos[i - 1].size(); n++) {
        if ((((GroupBoundaryInfo)groupBoundaryInfos[i - 2].get(k)).isInBoundary(((GroupBoundaryInfo)groupBoundaryInfos[i - 1].get(n)))))         currentGroupArray.add(groupBoundaryInfos[i - 1].get(n));
      }
      makeAGroupFilteringMultiPass(cx,i,groupedFilters,currentGroupArray,passedGroups);
      passedGroups+=currentGroupArray.size();
    }
  }
 else {
    makeAGroupFilteringMultiPass(cx,i,groupedFilters,groupBoundaryInfos[i - 1],0);
  }
}
Program: 72864
Project: 72864
Buggy source:
/** 
 * @throws DataException
 */
private void readCurrentRow() throws DataException {
  try {
    rowIndex=IOUtil.readInt(rowInputStream);
    startingGroupLevel=IOUtil.readInt(rowInputStream);
    endingGroupLevel=IOUtil.readInt(rowInputStream);
    columnValueMap.clear();
    for (int i=0; i < columnList.size(); i++) {
      columnValueMap.put(columnList.get(i),IOUtil.readObject(rowInputStream));
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void readCurrentRow() throws DataException {
  try {
    rowIndex=IOUtil.readInt(rowInputStream);
    startingGroupLevel=IOUtil.readInt(rowInputStream);
    endingGroupLevel=IOUtil.readInt(rowInputStream);
    columnValueMap.clear();
    for (int i=0; i < columnList.size(); i++) {
      columnValueMap.put(columnList.get(i),IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}
Program: 72865
Project: 72865
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(String tempDir,IQueryResults queryResults) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.queryResults=queryResults;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(String tempDir,IQueryResults queryResults) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.queryResults=queryResults;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}
Program: 72866
Project: 72866
Buggy source:
/** 
 * @param dir
 */
private static void deleteDirectory(File dir){
  File[] subFiles=dir.listFiles();
  if (subFiles != null) {
    for (int i=0; i < subFiles.length; i++) {
      if (subFiles[i].isDirectory()) {
        deleteDirectory(subFiles[i]);
      }
 else {
        safeDelete(subFiles[i]);
      }
    }
  }
  safeDelete(dir);
}

Fixed version (ground truth):
/** 
 * @param dir
 */
private static void deleteDirectory(File dir){
  File[] subFiles=dir.listFiles();
  if (subFiles != null) {
    for (int i=0; i < subFiles.length; i++) {
      if (subFiles[i].isDirectory()) {
        deleteDirectory(subFiles[i]);
      }
 else {
      }
    }
  }
  safeDelete(dir);
}
Program: 72867
Project: 72867
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 72869
Project: 72869
Buggy source:
/** 
 * Constructor
 * @param handleAdpter
 * @param type
 * @param dimensionHandle
 */
public AddDimensionViewHandleCommand(CrosstabCellAdapter handleAdpter,int type,DimensionHandle dimensionHandle,Object after){
  super(dimensionHandle);
  setHandleAdpter(handleAdpter);
  setType(type);
  setDimensionHandles(new DimensionHandle[]{dimensionHandle});
  this.after=after;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param handleAdpter
 * @param type
 * @param dimensionHandle
 */
public AddDimensionViewHandleCommand(CrosstabCellAdapter handleAdpter,int type,DimensionHandle dimensionHandle,Object after){
  super(dimensionHandle);
  setHandleAdpter(handleAdpter);
  setType(type);
  setDimensionHandles(new DimensionHandle[]{dimensionHandle});
  this.after=after;
  setLabel(NAME);
}
Program: 72870
Project: 72870
Buggy source:
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public AddMeasureViewHandleCommand(CrosstabCellAdapter handleAdpter,MeasureHandle measureHandle,Object after){
  super(measureHandle);
  this.handleAdpter=handleAdpter;
  this.measureHandle=measureHandle;
  this.after=after;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public AddMeasureViewHandleCommand(CrosstabCellAdapter handleAdpter,MeasureHandle measureHandle,Object after){
  super(measureHandle);
  this.handleAdpter=handleAdpter;
  this.measureHandle=measureHandle;
  this.after=after;
  setLabel(NAME);
}
Program: 72871
Project: 72871
Buggy source:
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public AddMultipleMeasureCommand(CrosstabCellAdapter handleAdpter,List list,Object after){
  super(handleAdpter.getDesignElementHandle());
  this.handleAdpter=handleAdpter;
  this.list=list;
  this.after=after;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public AddMultipleMeasureCommand(CrosstabCellAdapter handleAdpter,List list,Object after){
  super(handleAdpter.getDesignElementHandle());
  this.handleAdpter=handleAdpter;
  this.list=list;
  this.after=after;
  setLabel(NAME);
}
Program: 72872
Project: 72872
Buggy source:
public ChangeAreaCommand(DesignElementHandle parent,DesignElementHandle child,Object after){
  super(child);
  this.after=after;
  if (parent != null) {
    parentVewHandle=CrosstabAdaptUtil.getDimensionViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(parent));
    setType(parentVewHandle.getAxisType());
  }
  childViewHandle=CrosstabAdaptUtil.getDimensionViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(child));
}

Fixed version (ground truth):
public ChangeAreaCommand(DesignElementHandle parent,DesignElementHandle child,Object after){
  super(child);
  this.after=after;
  if (parent != null) {
    parentVewHandle=CrosstabAdaptUtil.getDimensionViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(parent));
    setType(parentVewHandle.getAxisType());
  }
  childViewHandle=CrosstabAdaptUtil.getDimensionViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(child));
  setLabel(NAME);
}
Program: 72873
Project: 72873
Buggy source:
/** 
 * @param parent
 * @param child
 * @param after
 */
public ChangeMeasureOrderCommand(DesignElementHandle parent,DesignElementHandle child,Object after){
  super(child);
  this.after=after;
  parentVewHandle=CrosstabAdaptUtil.getMeasureViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(parent));
  childViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(child));
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param child
 * @param after
 */
public ChangeMeasureOrderCommand(DesignElementHandle parent,DesignElementHandle child,Object after){
  super(child);
  this.after=after;
  parentVewHandle=CrosstabAdaptUtil.getMeasureViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(parent));
  childViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(CrosstabAdaptUtil.getExtendedItemHandle(child));
  setLabel(NAME);
}
Program: 72874
Project: 72874
Buggy source:
public CreateDimensionViewCommand(CrosstabHandleAdapter handleAdpter,int type,DimensionHandle[] dimensionHandles){
  super(dimensionHandles[0]);
  setHandleAdpter(handleAdpter);
  setType(type);
  setDimensionHandles(dimensionHandles);
}

Fixed version (ground truth):
public CreateDimensionViewCommand(CrosstabHandleAdapter handleAdpter,int type,DimensionHandle[] dimensionHandles){
  super(dimensionHandles[0]);
  setHandleAdpter(handleAdpter);
  setType(type);
  setDimensionHandles(dimensionHandles);
  setLabel(NAME);
}
Program: 72875
Project: 72875
Buggy source:
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public CreateMeasureViewCommand(CrosstabHandleAdapter handleAdpter,MeasureHandle measureHandle){
  super(measureHandle);
  this.handleAdpter=handleAdpter;
  this.measureHandle=measureHandle;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param handleAdpter
 * @param measureHandle
 */
public CreateMeasureViewCommand(CrosstabHandleAdapter handleAdpter,MeasureHandle measureHandle){
  super(measureHandle);
  this.handleAdpter=handleAdpter;
  this.measureHandle=measureHandle;
  setLabel(NAME);
}
Program: 72876
Project: 72876
Buggy source:
/** 
 * Constructor
 * @param container
 * @param model
 * @param model2
 */
public CrosstabFlowMoveChildCommand(Object child,Object after,Object container){
  super((DesignElementHandle)child);
  this.child=child;
  this.after=after;
  if (container instanceof IAdaptable) {
    this.container=((IAdaptable)container).getAdapter(DesignElementHandle.class);
  }
 else {
    this.container=container;
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param container
 * @param model
 * @param model2
 */
public CrosstabFlowMoveChildCommand(Object child,Object after,Object container){
  super((DesignElementHandle)child);
  this.child=child;
  this.after=after;
  if (container instanceof IAdaptable) {
    this.container=((IAdaptable)container).getAdapter(DesignElementHandle.class);
  }
 else {
    this.container=container;
  }
  setLabel(TRANS_LABEL_MOVE_ELEMENT);
}
Program: 72877
Project: 72877
Buggy source:
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values,Map appContext) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    if (hierHandle.getDataSet() != null)     defineDataSourceAndDataSet(hierHandle.getDataSet());
 else     defineDataSourceAndDataSet(cubeHandle.getDataSet());
    Map levelValueMap=new HashMap();
    if (higherLevelDefns != null) {
      for (int i=0; i < higherLevelDefns.length; i++) {
        if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
          levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
        }
      }
    }
    DataSetIterator it=new DataSetIterator(this.session,hierHandle,appContext);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName(),target.getAttrName());
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values,Map appContext) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    if (hierHandle.getDataSet() != null)     defineDataSourceAndDataSet(hierHandle.getDataSet());
 else     defineDataSourceAndDataSet(cubeHandle.getDataSet());
    Map levelValueMap=new HashMap();
    if (higherLevelDefns != null) {
      for (int i=0; i < higherLevelDefns.length; i++) {
        if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
          levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
        }
      }
    }
    DataSetIterator it=createDataSetIterator(appContext,hierHandle);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName(),target.getAttrName());
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 72878
Project: 72878
Buggy source:
public void dispose(){
  super.dispose();
  if (browser != null) {
    WebViewer.cancel(browser);
  }
  bParameter=null;
  browser=null;
  model=null;
}

Fixed version (ground truth):
public void dispose(){
  super.dispose();
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
  }
  bParameter=null;
  browser=null;
  model=null;
}
Program: 72879
Project: 72879
Buggy source:
/** 
 * handle something when try to leave the page
 */
public void handleLeaveThePage(){
  if (browser != null) {
    WebViewer.cancel(browser);
    browser.setUrl("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * handle something when try to leave the page
 */
public void handleLeaveThePage(){
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
    browser.setUrl("String_Node_Str");
  }
}
Program: 72882
Project: 72882
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName){
  if (isEmbeddable) {
    return;
  }
  if (styleName != null && outputtedStyles.contains(styleName)) {
    writer.attribute(HTMLTags.ATTR_CLASS,styleName);
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (isEmbeddable) {
    return;
  }
  if (styleName != null && outputtedStyles.contains(styleName)) {
    classBuffer.append(styleName);
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        SharedStyleHandle style=handle.getStyle();
        if (style != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + style.getName());
          }
 else {
            classBuffer.append(style.getName());
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 72883
Project: 72883
Buggy source:
protected void writeColumns(ITableContent table){
  for (int i=0; i < table.getColumnCount(); i++) {
    IColumn column=table.getColumn(i);
    writer.openTag(HTMLTags.TAG_COL);
    if (enableAgentStyleEngine) {
      String styleClass=column.getStyleClass();
      setStyleName(styleClass);
    }
    StringBuffer styleBuffer=new StringBuffer();
    htmlEmitter.buildColumnStyle(column,styleBuffer);
    writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    htmlEmitter.handleColumnAlign(column);
    if (enableMetadata) {
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        writer.attribute("String_Node_Str",iid.toString());
      }
    }
    writer.closeTag(HTMLTags.TAG_COL);
  }
}

Fixed version (ground truth):
protected void writeColumns(ITableContent table){
  for (int i=0; i < table.getColumnCount(); i++) {
    IColumn column=table.getColumn(i);
    writer.openTag(HTMLTags.TAG_COL);
    if (enableAgentStyleEngine) {
      String styleClass=column.getStyleClass();
      setStyleName(styleClass,table);
    }
    StringBuffer styleBuffer=new StringBuffer();
    htmlEmitter.buildColumnStyle(column,styleBuffer);
    writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    htmlEmitter.handleColumnAlign(column);
    if (enableMetadata) {
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        writer.attribute("String_Node_Str",iid.toString());
      }
    }
    writer.closeTag(HTMLTags.TAG_COL);
  }
}
Program: 72884
Project: 72884
Buggy source:
public void startContainer(IContainerContent container){
  logger.log(Level.FINE,"String_Node_Str");
  htmlEmitter.openContainerTag(container);
  String styleClass=container.getStyleClass();
  setStyleName(styleClass);
  String bookmark=container.getBookmark();
  if (bookmark == null) {
    bookmark=idGenerator.generateUniqueID();
    container.setBookmark(bookmark);
  }
  HTMLEmitterUtil.setBookmark(writer,HTMLTags.TAG_DIV,bookmark);
  if (enableMetadata) {
    HTMLEmitterUtil.setActiveIDTypeIID(writer,ouputInstanceIDs,container);
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildContainerStyle(container,styleBuffer);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleContainerAlign(container);
}

Fixed version (ground truth):
public void startContainer(IContainerContent container){
  logger.log(Level.FINE,"String_Node_Str");
  htmlEmitter.openContainerTag(container);
  String styleClass=container.getStyleClass();
  setStyleName(styleClass,container);
  String bookmark=container.getBookmark();
  if (bookmark == null) {
    bookmark=idGenerator.generateUniqueID();
    container.setBookmark(bookmark);
  }
  HTMLEmitterUtil.setBookmark(writer,HTMLTags.TAG_DIV,bookmark);
  if (enableMetadata) {
    HTMLEmitterUtil.setActiveIDTypeIID(writer,ouputInstanceIDs,container);
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildContainerStyle(container,styleBuffer);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleContainerAlign(container);
}
Program: 72886
Project: 72886
Buggy source:
public void startCell(ICellContent cell){
  logger.log(Level.FINE,"String_Node_Str");
  boolean isHead=isCellInHead(cell);
  if (isHead) {
    writer.openTag(HTMLTags.TAG_TH);
  }
 else {
    writer.openTag(HTMLTags.TAG_TD);
  }
  String styleClass=cell.getStyleClass();
  setStyleName(styleClass);
  int colSpan=cell.getColSpan();
  if (colSpan > 1) {
    writer.attribute(HTMLTags.ATTR_COLSPAN,colSpan);
  }
  int rowSpan=cell.getRowSpan();
  if (rowSpan > 1) {
    writer.attribute(HTMLTags.ATTR_ROWSPAN,rowSpan);
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildCellStyle(cell,styleBuffer,isHead);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleCellAlign(cell);
  if (!startedGroups.isEmpty()) {
    IGroupContent group=(IGroupContent)startedGroups.firstElement();
    String bookmark=group.getBookmark();
    if (bookmark == null) {
      bookmark=idGenerator.generateUniqueID();
      group.setBookmark(bookmark);
    }
    writer.attribute(HTMLTags.ATTR_ID,group.getBookmark());
    startedGroups.remove(group);
    Iterator iter=startedGroups.iterator();
    while (iter.hasNext()) {
      group=(IGroupContent)iter.next();
      outputBookmark(group);
    }
    startedGroups.clear();
  }
  if (enableMetadata) {
    metadataEmitter.startCell(cell);
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  logger.log(Level.FINE,"String_Node_Str");
  boolean isHead=isCellInHead(cell);
  if (isHead) {
    writer.openTag(HTMLTags.TAG_TH);
  }
 else {
    writer.openTag(HTMLTags.TAG_TD);
  }
  String styleClass=cell.getStyleClass();
  setStyleName(styleClass,cell);
  int colSpan=cell.getColSpan();
  if (colSpan > 1) {
    writer.attribute(HTMLTags.ATTR_COLSPAN,colSpan);
  }
  int rowSpan=cell.getRowSpan();
  if (rowSpan > 1) {
    writer.attribute(HTMLTags.ATTR_ROWSPAN,rowSpan);
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildCellStyle(cell,styleBuffer,isHead);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleCellAlign(cell);
  if (!startedGroups.isEmpty()) {
    IGroupContent group=(IGroupContent)startedGroups.firstElement();
    String bookmark=group.getBookmark();
    if (bookmark == null) {
      bookmark=idGenerator.generateUniqueID();
      group.setBookmark(bookmark);
    }
    writer.attribute(HTMLTags.ATTR_ID,group.getBookmark());
    startedGroups.remove(group);
    Iterator iter=startedGroups.iterator();
    while (iter.hasNext()) {
      group=(IGroupContent)iter.next();
      outputBookmark(group);
    }
    startedGroups.clear();
  }
  if (enableMetadata) {
    metadataEmitter.startCell(cell);
  }
}
Program: 72887
Project: 72887
Buggy source:
/** 
 * Draws the background color of the PPT.
 * @param color the color to be drawn
 * @param x the start X coordinate
 * @param y the start Y coordinate
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 */
public void drawBackgroundColor(Color color,double x,double y,double width,double height){
  if (color == null) {
    return;
  }
  print("String_Node_Str" + (++shapeCount) + "String_Node_Str");
  print("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  print("String_Node_Str" + Integer.toHexString(color.getRGB() & 0x00ffffff) + "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Draws the background color of the PPT.
 * @param color the color to be drawn
 * @param x the start X coordinate
 * @param y the start Y coordinate
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 */
public void drawBackgroundColor(Color color,double x,double y,double width,double height){
  if (color == null) {
    return;
  }
  print("String_Node_Str" + (++shapeCount) + "String_Node_Str");
  print("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  print("String_Node_Str" + getColorString(color) + "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str");
}
Program: 72890
Project: 72890
Buggy source:
/** 
 * Saves input code to model
 */
public 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) {
    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: 72891
Project: 72891
Buggy source:
public void testFixedTableLayout() throws EngineException {
  String designFile="String_Node_Str";
  List pageAreas=getpageAreas(designFile);
  assertEquals(1,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(0);
  ContainerArea body=(ContainerArea)pageArea.getBody();
  assertTrue(body.getChildrenCount() == 11);
  Iterator iter=body.getChildren();
  TableArea table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,288,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,108,180});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,177,111});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,72,216});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{108,108,216});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,208,80});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{0,432,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,432,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,432,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,0,216});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{50,10,40});
}

Fixed version (ground truth):
public void testFixedTableLayout() throws EngineException {
  String designFile="String_Node_Str";
  List pageAreas=getpageAreas(designFile);
  assertEquals(1,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(0);
  ContainerArea body=(ContainerArea)pageArea.getBody();
  assertTrue(body.getChildrenCount() == 11);
  Iterator iter=body.getChildren();
  TableArea table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,288,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,108,180});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,177,111});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,72,216});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{108,108,216});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{144,208,80});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{432,0,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,432,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,432,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{216,216,0});
  table=(TableArea)iter.next();
  validateColumnWidth(table,new int[]{50,10,40});
}
Program: 72892
Project: 72892
Buggy source:
protected void createRoot(){
  if (root == null) {
    CellArea cell=AreaFactory.createCellArea(cellContent);
    cell.setRowSpan(tableLM.getRowSpan(cellContent));
    root=cell;
    if (!isFirst) {
      IStyle areaStyle=root.getStyle();
      areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
      areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
    }
  }
  tableLM.resolveBorderConflict((CellArea)root,isFirst);
  int startColumn=cellContent.getColumn();
  int endColumn=startColumn + cellContent.getColSpan();
  columnWidth=tableLM.getCellWidth(startColumn,endColumn);
  root.setWidth(columnWidth);
}

Fixed version (ground truth):
protected void createRoot(){
  if (root == null) {
    CellArea cell=AreaFactory.createCellArea(cellContent);
    cell.setRowSpan(tableLM.getRowSpan(cellContent));
    root=cell;
    if (!isFirst) {
      IStyle areaStyle=root.getStyle();
      areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
      areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
    }
  }
  tableLM.resolveBorderConflict((CellArea)root,isFirst);
  root.setWidth(columnWidth);
}
Program: 72893
Project: 72893
Buggy source:
protected boolean isHidden(){
  if (!tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return isHiddenByVisibility();
}

Fixed version (ground truth):
protected boolean isHidden(){
  int startColumn=cellContent.getColumn();
  int endColumn=startColumn + cellContent.getColSpan();
  columnWidth=tableLM.getCellWidth(startColumn,endColumn);
  if (columnWidth == 0 || !tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return isHiddenByVisibility();
}
Program: 72894
Project: 72894
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  boolean isDisplay=false;
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (isDirtyModel()) {
    doSave(null);
  }
  if (prePage.isDirty()) {
    prePage.doSave(null);
  }
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          editor.setActivePage(prePage.getId());
          return false;
        }
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  ReportRequest request=new ReportRequest(ReportPreviewFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  boolean isDisplay=false;
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (isDirtyModel()) {
    doSave(null);
  }
  if (prePage.isDirty()) {
    prePage.doSave(null);
  }
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          editor.setActivePage(prePage.getId());
          return false;
        }
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  ReportRequest request=new ReportRequest(ReportPreviewFormPage.this);
  List list=new ArrayList();
  list.add(new Object());
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}
Program: 72895
Project: 72895
Buggy source:
public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  if (getScriptEditor() instanceof DebugJSEditor) {
    ((DebugJSEditor)getScriptEditor()).saveDocument();
  }
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  if (getScriptEditor() instanceof IDebugScriptEditor) {
    ((IDebugScriptEditor)getScriptEditor()).saveDocument();
  }
}
Program: 72896
Project: 72896
Buggy source:
private URL generateURL(ModuleHandle designHandle,String uri) throws MalformedURLException {
  try {
    return new URL(uri);
  }
 catch (  MalformedURLException e) {
    String path=URIUtil.getLocalPath(uri);
    if (path != null && designHandle != null) {
      return designHandle.findResource(path,IResourceLocator.IMAGE);
    }
    return URI.create(uri).toURL();
  }
}

Fixed version (ground truth):
private URL generateURL(ModuleHandle designHandle,String uri) throws MalformedURLException {
  try {
    return new URL(uri);
  }
 catch (  MalformedURLException e) {
    String path=URIUtil.getLocalPath(uri);
    if (designHandle == null) {
      designHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    }
    if (path != null && designHandle != null) {
      return designHandle.findResource(path,IResourceLocator.IMAGE);
    }
    return URI.create(uri).toURL();
  }
}
Program: 72897
Project: 72897
Buggy source:
public String getText(Object element){
  if (element instanceof ResourceEntryWrapper && ((ResourceEntryWrapper)element).getType() == ResourceEntryWrapper.LIBRARY) {
    LibraryHandle lib=(LibraryHandle)((ResourceEntryWrapper)element).getAdapter(LibraryHandle.class);
    String fileName=lib.getFileName();
    return fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
  }
 else   if (element instanceof ResourceEntryWrapper && ((ResourceEntryWrapper)element).getType() == ResourceEntryWrapper.CSS_STYLE_SHEET) {
    CssStyleSheetHandle css=(CssStyleSheetHandle)((ResourceEntryWrapper)element).getAdapter(CssStyleSheetHandle.class);
    String fileName=css.getFileName();
    if (fileName == null || fileName.length() == 0) {
      fileName="String_Node_Str";
    }
    return fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
  }
  if (element instanceof ResourceEntry) {
    if (!((ResourceEntry)element).isRoot()) {
      return ((ResourceEntry)element).getName();
    }
    if (element instanceof FragmentResourceEntry) {
      return Messages.getString("String_Node_Str");
    }
 else     if (element instanceof PathResourceEntry) {
      return Messages.getString("String_Node_Str");
    }
  }
 else   if (element instanceof String) {
    return element.toString();
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof ResourceEntryWrapper && ((ResourceEntryWrapper)element).getType() == ResourceEntryWrapper.LIBRARY) {
    LibraryHandle lib=(LibraryHandle)((ResourceEntryWrapper)element).getAdapter(LibraryHandle.class);
    String fileName=lib.getFileName();
    return new File(fileName).getName();
  }
 else   if (element instanceof ResourceEntryWrapper && ((ResourceEntryWrapper)element).getType() == ResourceEntryWrapper.CSS_STYLE_SHEET) {
    CssStyleSheetHandle css=(CssStyleSheetHandle)((ResourceEntryWrapper)element).getAdapter(CssStyleSheetHandle.class);
    String fileName=css.getFileName();
    if (fileName == null || fileName.length() == 0) {
      fileName="String_Node_Str";
    }
    return new File(fileName).getName();
  }
  if (element instanceof ResourceEntry) {
    if (!((ResourceEntry)element).isRoot()) {
      return ((ResourceEntry)element).getName();
    }
    if (element instanceof FragmentResourceEntry) {
      return Messages.getString("String_Node_Str");
    }
 else     if (element instanceof PathResourceEntry) {
      return Messages.getString("String_Node_Str");
    }
  }
 else   if (element instanceof String) {
    return element.toString();
  }
  return super.getText(element);
}
Program: 72898
Project: 72898
Buggy source:
public Object getAdapter(Class adapter){
  if (adapter == LibraryHandle.class && getURL().toString().toLowerCase().endsWith("String_Node_Str")) {
    if (!this.isFolder && this.library == null) {
      try {
        String projectFolder=UIUtil.getProjectFolder();
        if (projectFolder != null) {
          Map properties=new HashMap();
          properties.put(IModuleOption.RESOURCE_FOLDER_KEY,projectFolder);
          this.library=SessionHandleAdapter.getInstance().getSessionHandle().openLibrary(getURL().toString(),new ModuleOption(properties));
        }
 else {
          this.library=SessionHandleAdapter.getInstance().getSessionHandle().openLibrary(getURL().toString());
        }
      }
 catch (      Exception e) {
      }
    }
    return library;
  }
 else   if (adapter == CssStyleSheetHandle.class && getURL().toString().toLowerCase().endsWith("String_Node_Str")) {
    if (!this.isFolder && this.cssStyleHandle == null) {
      String projectFolder=UIUtil.getProjectFolder();
      try {
        String fileName=ResourceLocator.relativize(getURL());
        cssStyleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().openCssStyleSheet(fileName);
      }
 catch (      Exception e) {
      }
    }
    return cssStyleHandle;
  }
  return null;
}

Fixed version (ground truth):
public Object getAdapter(Class adapter){
  if (adapter == LibraryHandle.class && getURL().toString().toLowerCase().endsWith("String_Node_Str")) {
    if (!this.isFolder && this.library == null) {
      try {
        String projectFolder=UIUtil.getProjectFolder();
        if (projectFolder != null) {
          Map properties=new HashMap();
          properties.put(IModuleOption.RESOURCE_FOLDER_KEY,projectFolder);
          this.library=SessionHandleAdapter.getInstance().getSessionHandle().openLibrary(this.path,new ModuleOption(properties));
        }
 else {
          this.library=SessionHandleAdapter.getInstance().getSessionHandle().openLibrary(this.path);
        }
      }
 catch (      Exception e) {
      }
    }
    return library;
  }
 else   if (adapter == CssStyleSheetHandle.class && getURL().toString().toLowerCase().endsWith("String_Node_Str")) {
    if (!this.isFolder && this.cssStyleHandle == null) {
      String projectFolder=UIUtil.getProjectFolder();
      try {
        String fileName=ResourceLocator.relativize(this.path);
        cssStyleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().openCssStyleSheet(fileName);
      }
 catch (      Exception e) {
      }
    }
    return cssStyleHandle;
  }
  return null;
}
Program: 72899
Project: 72899
Buggy source:
public static String relativize(URL url){
  String path=url.getFile();
  if (url.getProtocol().equals("String_Node_Str")) {
    return URIUtil.getRelativePath(ReportPlugin.getDefault().getResourceFolder(),path);
  }
  return path;
}

Fixed version (ground truth):
public static String relativize(URL url){
  String path=url.getFile();
  if (url.getProtocol().equals("String_Node_Str")) {
    return relativize(path);
  }
  return path;
}
Program: 72902
Project: 72902
Buggy source:
public void addBinding(IBinding binding){
  bindingList.add(binding);
}

Fixed version (ground truth):
public void addBinding(IBinding binding){
  if (needReconstructure(binding)) {
    binding=constructNewBinding(binding);
  }
  bindingList.add(binding);
}