nus-yam/ex-repair huggingface dataset:
Program: 78851
Project: 78851
Buggy source:
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (!isActive()) {
    return;
  }
switch (ev.getEventType()) {
case NotificationEvent.CONTENT_EVENT:
{
      markDirty(true);
      if (focus instanceof TableHandle || focus instanceof TableGroupHandle) {
        addListenerToChildren();
      }
      refreshChildren();
      refreshVisuals();
      if (((ContentEvent)ev).getAction() == ContentEvent.REMOVE) {
        this.getViewer().select(this);
      }
      break;
    }
case NotificationEvent.PROPERTY_EVENT:
{
    markDirty(true);
    reLayout();
    PropertyEvent event=(PropertyEvent)ev;
    if (event.getPropertyName().startsWith("String_Node_Str")) {
      refreshVisuals();
    }
    if (event.getPropertyName().equals(StyleHandle.PADDING_TOP_PROP) || event.getPropertyName().equals(StyleHandle.PADDING_BOTTOM_PROP) || event.getPropertyName().equals(StyleHandle.PADDING_LEFT_PROP)|| event.getPropertyName().equals(StyleHandle.PADDING_RIGHT_PROP)) {
      invalidParent();
    }
    if (event.getPropertyName().equals(ReportItemHandle.WIDTH_PROP) || event.getPropertyName().equals(ReportItemHandle.HEIGHT_PROP)) {
      invalidParent();
    }
    refresh();
    break;
  }
case NotificationEvent.ELEMENT_DELETE_EVENT:
case NotificationEvent.TABLE_MODEL_EVENT:
{
  markDirty(true);
  refresh();
  break;
}
case NotificationEvent.STYLE_EVENT:
{
markDirty(true);
invalidParent();
refresh();
}
default :
break;
}
}

Fixed version (ground truth):
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (!isActive()) {
    return;
  }
switch (ev.getEventType()) {
case NotificationEvent.CONTENT_EVENT:
{
      markDirty(true);
      if (focus instanceof TableHandle || focus instanceof TableGroupHandle) {
        addListenerToChildren();
      }
      refreshChildren();
      refreshVisuals();
      if (((ContentEvent)ev).getAction() == ContentEvent.REMOVE) {
        reselectTable();
      }
      break;
    }
case NotificationEvent.PROPERTY_EVENT:
{
    markDirty(true);
    reLayout();
    PropertyEvent event=(PropertyEvent)ev;
    if (event.getPropertyName().startsWith("String_Node_Str")) {
      refreshVisuals();
    }
    if (event.getPropertyName().equals(StyleHandle.PADDING_TOP_PROP) || event.getPropertyName().equals(StyleHandle.PADDING_BOTTOM_PROP) || event.getPropertyName().equals(StyleHandle.PADDING_LEFT_PROP)|| event.getPropertyName().equals(StyleHandle.PADDING_RIGHT_PROP)) {
      invalidParent();
    }
    if (event.getPropertyName().equals(ReportItemHandle.WIDTH_PROP) || event.getPropertyName().equals(ReportItemHandle.HEIGHT_PROP)) {
      invalidParent();
    }
    refresh();
    break;
  }
case NotificationEvent.ELEMENT_DELETE_EVENT:
case NotificationEvent.TABLE_MODEL_EVENT:
{
  markDirty(true);
  refresh();
  break;
}
case NotificationEvent.STYLE_EVENT:
{
markDirty(true);
invalidParent();
refresh();
}
default :
break;
}
}
Program: 78853
Project: 78853
Buggy source:
/** 
 * Returns the iterator over all included libraries. Each one is the instance of <code>IncludeLibraryHandle</code>
 * @return the iterator over all included libraries.
 * @see IncludeLibraryHandle
 */
public Iterator includeLibrariesIterator(){
}

Fixed version (ground truth):
/** 
 * Returns the iterator over all included libraries. Each one is the instance of <code>IncludeLibraryHandle</code>
 * @return the iterator over all included libraries.
 * @see IncludedLibraryHandle
 */
public Iterator includeLibrariesIterator(){
}
Program: 78854
Project: 78854
Buggy source:
/** 
 * Creates an empty include library structure.
 * @return an empty include library structure
 */
public static IncludeLibrary createIncludeLibrary(){
  return new IncludeLibrary();
}

Fixed version (ground truth):
/** 
 * Creates an empty include library structure.
 * @return an empty include library structure
 */
public static IncludedLibrary createIncludeLibrary(){
  return new IncludedLibrary();
}
Program: 78855
Project: 78855
Buggy source:
/** 
 * Exports one design to library.
 * @param designToExport handle of the report design to export
 * @param targetLibraryHandle handle of target library
 * @throws SemanticException if error encountered when element name is duplicate in the target library.
 */
public static void exportDesign(ReportDesignHandle designToExport,LibraryHandle targetLibraryHandle) throws SemanticException {
  ElementExporter exporter=new ElementExporter(targetLibraryHandle);
  exporter.exportDesign(designToExport);
}

Fixed version (ground truth):
/** 
 * Exports one design to library.
 * @param designToExport handle of the report design to export
 * @param targetLibraryHandle handle of target library
 * @throws SemanticException if error encountered when element name is duplicate in the target library.
 */
public static void exportDesign(ReportDesignHandle designToExport,LibraryHandle targetLibraryHandle,boolean canOverride) throws SemanticException {
  ElementExporter exporter=new ElementExporter(targetLibraryHandle);
  exporter.exportDesign(designToExport,canOverride);
}
Program: 78856
Project: 78856
Buggy source:
public IStyle getContentStyle(){
  if (generateBy instanceof MasterPageDesign) {
    return ((MasterPageDesign)generateBy).getContentStyle();
  }
  return null;
}

Fixed version (ground truth):
public IStyle getContentStyle(){
  if (body == null) {
    if (generateBy instanceof MasterPageDesign) {
      body=report.createCellContent();
      body.setInlineStyle(((MasterPageDesign)generateBy).getContentStyle());
    }
  }
  return body.getComputedStyle();
}
Program: 78857
Project: 78857
Buggy source:
FilterByRow(List filters,Scriptable scope,JSRowObject scriptObj){
  this.filters=filters;
  this.scope=scope;
  this.scriptObj=scriptObj;
  logger.log(Level.FINER,"String_Node_Str");
}

Fixed version (ground truth):
FilterByRow(List filters,Scriptable scope,JSRowObject scriptObj) throws DataException {
  isLegal(filters);
  this.filters=filters;
  this.scope=scope;
  this.scriptObj=scriptObj;
  logger.log(Level.FINER,"String_Node_Str");
}
Program: 78858
Project: 78858
Buggy source:
public PageHint getPageHint(long pageNumber){
  if (pageHints == null) {
    loadPageHintStream();
  }
  if (pageHints != null) {
    if (pageNumber >= 0 && pageNumber < pageHints.size()) {
      return (PageHint)pageHints.get((int)pageNumber);
    }
  }
  return null;
}

Fixed version (ground truth):
public PageHint getPageHint(long pageNumber){
  if (pageHints == null) {
    loadPageHintStream();
  }
  if (pageHints != null) {
    if (pageNumber >= 1 && pageNumber <= pageHints.size()) {
      return (PageHint)pageHints.get((int)(pageNumber - 1));
    }
  }
  return null;
}
Program: 78859
Project: 78859
Buggy source:
public ReportDocumentReader(ReportEngine engine,IDocArchiveReader archive){
  this.engine=engine;
  this.archive=archive;
  try {
    archive.open();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public ReportDocumentReader(ReportEngine engine,IDocArchiveReader archive){
  this.engine=engine;
  this.archive=archive;
  try {
    archive.open();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 78860
Project: 78860
Buggy source:
public void close(){
  try {
    archive.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void close(){
  try {
    archive.close();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 78861
Project: 78861
Buggy source:
public ReportDocumentWriter(IDocArchiveWriter archive){
  this.archive=archive;
  try {
    archive.initialize();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public ReportDocumentWriter(IDocArchiveWriter archive){
  this.archive=archive;
  try {
    archive.initialize();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 78862
Project: 78862
Buggy source:
public void close(){
  try {
    archive.finish();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void close(){
  try {
    archive.finish();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 78863
Project: 78863
Buggy source:
public void run(IDocArchiveWriter archive) throws EngineException {
  if (archive == null)   throw new EngineException("String_Node_Str");
  try {
    archive.initialize();
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
  writer=new ReportDocumentWriter(archive);
  doRun();
  try {
    archive.finish();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(IDocArchiveWriter archive) throws EngineException {
  if (archive == null)   throw new EngineException("String_Node_Str");
  try {
    archive.initialize();
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
  writer=new ReportDocumentWriter(archive);
  doRun();
  writer.close();
}
Program: 78864
Project: 78864
Buggy source:
/** 
 * create a <code>DataEngine</code> given an execution context
 * @param context the execution context
 * @return a data engine instance
 */
public IDataEngine createDataEngine(ExecutionContext context){
  IReportDocument document=context.getReportDocument();
  if (document != null) {
    if (context.isInFactory()) {
      return new DataGenerationEngine(context,context.getReportDocWriter().getArchive());
    }
    return new DataPresentationEngine(context,context.getReportDocument().getArchive());
  }
  return new DteDataEngine(context);
}

Fixed version (ground truth):
/** 
 * create a <code>DataEngine</code> given an execution context
 * @param context the execution context
 * @return a data engine instance
 */
public IDataEngine createDataEngine(ExecutionContext context){
  ReportDocumentWriter writer=context.getReportDocWriter();
  if (writer != null) {
    return new DataGenerationEngine(context,context.getReportDocWriter().getArchive());
  }
  IReportDocument document=context.getReportDocument();
  if (document != null) {
    return new DataPresentationEngine(context,context.getReportDocument().getArchive());
  }
  return new DteDataEngine(context);
}
Program: 78865
Project: 78865
Buggy source:
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
    CSSPrimitiveValue pvalue=(CSSPrimitiveValue)value;
    if (pvalue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
      String ident=pvalue.getStringValue();
      Value v=(Value)computedValues.get(ident);
      if (v != null) {
        return v;
      }
      if (values.get(ident) == null) {
        throw new InternalError();
      }
      return (Value)engine.getCSSContext().getSystemColor(ident);
    }
  }
  return super.computeValue(elt,engine,idx,value);
}

Fixed version (ground truth):
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
    CSSPrimitiveValue pvalue=(CSSPrimitiveValue)value;
    int primitiveType=pvalue.getPrimitiveType();
    if (primitiveType == CSSPrimitiveValue.CSS_IDENT) {
      String ident=pvalue.getStringValue();
      Value v=(Value)computedValues.get(ident);
      if (v != null) {
        return v;
      }
      if (values.get(ident) == null) {
        throw new InternalError();
      }
      return (Value)engine.getCSSContext().getSystemColor(ident);
    }
    if (primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR) {
      RGBColor color=value.getRGBColorValue();
      CSSPrimitiveValue red=color.getRed();
      CSSPrimitiveValue green=color.getGreen();
      CSSPrimitiveValue blue=color.getBlue();
      return createRGBColor(createColorComponent(red),createColorComponent(green),createColorComponent(blue));
    }
  }
  return super.computeValue(elt,engine,idx,value);
}
Program: 78866
Project: 78866
Buggy source:
/** 
 * @param launch
 */
private void cofigLaunch(ILaunch launch,ILaunchConfiguration configuration){
  if (launch.getSourceLocator() instanceof JavaSourceLookupDirector) {
    JavaSourceLookupDirector director=(JavaSourceLookupDirector)launch.getSourceLocator();
    ISourceContainer[] contains=director.getSourceContainers();
    List list=new ArrayList();
    if (contains != null && contains.length != 0) {
      for (int i=0; i < contains.length; i++) {
        list.add(contains[i]);
      }
    }
    try {
      List sourcePaths=getAllProjectSourcePaths(configuration.getAttribute(IMPORTPROJECTNAMES,"String_Node_Str"));
      for (int i=0; i < sourcePaths.size(); i++) {
        String source=(String)sourcePaths.get(i);
        ISourceContainer temp=new DirectorySourceContainer(new Path(source),true);
        list.add(temp);
      }
    }
 catch (    CoreException e) {
    }
    ISourceContainer[] retValue=new ISourceContainer[list.size()];
    retValue=(ISourceContainer[])list.toArray(retValue);
    director.setSourceContainers(retValue);
  }
}

Fixed version (ground truth):
/** 
 * @param launch
 */
private void cofigLaunch(ILaunch launch,ILaunchConfiguration configuration){
  if (launch.getSourceLocator() instanceof JavaSourceLookupDirector) {
    JavaSourceLookupDirector director=(JavaSourceLookupDirector)launch.getSourceLocator();
    ISourceContainer[] contains=director.getSourceContainers();
    List list=new ArrayList();
    if (contains != null && contains.length != 0) {
      for (int i=0; i < contains.length; i++) {
        list.add(contains[i]);
      }
    }
    try {
      List sourcePaths=getAllProjectSourcePaths(configuration.getAttribute(IMPORTPROJECTNAMES,"String_Node_Str"));
      for (int i=0; i < sourcePaths.size(); i++) {
        IJavaProject source=(IJavaProject)sourcePaths.get(i);
        ISourceContainer temp=new JavaProjectSourceContainer(source);
        list.add(temp);
      }
    }
 catch (    CoreException e) {
    }
    ISourceContainer[] retValue=new ISourceContainer[list.size()];
    retValue=(ISourceContainer[])list.toArray(retValue);
    director.setSourceContainers(retValue);
  }
}
Program: 78867
Project: 78867
Buggy source:
private List getAllProjectSourcePaths(String path){
  List retValue=new ArrayList();
  if (path == null || path.length() == 0) {
    return retValue;
  }
  StringTokenizer token=new StringTokenizer(path,PROPERTYSEPARATOR);
  while (token.hasMoreTokens()) {
    String projectName=token.nextToken();
    List paths=getProjectSourcePaths(projectName);
    for (int i=0; i < paths.size(); i++) {
      retValue.add(paths.get(i));
    }
  }
  return retValue;
}

Fixed version (ground truth):
private List getAllProjectSourcePaths(String path){
  List retValue=new ArrayList();
  if (path == null || path.length() == 0) {
    return retValue;
  }
  StringTokenizer token=new StringTokenizer(path,PROPERTYSEPARATOR);
  while (token.hasMoreTokens()) {
    String projectName=token.nextToken();
    IProject project=ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
    if (project != null && hasJavaNature(project)) {
      retValue.add(JavaCore.create(project));
    }
  }
  return retValue;
}
Program: 78868
Project: 78868
Buggy source:
/** 
 * @param editparts
 */
private List flitterEditpart(List editparts){
  int size=editparts.size();
  boolean hasCell=false;
  boolean hasOther=false;
  for (int i=0; i < size; i++) {
    Object obj=((EditPart)editparts.get(i)).getModel();
    if (obj instanceof CellHandle || obj instanceof RowHandle || obj instanceof ColumnHandle) {
      hasCell=true;
    }
 else {
      hasOther=true;
    }
  }
  if (hasCell && hasOther) {
    List copy=new ArrayList(editparts);
    for (int i=0; i < size; i++) {
      EditPart part=(EditPart)editparts.get(i);
      Object obj=part.getModel();
      if (obj instanceof CellHandle || obj instanceof RowHandle || obj instanceof ColumnHandle) {
        copy.remove(part);
      }
    }
    editparts=copy;
  }
  return editparts;
}

Fixed version (ground truth):
/** 
 * @param editparts
 */
private List flitterEditpart(List editparts){
  int size=editparts.size();
  List copy=new ArrayList(editparts);
  for (int i=0; i < size; i++) {
    EditPart part=(EditPart)editparts.get(i);
    if (part instanceof AreaEditPart) {
      copy.remove(part);
    }
  }
  boolean hasCell=false;
  boolean hasOther=false;
  for (int i=0; i < size; i++) {
    Object obj=((EditPart)editparts.get(i)).getModel();
    if (obj instanceof CellHandle || obj instanceof RowHandle || obj instanceof ColumnHandle) {
      hasCell=true;
    }
 else {
      hasOther=true;
    }
  }
  if (hasCell && hasOther) {
    for (int i=0; i < size; i++) {
      EditPart part=(EditPart)editparts.get(i);
      Object obj=part.getModel();
      if (obj instanceof CellHandle || obj instanceof RowHandle || obj instanceof ColumnHandle) {
        copy.remove(part);
      }
    }
  }
  editparts=copy;
  return editparts;
}
Program: 78869
Project: 78869
Buggy source:
/** 
 * Gets models of selected elements
 * @return
 */
protected List getElementHandles(){
  List list=getSelectedObjects();
  if (list.isEmpty()) {
    return Collections.EMPTY_LIST;
  }
  List handles=new ArrayList();
  for (int i=0; i < list.size(); i++) {
    handles.add(((EditPart)(list.get(i))).getModel());
  }
  return handles;
}

Fixed version (ground truth):
/** 
 * Gets models of selected elements
 * @return
 */
protected List getElementHandles(){
  return InsertInLayoutUtil.editPart2Model(TableUtil.filletCellInSelectionEditorpart(getSelection())).toList();
}
Program: 78870
Project: 78870
Buggy source:
GroupPropertyIterator(List list){
  propIterator=list.iterator();
}

Fixed version (ground truth):
/** 
 * Constructs the group property iterator with the common property list.
 * @param list
 */
GroupPropertyIterator(List list){
  propIterator=list.iterator();
}
Program: 78871
Project: 78871
Buggy source:
public boolean isVisible(){
  IElementDefn elementDefn=getElementHandle().getDefn();
  if (elementDefn.isPropertyVisible(propDefn.getName()))   return true;
  if (propDefn.isUserProperty())   return true;
  return false;
}

Fixed version (ground truth):
public boolean isVisible(){
  IElementDefn elementDefn=getElementHandle().getDefn();
  if (!elementDefn.isPropertyVisible(propDefn.getName()) && (propDefn.isSystemProperty() || (propDefn.getValueType() == PropertyDefn.EXTENSION_PROPERTY)))   return false;
  return true;
}
Program: 78872
Project: 78872
Buggy source:
protected void buildStyleProperties() throws MetaDataException {
  if (hasStyle)   addStyleProperties();
  if (ReportDesignConstants.EXTENDED_ITEM.equalsIgnoreCase(getName())) {
    List styles=MetaDataDictionary.getInstance().getStyle().getLocalProperties();
    for (int i=0; i < styles.size(); i++) {
      String propName=((SystemPropertyDefn)styles.get(i)).getName();
      properties.put(propName,styles.get(i));
    }
  }
 else {
    if (!hasStyle && stylePropertyNames != null || hasStyle && isContainer() && stylePropertyNames != null)     throw new MetaDataException(new String[]{this.name},MetaDataException.DESIGN_EXCEPTION_ILLEGAL_STYLE_PROPS);
  }
}

Fixed version (ground truth):
/** 
 * Builds the style properties in this element.
 * @throws MetaDataException
 */
protected void buildStyleProperties() throws MetaDataException {
  if (hasStyle)   addStyleProperties();
  if (ReportDesignConstants.EXTENDED_ITEM.equalsIgnoreCase(getName())) {
    List styles=MetaDataDictionary.getInstance().getStyle().getLocalProperties();
    for (int i=0; i < styles.size(); i++) {
      String propName=((SystemPropertyDefn)styles.get(i)).getName();
      properties.put(propName,styles.get(i));
    }
  }
 else {
    if (!hasStyle && stylePropertyNames != null || hasStyle && isContainer() && stylePropertyNames != null)     throw new MetaDataException(new String[]{this.name},MetaDataException.DESIGN_EXCEPTION_ILLEGAL_STYLE_PROPS);
  }
}
Program: 78873
Project: 78873
Buggy source:
private void checkPropertyVisibilities() throws MetaDataException {
  if (this.propVisibilites == null)   return;
  Iterator propNames=this.propVisibilites.keySet().iterator();
  while (propNames.hasNext()) {
    String propName=(String)propNames.next();
    if (getProperty(propName) == null)     throw new MetaDataException(new String[]{name,propName},MetaDataException.DESIGN_EXCEPTION_VISIBILITY_PROPERTY_NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * Checks the validation of the defined property visibilities. If the property with the name is not defined, then the visibility is illegal.
 * @throws MetaDataException if the property definition is not found
 */
private void checkPropertyVisibilities() throws MetaDataException {
  if (this.propVisibilites == null)   return;
  Iterator propNames=this.propVisibilites.keySet().iterator();
  while (propNames.hasNext()) {
    String propName=(String)propNames.next();
    if (getProperty(propName) == null)     throw new MetaDataException(new String[]{name,propName},MetaDataException.DESIGN_EXCEPTION_VISIBILITY_PROPERTY_NOT_FOUND);
  }
}
Program: 78874
Project: 78874
Buggy source:
private StyleHandle getStyleHandle(){
  IStructuredSelection selection=InsertInLayoutUtil.editPart2Model(getSelection());
  if (!selection.isEmpty() && selection.getFirstElement() instanceof DesignElementHandle) {
    SharedStyleHandle style=((DesignElementHandle)selection.getFirstElement()).getStyle();
    for (Iterator iterator=selection.iterator(); iterator.hasNext(); ) {
      Object obj=iterator.next();
      if (!(obj instanceof DesignElementHandle)) {
        return null;
      }
      if (((DesignElementHandle)obj).getStyle() != style) {
        return null;
      }
    }
    return style;
  }
  return null;
}

Fixed version (ground truth):
private StyleHandle getStyleHandle(){
  IStructuredSelection selection=InsertInLayoutUtil.editPart2Model(getSelection());
  if (!selection.isEmpty() && selection.getFirstElement() instanceof DesignElementHandle) {
    if ((DesignElementHandle)selection.getFirstElement() instanceof RowHandle) {
      selection=InsertInLayoutUtil.editPart2Model(TableUtil.filletCellInSelectionEditorpart(getSelection()));
    }
    SharedStyleHandle style=((DesignElementHandle)selection.getFirstElement()).getStyle();
    for (Iterator iterator=selection.iterator(); iterator.hasNext(); ) {
      Object obj=iterator.next();
      if (!(obj instanceof DesignElementHandle)) {
        return null;
      }
      if (((DesignElementHandle)obj).getStyle() != style) {
        return null;
      }
    }
    return style;
  }
  return null;
}
Program: 78875
Project: 78875
Buggy source:
protected boolean moveData(Object transfer,Object target){
  if (isSupportPalletType(target,transfer)) {
    AbstractToolHandleExtends pre=BasePaletteFactory.getAbstractToolHandleExtendsFromPalletName(transfer);
    ReportCreationTool tool=new ReportCreationTool(new ReportElementFactory(transfer),pre);
    final EditDomain domain=UIUtil.getLayoutEditPartViewer().getEditDomain();
    tool.setEditDomain(domain);
    tool.setViewer(UIUtil.getLayoutEditPartViewer());
    tool.performCreation(UIUtil.getCurrentEditPart());
    SetCurrentEditModelCommand command=new SetCurrentEditModelCommand(tool.getNewObjectFromRequest());
    command.execute();
    return true;
  }
  return super.moveData(transfer,target);
}

Fixed version (ground truth):
protected boolean moveData(Object transfer,Object target){
  if (isSupportPalletType(target,transfer)) {
    AbstractToolHandleExtends pre=BasePaletteFactory.getAbstractToolHandleExtendsFromPaletteName(transfer);
    ReportCreationTool tool=new ReportCreationTool(new ReportElementFactory(transfer),pre);
    final EditDomain domain=UIUtil.getLayoutEditPartViewer().getEditDomain();
    tool.setEditDomain(domain);
    tool.setViewer(UIUtil.getLayoutEditPartViewer());
    tool.performCreation(UIUtil.getCurrentEditPart());
    SetCurrentEditModelCommand command=new SetCurrentEditModelCommand(tool.getNewObjectFromRequest());
    command.execute();
    return true;
  }
  return super.moveData(transfer,target);
}
Program: 78876
Project: 78876
Buggy source:
/** 
 */
private void performDirectEdit(){
  ImageBuilder dialog=new ImageBuilder(PlatformUI.getWorkbench().getDisplay().getActiveShell(),ImageBuilder.DLG_TITLE_EDIT);
  dialog.setInput(getModel());
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(IMG_TRANS_MSG);
  if (dialog.open() == Window.OK) {
    stack.commit();
  }
 else {
    stack.rollback();
  }
}

Fixed version (ground truth):
/** 
 */
private void performDirectEdit(){
  List dataSetList=DEUtil.getDataSetList((DesignElementHandle)getModel());
  ImageBuilder dialog=new ImageBuilder(PlatformUI.getWorkbench().getDisplay().getActiveShell(),ImageBuilder.DLG_TITLE_EDIT,dataSetList);
  dialog.setInput(getModel());
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(IMG_TRANS_MSG);
  if (dialog.open() == Window.OK) {
    stack.commit();
  }
 else {
    stack.rollback();
  }
}
Program: 78879
Project: 78879
Buggy source:
/** 
 * @param rs
 * @param rinfo
 * @param fileName
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,String fileName,String tName) throws OdaException {
  this.resultSet=rs;
  cachedResultSetRowNo=0;
  currentAvailableMaxLineNo=-1;
  tableName=tName;
  relationInfo=rinfo;
  currentRowNo=0;
  cachedResultSet=new String[Constants.CACHED_RESULT_SET_LENGTH][resultSet.getMetaData().getColumnCount()];
  this.rootPath=relationInfo.getTableRootPath(tableName);
  this.ancestorPath=relationInfo.getTableAncestor(tableName);
  this.isNotNestedXMLTable=rootPath.equals(ancestorPath);
  this.namesOfCachedColumns=relationInfo.getTableNestedXMLColumnNames(tableName);
  this.cachedColumns=new HashMap();
  sp=new SaxParser(fileName,this);
  spThread=new Thread(sp);
  spThread.start();
}

Fixed version (ground truth):
/** 
 * @param rs
 * @param rinfo
 * @param fileName
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,String fileName,String tName) throws OdaException {
  this.resultSet=rs;
  cachedResultSetRowNo=0;
  currentAvailableMaxLineNo=-1;
  tableName=tName;
  relationInfo=rinfo;
  currentRowNo=0;
  cachedResultSet=new String[Constants.CACHED_RESULT_SET_LENGTH][resultSet.getMetaData().getColumnCount()];
  this.rootPath=relationInfo.getTableRootPath(tableName);
  this.ancestorPath=relationInfo.getTableAncestor(tableName);
  this.isNotNestedXMLTable=rootPath.equals(ancestorPath);
  this.namesOfCachedColumns=relationInfo.getTableNestedXMLColumnNames(tableName);
  this.namesOfColumns=relationInfo.getTableColumnNames(tableName);
  if (!isNotNestedXMLTable) {
    spNestedQueryHelper=new SaxParserNestedQueryHelper(rinfo,fileName,tName);
    while (spNestedQueryHelper.isPrepared()) {
      try {
synchronized (this) {
          wait(1000);
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
  sp=new SaxParser(fileName,this);
  spThread=new Thread(sp);
  spThread.start();
}
Program: 78880
Project: 78880
Buggy source:
/** 
 * Populate all the columns that come from Nested XML data in certain row.
 */
private void populateNestedXMLDataMappingColumns(){
  if (!isNotNestedXMLTable) {
    Iterator it=cachedColumns.keySet().iterator();
    Integer i=null;
    while (it.hasNext()) {
      i=(Integer)it.next();
      cachedResultSet[cachedResultSetRowNo][i.intValue()]=cachedColumns.get(i).toString();
    }
  }
}

Fixed version (ground truth):
/** 
 * Populate all the columns that come from Nested XML data in certain row.
 */
private void populateNestedXMLDataMappingColumns(String path){
  if (!isNotNestedXMLTable) {
    for (int i=0; i < namesOfCachedColumns.length; i++) {
      for (int j=0; j < namesOfColumns.length; j++) {
        if (namesOfCachedColumns[i].equals(namesOfColumns[j])) {
          cachedResultSet[cachedResultSetRowNo][j]=this.spNestedQueryHelper.getNestedColumnValue(namesOfCachedColumns[i],path);
        }
      }
    }
  }
}
Program: 78881
Project: 78881
Buggy source:
public void detectNewRow(String path){
  clearCachedColumns(path);
  if (isSamePath(rootPath,path)) {
    populateNestedXMLDataMappingColumns();
    if (!isCurrentRowValid())     return;
    cachedResultSetRowNo++;
    currentAvailableMaxLineNo++;
    if (cachedResultSetRowNo > Constants.CACHED_RESULT_SET_LENGTH - 1) {
      sp.setStart(false);
      cachedResultSetRowNo=0;
    }
  }
}

Fixed version (ground truth):
public void detectNewRow(String path){
  if (SaxParserUtil.isSamePath(rootPath,path)) {
    populateNestedXMLDataMappingColumns(path);
    if (!isCurrentRowValid())     return;
    cachedResultSetRowNo++;
    currentAvailableMaxLineNo++;
    if (cachedResultSetRowNo > Constants.CACHED_RESULT_SET_LENGTH - 1) {
      sp.setStart(false);
      cachedResultSetRowNo=0;
    }
  }
}
Program: 78882
Project: 78882
Buggy source:
public void manipulateData(String path,String value){
  String[] filter=relationInfo.getTableColumnNames(tableName);
  for (int i=0; i < filter.length; i++) {
    if (isSamePath(relationInfo.getTableColumnPath(tableName,filter[i]),path)) {
      if (cachedResultSet[cachedResultSetRowNo][i] == null) {
        cachedResultSet[cachedResultSetRowNo][i]=value;
        if (cachedColumns.get(new Integer(i)) == null && value != null) {
          for (int k=0; k < namesOfCachedColumns.length; k++) {
            if (namesOfCachedColumns[k].equals(filter[i])) {
              cachedColumns.put(new Integer(i),value);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void manipulateData(String path,String value){
  for (int i=0; i < namesOfColumns.length; i++) {
    if (SaxParserUtil.isSamePath(relationInfo.getTableColumnPath(tableName,namesOfColumns[i]),path)) {
      if (cachedResultSet[cachedResultSetRowNo][i] == null) {
        cachedResultSet[cachedResultSetRowNo][i]=value;
      }
    }
  }
}
Program: 78883
Project: 78883
Buggy source:
/** 
 * Close the SaxParserConsumer.
 */
public void close(){
  if (this.spThread != null)   this.spThread.stop();
  this.cachedColumns=null;
  this.namesOfCachedColumns=null;
}

Fixed version (ground truth):
/** 
 * Close the SaxParserConsumer.
 */
public void close(){
  if (this.spThread != null)   this.spThread.stop();
}
Program: 78884
Project: 78884
Buggy source:
/** 
 * Return the root node of a schema tree.
 * @param fileName
 * @return
 * @throws OdaException
 */
public static ATreeNode getSchemaTree(String fileName) throws OdaException {
  try {
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document document=builder.parse(fileName);
    NodeList nodes=document.getChildNodes();
    ATreeNode root=new ATreeNode();
    root.setValue("String_Node_Str");
    populateNodeList(nodes,root,0);
    populateRoot(root);
    return root;
  }
 catch (  XPathExpressionException e) {
    throw new OdaException(e.getMessage());
  }
catch (  ParserConfigurationException e) {
    throw new OdaException(e.getMessage());
  }
catch (  SAXException e) {
    throw new OdaException(e.getMessage());
  }
catch (  IOException e) {
    throw new OdaException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Return the root node of a schema tree.
 * @param fileName
 * @return
 * @throws OdaException
 */
public static ATreeNode getSchemaTree(String fileName) throws OdaException {
  try {
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document document=builder.parse(fileName);
    NodeList nodes=document.getChildNodes();
    ATreeNode root=new ATreeNode();
    root.setValue("String_Node_Str");
    populateNodeList(nodes,root,0);
    populateRoot(root);
    return root;
  }
 catch (  ParserConfigurationException e) {
    throw new OdaException(e.getMessage());
  }
catch (  SAXException e) {
    throw new OdaException(e.getMessage());
  }
catch (  IOException e) {
    throw new OdaException(e.getMessage());
  }
}
Program: 78885
Project: 78885
Buggy source:
/** 
 * Populate the node list of a tree node in certain level. TODO add comments
 * @param nodeList
 * @param root
 * @param level
 * @throws XPathExpressionException
 */
private static void populateNodeList(NodeList nodeList,ATreeNode root,int level) throws XPathExpressionException {
  for (int i=0; i < nodeList.getLength(); i++) {
    boolean goToNextLevel=false;
    String space="String_Node_Str";
    for (int t=0; t < level; t++) {
      space+="String_Node_Str";
    }
    Node item=nodeList.item(i);
    if (item.getLocalName() != null) {
      ATreeNode node=new ATreeNode();
      if (item.getLocalName().equals("String_Node_Str") || item.getLocalName().equals("String_Node_Str")) {
        String name="String_Node_Str";
        if (item.getAttributes().getNamedItem("String_Node_Str") != null) {
          name=item.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        }
 else {
          name=item.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        }
        node.setParent(root);
        node.setValue(name);
        if (item.getLocalName().equals("String_Node_Str"))         node.setType(ATreeNode.ELEMENT_TYPE);
 else         node.setType(ATreeNode.ATTRIBUTE_TYPE);
        goToNextLevel=true;
      }
      if (item.getChildNodes().getLength() != 0) {
        populateNodeList(item.getChildNodes(),goToNextLevel ? node : root,goToNextLevel ? level + 1 : level);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Populate the node list of a tree node in certain level. TODO add comments
 * @param nodeList
 * @param root
 * @param level
 * @throws XPathExpressionException
 */
private static void populateNodeList(NodeList nodeList,ATreeNode root,int level){
  for (int i=0; i < nodeList.getLength(); i++) {
    boolean goToNextLevel=false;
    String space="String_Node_Str";
    for (int t=0; t < level; t++) {
      space+="String_Node_Str";
    }
    Node item=nodeList.item(i);
    if (item.getLocalName() != null) {
      ATreeNode node=new ATreeNode();
      if (item.getLocalName().equals("String_Node_Str") || item.getLocalName().equals("String_Node_Str")) {
        String name="String_Node_Str";
        if (item.getAttributes().getNamedItem("String_Node_Str") != null) {
          name=item.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        }
 else {
          name=item.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        }
        node.setParent(root);
        node.setValue(name);
        if (item.getLocalName().equals("String_Node_Str"))         node.setType(ATreeNode.ELEMENT_TYPE);
 else         node.setType(ATreeNode.ATTRIBUTE_TYPE);
        goToNextLevel=true;
      }
      if (item.getChildNodes().getLength() != 0) {
        populateNodeList(item.getChildNodes(),goToNextLevel ? node : root,goToNextLevel ? level + 1 : level);
      }
    }
  }
}
Program: 78887
Project: 78887
Buggy source:
/** 
 * returns the unique identifier for the image
 * @param image the image object 
 * @return the image id
 */
protected String getImageMapID(IImage image){
  if (image.getReportRunnable() != null) {
    return image.getReportRunnable().hashCode() + image.getID();
  }
  return image.getID();
}

Fixed version (ground truth):
/** 
 * returns the unique identifier for the image
 * @param image the image object
 * @return the image id
 */
protected String getImageMapID(IImage image){
  if (image.getReportRunnable() != null) {
    return image.getReportRunnable().hashCode() + image.getID();
  }
  return image.getID();
}
Program: 78888
Project: 78888
Buggy source:
/** 
 * dummy constructor 
 */
public HTMLServerImageHandler(){
}

Fixed version (ground truth):
/** 
 * dummy constructor
 */
public HTMLServerImageHandler(){
}
Program: 78889
Project: 78889
Buggy source:
/** 
 * returns a unique file name based on a directory and name prefix
 * @param imageDir directory to store the image
 * @param prefix prefix for the file name 
 * @return a file name
 */
protected String createUniqueFileName(String imageDir,String prefix){
  File file=null;
  do {
    count++;
    file=new File(imageDir + "String_Node_Str" + prefix+ count);
  }
 while (file.exists());
  return prefix + count;
}

Fixed version (ground truth):
/** 
 * returns a unique file name based on a directory and name prefix
 * @param imageDir directory to store the image
 * @param prefix prefix for the file name
 * @return a file name
 */
protected String createUniqueFileName(String imageDir,String prefix){
  File file=null;
  do {
    count++;
    file=new File(imageDir + "String_Node_Str" + prefix+ count);
  }
 while (file.exists());
  return prefix + count;
}
Program: 78890
Project: 78890
Buggy source:
/** 
 * Validates drag source from data view to layout. Support the multiple.
 * @return validate result
 */
public static boolean handleValidateInsert(Object insertObj){
  if (insertObj instanceof Object[]) {
    Object[] array=(Object[])insertObj;
    if (array.length == 0) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (!handleValidateInsert(array[i]))       return false;
    }
    return true;
  }
 else   if (insertObj instanceof IStructuredSelection) {
    return handleValidateInsert(((IStructuredSelection)insertObj).toArray());
  }
  return insertObj instanceof DataSetHandle || insertObj instanceof DataSetItemModel || insertObj instanceof ScalarParameterHandle;
}

Fixed version (ground truth):
/** 
 * Validates drag source from data view to layout. Support the multiple.
 * @return validate result
 */
public static boolean handleValidateInsert(Object insertObj){
  if (insertObj instanceof Object[]) {
    Object[] array=(Object[])insertObj;
    if (array.length == 0) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (!handleValidateInsert(array[i]))       return false;
    }
    return true;
  }
 else   if (insertObj instanceof IStructuredSelection) {
    return handleValidateInsert(((IStructuredSelection)insertObj).toArray());
  }
 else   if (insertObj instanceof ParameterHandle) {
    if (((ParameterHandle)insertObj).getRoot() instanceof LibraryHandle)     return false;
  }
  return insertObj instanceof DataSetHandle || insertObj instanceof DataSetItemModel || insertObj instanceof ScalarParameterHandle;
}
Program: 78891
Project: 78891
Buggy source:
private void refreshDataSets(){
  String selectedDataSetName=dataSetChooser.getText();
  String[] oldList=dataSetChooser.getItems();
  ArrayList avaiableList=new ArrayList();
  for (Iterator iter=SessionHandleAdapter.getInstance().getReportDesignHandle().getAllDataSets().iterator(); iter.hasNext(); ) {
    DataSetHandle dataSet=(DataSetHandle)iter.next();
    if (!dataSet.parametersIterator().hasNext()) {
      avaiableList.add(dataSet.getName());
    }
  }
  String[] newList=(String[])avaiableList.toArray(new String[]{});
  if (oldList.length != newList.length) {
    dataSetChooser.setItems(newList);
    if (StringUtil.isBlank(selectedDataSetName)) {
      dataSetChooser.select(0);
      refreshColumns(false);
    }
 else {
      dataSetChooser.setText(selectedDataSetName);
    }
  }
}

Fixed version (ground truth):
private void refreshDataSets(){
  String selectedDataSetName=dataSetChooser.getText();
  String[] oldList=dataSetChooser.getItems();
  ArrayList avaiableList=new ArrayList();
  for (Iterator iter=SessionHandleAdapter.getInstance().getReportDesignHandle().getAllDataSets().iterator(); iter.hasNext(); ) {
    DataSetHandle dataSet=(DataSetHandle)iter.next();
    if (!dataSet.parametersIterator().hasNext()) {
      avaiableList.add(dataSet.getQualifiedName());
    }
  }
  String[] newList=(String[])avaiableList.toArray(new String[]{});
  if (oldList.length != newList.length) {
    dataSetChooser.setItems(newList);
    if (StringUtil.isBlank(selectedDataSetName)) {
      dataSetChooser.select(0);
      refreshColumns(false);
    }
 else {
      dataSetChooser.setText(selectedDataSetName);
    }
  }
}
Program: 78892
Project: 78892
Buggy source:
protected boolean initDialog(){
  Assert.isNotNull(inputParameter);
  nameEditor.setText(inputParameter.getName());
  if (inputParameter.getDisplayName() != null) {
    promptTextEditor.setText(inputParameter.getDisplayName());
  }
  if (isStatic() && !DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(inputParameter.getControlType()) && (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(inputParameter.getDataType()) || DesignChoiceConstants.PARAM_TYPE_STRING.equals(inputParameter.getDataType()))) {
    defaultValue=removeQuoteString(inputParameter.getDefaultValue());
  }
 else {
    defaultValue=inputParameter.getDefaultValue();
  }
  helpTextEditor.setText(UIUtil.convertToGUIString(inputParameter.getHelpText()));
  if (inputParameter.getValueType().equals(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC)) {
    staticRadio.setSelection(true);
    for (Iterator iter=inputParameter.getPropertyHandle(ScalarParameterHandle.SELECTION_LIST_PROP).iterator(); iter.hasNext(); ) {
      SelectionChoiceHandle choiceHandle=(SelectionChoiceHandle)iter.next();
      choiceList.add(choiceHandle.getStructure());
    }
  }
 else {
    dynamicRadio.setSelection(true);
  }
  if (inputParameter.getPropertyHandle(ScalarParameterHandle.LIST_LIMIT_PROP).isSet()) {
    listLimit.setText(String.valueOf(inputParameter.getListlimit()));
  }
  changeDataType();
  dataTypeChooser.setText(dataType.findChoice(inputParameter.getDataType()).getDisplayName());
  switchParamterType();
  loading=false;
  return true;
}

Fixed version (ground truth):
protected boolean initDialog(){
  Assert.isNotNull(inputParameter);
  nameEditor.setText(inputParameter.getName());
  if (inputParameter.getDisplayName() != null) {
    promptTextEditor.setText(inputParameter.getDisplayName());
  }
  helpTextEditor.setText(UIUtil.convertToGUIString(inputParameter.getHelpText()));
  if (inputParameter.getValueType().equals(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC)) {
    staticRadio.setSelection(true);
    for (Iterator iter=inputParameter.getPropertyHandle(ScalarParameterHandle.SELECTION_LIST_PROP).iterator(); iter.hasNext(); ) {
      SelectionChoiceHandle choiceHandle=(SelectionChoiceHandle)iter.next();
      choiceList.add(choiceHandle.getStructure());
    }
  }
 else {
    dynamicRadio.setSelection(true);
  }
  if (isStatic() && !DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(inputParameter.getControlType()) && (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(inputParameter.getDataType()) || DesignChoiceConstants.PARAM_TYPE_STRING.equals(inputParameter.getDataType()))) {
    defaultValue=removeQuoteString(inputParameter.getDefaultValue());
  }
 else {
    defaultValue=inputParameter.getDefaultValue();
  }
  if (inputParameter.getPropertyHandle(ScalarParameterHandle.LIST_LIMIT_PROP).isSet()) {
    listLimit.setText(String.valueOf(inputParameter.getListlimit()));
  }
  changeDataType();
  dataTypeChooser.setText(dataType.findChoice(inputParameter.getDataType()).getDisplayName());
  switchParamterType();
  loading=false;
  return true;
}
Program: 78894
Project: 78894
Buggy source:
/** 
 * Return the root node of a schema tree.
 * @param fileName
 * @return
 */
public ATreeNode getSchemaTree(String fileName){
  sp=new SaxParser(fileName,this);
  Thread spThread=new Thread(sp);
  spThread.start();
  while (sp.isAlive()) {
    try {
synchronized (this) {
        wait();
      }
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  populateRoot(root);
  return root;
}

Fixed version (ground truth):
/** 
 * Return the root node of a schema tree.
 * @param fileName
 * @return
 * @throws OdaException
 */
public static ATreeNode getSchemaTree(String fileName) throws OdaException {
  try {
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document document=builder.parse(fileName);
    NodeList nodes=document.getChildNodes();
    ATreeNode root=new ATreeNode();
    root.setValue("String_Node_Str");
    populateNodeList(nodes,root,0);
    populateRoot(root);
    return root;
  }
 catch (  XPathExpressionException e) {
    throw new OdaException(e.getMessage());
  }
catch (  ParserConfigurationException e) {
    throw new OdaException(e.getMessage());
  }
catch (  SAXException e) {
    throw new OdaException(e.getMessage());
  }
catch (  IOException e) {
    throw new OdaException(e.getMessage());
  }
}
Program: 78895
Project: 78895
Buggy source:
public void manipulateData(String path,String value){
  String treamedPath=path.replaceAll("String_Node_Str","String_Node_Str").trim();
  if (!isAttribute(treamedPath)) {
    if (treamedPath.endsWith("String_Node_Str")) {
      this.inComplexType=!this.inComplexType;
      if (inComplexType && this.currentComplexTypeTreeNode == null) {
        this.currentComplexTypeTreeNode=this.currentTreeNode;
      }
 else       if (!inComplexType) {
        this.currentComplexTypeTreeNode=null;
      }
    }
  }
 else   this.insertNode(treamedPath,value);
}

Fixed version (ground truth):
public void manipulateData(String path,String value){
  String treamedPath=path.replaceAll("String_Node_Str","String_Node_Str").trim();
  this.insertNode(treamedPath);
}
Program: 78896
Project: 78896
Buggy source:
/** 
 * Insert a node specified by the path.
 * @param treatedPath
 */
private void insertNode(String treatedPath,String value){
  if (treatedPath.endsWith("String_Node_Str") || treatedPath.endsWith("String_Node_Str")) {
    if (inComplexType) {
      currentTreeNode=new ATreeNode();
      currentTreeNode.setParent(currentComplexTypeTreeNode);
    }
 else {
      currentTreeNode=new ATreeNode();
      currentTreeNode.setParent(root);
    }
    currentTreeNode.setValue(value);
    String elementPath=treatedPath.replaceFirst("String_Node_Str","String_Node_Str");
    if (elementPath.endsWith("String_Node_Str"))     currentTreeNode.setType(ATreeNode.ATTRIBUTE_TYPE);
 else     currentTreeNode.setType(ATreeNode.ELEMENT_TYPE);
  }
}

Fixed version (ground truth):
/** 
 * Insert a node specified by the path.
 * @param treatedPath
 */
private void insertNode(String treatedPath){
}
Program: 78897
Project: 78897
Buggy source:
public boolean findGroup(Object[] groupKeyValues) throws BirtException {
  List groups=query.getQueryDefn().getGroups();
  if (groupKeyValues.length > groups.size())   throw new DataException(ResourceConstants.INCORRECT_GROUP_KEY_VALUES);
  GroupDefinition group=null;
  String[] columnNames=new String[groupKeyValues.length];
  for (int i=0; i < columnNames.length; i++) {
    group=(GroupDefinition)groups.get(i);
    columnNames[i]=getGroupKeyColumnName(group);
  }
  odiResult.first(0);
  do {
    for (int i=0; i < columnNames.length; i++) {
      if (groupKeyValuesEqual(groupKeyValues,columnNames,i)) {
        if (i == columnNames.length - 1)         return true;
      }
 else {
        this.skipToEnd(i + 1);
        break;
      }
    }
  }
 while (odiResult.next());
  return false;
}

Fixed version (ground truth):
public boolean findGroup(Object[] groupKeyValues) throws BirtException {
  List groups=query.getQueryDefn().getGroups();
  if (groupKeyValues.length > groups.size())   throw new DataException(ResourceConstants.INCORRECT_GROUP_KEY_VALUES);
  GroupDefinition group=null;
  String[] columnNames=new String[groupKeyValues.length];
  for (int i=0; i < columnNames.length; i++) {
    group=(GroupDefinition)groups.get(i);
    columnNames[i]=getGroupKeyColumnName(group);
  }
  odiResult.first(0);
  if (odiResult.getCurrentResult() == null)   return false;
  do {
    for (int i=0; i < columnNames.length; i++) {
      if (groupKeyValuesEqual(groupKeyValues,columnNames,i)) {
        if (i == columnNames.length - 1)         return true;
      }
 else {
        this.skipToEnd(i + 1);
        break;
      }
    }
  }
 while (odiResult.next());
  return false;
}