nus-yam/ex-repair huggingface dataset:
Program: 78653
Project: 78653
Buggy source:
public IPageContent executeMasterPage(int pageNo,MasterPageDesign masterPage){
  IReportContent reportContent=context.getReportContent();
  IPageContent pageContent=reportContent.createPageContent();
  pageContent.setGenerateBy(masterPage);
  pageContent.setPageNumber(pageNo);
  context.setPageNumber(pageNo);
  if (masterPage instanceof SimpleMasterPageDesign) {
    TOCBuilder tocBuilder=context.getTOCBuilder();
    context.setTOCBuilder(null);
    SimpleMasterPageDesign pageDesign=(SimpleMasterPageDesign)masterPage;
    InstanceID iid=new InstanceID(null,pageDesign.getID(),null);
    pageContent.setInstanceID(iid);
    for (int i=0; i < pageDesign.getHeaderCount(); i++) {
      pageDesign.getHeader(i).accept(builder,new PageContentBuilder(pageContent.getHeader()));
    }
    for (int i=0; i < pageDesign.getFooterCount(); i++) {
      pageDesign.getFooter(i).accept(builder,new PageContentBuilder(pageContent.getFooter()));
    }
    context.setTOCBuilder(tocBuilder);
  }
  return pageContent;
}

Fixed version (ground truth):
public IPageContent executeMasterPage(int pageNo,MasterPageDesign masterPage){
  IReportContent reportContent=context.getReportContent();
  IPageContent pageContent=reportContent.createPageContent();
  pageContent.setGenerateBy(masterPage);
  pageContent.setPageNumber(pageNo);
  context.setPageNumber(pageNo);
  context.pushContent(pageContent);
  if (masterPage instanceof SimpleMasterPageDesign) {
    TOCBuilder tocBuilder=context.getTOCBuilder();
    context.setTOCBuilder(null);
    SimpleMasterPageDesign pageDesign=(SimpleMasterPageDesign)masterPage;
    InstanceID iid=new InstanceID(null,pageDesign.getID(),null);
    pageContent.setInstanceID(iid);
    for (int i=0; i < pageDesign.getHeaderCount(); i++) {
      pageDesign.getHeader(i).accept(builder,new PageContentBuilder(pageContent.getHeader()));
    }
    for (int i=0; i < pageDesign.getFooterCount(); i++) {
      pageDesign.getFooter(i).accept(builder,new PageContentBuilder(pageContent.getFooter()));
    }
    context.setTOCBuilder(tocBuilder);
  }
  context.popContent();
  return pageContent;
}
Program: 78654
Project: 78654
Buggy source:
void setUserProperty(String name,Object value) throws ScriptException ;

Fixed version (ground truth):
void setUserProperty(String name,Object value,String type) throws ScriptException ;
Program: 78655
Project: 78655
Buggy source:
public void setUserProperty(String name,Object value) throws ScriptException {
  try {
    handle.setProperty(name,value);
  }
 catch (  SemanticException e) {
    throw new ScriptException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void setUserProperty(String name,Object value,String type) throws ScriptException {
  if (handle.getUserPropertyDefnHandle(name) == null)   addUserProperty(name,type);
  try {
    handle.setProperty(name,value);
  }
 catch (  SemanticException e) {
    throw new ScriptException(e.getLocalizedMessage());
  }
}
Program: 78656
Project: 78656
Buggy source:
public void setNamedExpression(String name,String exp) throws ScriptException {
  setUserProperty(name,exp);
}

Fixed version (ground truth):
public void setNamedExpression(String name,String exp) throws ScriptException {
  UserPropertyDefnHandle propDefn=handle.getUserPropertyDefnHandle(name);
  if (propDefn == null) {
    addUserProperty(name,IPropertyType.EXPRESSION_TYPE_NAME);
  }
 else   if (propDefn.getType() != IPropertyType.EXPRESSION_TYPE)   return;
  setUserProperty(name,exp);
}
Program: 78657
Project: 78657
Buggy source:
public String getNamedExpression(String name){
  Object prop=getUserProperty(name);
  if (prop == null || (prop instanceof String))   return null;
  return (String)prop;
}

Fixed version (ground truth):
public String getNamedExpression(String name){
  UserPropertyDefnHandle propDefn=handle.getUserPropertyDefnHandle(name);
  if (propDefn == null || propDefn.getDefn() == null || propDefn.getDefn().getDefault() == null || propDefn.getType() != IPropertyType.EXPRESSION_TYPE)   return null;
  return propDefn.getDefn().getDefault().toString();
}
Program: 78658
Project: 78658
Buggy source:
protected void addNewSeriesDefinition(){
  SeriesDefinition sdTmp=SeriesDefinitionImpl.create();
  sdTmp.getSeriesPalette().update(-seriesDefns.size());
  sdTmp.getSeries().add(EcoreUtil.copy(((SeriesDefinition)seriesDefns.get(0)).getDesignTimeSeries()));
  sdTmp.setQuery((Query)EcoreUtil.copy(((SeriesDefinition)seriesDefns.get(0)).getQuery()));
  cleanDataDefinition(sdTmp);
  sdTmp.eAdapters().addAll(((SeriesDefinition)seriesDefns.get(0)).eAdapters());
  int firstIndex=getFirstIndexOfSameAxis();
  EList list=chart.getSampleData().getOrthogonalSampleData();
  OrthogonalSampleData sdOrthogonal=(OrthogonalSampleData)EcoreUtil.copy((EObject)list.get(firstIndex));
  sdOrthogonal.setSeriesDefinitionIndex(list.size());
  sdOrthogonal.eAdapters().addAll(chart.getSampleData().eAdapters());
  list.add(sdOrthogonal);
  seriesDefns.add(sdTmp);
}

Fixed version (ground truth):
protected void addNewSeriesDefinition(){
  SeriesDefinition sdTmp=SeriesDefinitionImpl.create();
  sdTmp.getSeriesPalette().update(-seriesDefns.size());
  sdTmp.getSeries().add(EcoreUtil.copy(((SeriesDefinition)seriesDefns.get(0)).getDesignTimeSeries()));
  sdTmp.setQuery((Query)EcoreUtil.copy(((SeriesDefinition)seriesDefns.get(0)).getQuery()));
  cleanDataDefinition(sdTmp);
  sdTmp.eAdapters().addAll(((SeriesDefinition)seriesDefns.get(0)).eAdapters());
  int firstIndex=getFirstIndexOfSameAxis();
  EList list=chart.getSampleData().getOrthogonalSampleData();
  OrthogonalSampleData sdOrthogonal=(OrthogonalSampleData)EcoreUtil.copy((EObject)list.get(firstIndex));
  sdOrthogonal.setSeriesDefinitionIndex(list.size());
  sdOrthogonal.eAdapters().addAll(chart.getSampleData().eAdapters());
  boolean isNotificaionIgnored=ChartAdapter.isNotificationIgnored();
  ChartAdapter.ignoreNotifications(true);
  list.add(sdOrthogonal);
  ChartAdapter.ignoreNotifications(isNotificaionIgnored);
  seriesDefns.add(sdTmp);
}
Program: 78659
Project: 78659
Buggy source:
/** 
 * Relativizes the path against this base path.
 * @param basePath the base path
 * @param path the path to convert
 * @return The relative path based on the base path if it is possible, orthe original path
 */
public static String getRelativedPath(String basePath,String path){
  return URIUtil.getRelativePath(new File(basePath).getParent(),new File(path).getParent()) + "String_Node_Str" + new File(path).getName();
}

Fixed version (ground truth):
/** 
 * Relativizes the path against this base path.
 * @param basePath the base path
 * @param path the path to convert
 * @return The relative path based on the base path if it is possible, orthe original path
 */
public static String getRelativedPath(String basePath,String path){
  return URIUtil.getRelativePath(new File(basePath).getParent(),path);
}
Program: 78661
Project: 78661
Buggy source:
/** 
 * Returns the library handle with the given namespace.
 * @param namespace the library namespace
 * @return the library handle with the given namespace
 */
public LibraryHandle getLibrary(String namespace){
  Module library=module.getVisibleLibraryWithNamespace(namespace);
  if (library == null)   return null;
  return (LibraryHandle)library.getHandle(library);
}

Fixed version (ground truth):
/** 
 * Returns the library handle with the given namespace.
 * @param namespace the library namespace
 * @return the library handle with the given namespace
 */
public LibraryHandle getLibrary(String namespace){
  Module library=module.getLibraryWithNamespace(namespace,IModuleNameSpace.ONE_LEVEL);
  if (library == null)   return null;
  return (LibraryHandle)library.getHandle(library);
}
Program: 78662
Project: 78662
Buggy source:
/** 
 * Returns all data source handles that this modules and the included modules contain.
 * @return all data source handles that this modules and the includedmodules contain.
 */
public List getAllDataSources(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all data source handles that this modules and the included modules contain.
 * @return all data source handles that this modules and the includedmodules contain.
 */
public List getAllDataSources(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}
Program: 78663
Project: 78663
Buggy source:
/** 
 * Returns the libraries this report design includes directly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly.
 */
public List getLibraries(){
  if (module.getLibraries() == null)   return Collections.EMPTY_LIST;
  List libraries=new ArrayList();
  Iterator iter=module.getLibraries().iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    libraries.add(library.handle());
  }
  return libraries;
}

Fixed version (ground truth):
/** 
 * Returns the libraries this report design includes directly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly.
 */
public List getLibraries(){
  return getLibraries(IModuleNameSpace.ONE_LEVEL);
}
Program: 78664
Project: 78664
Buggy source:
/** 
 * Returns all template parameter definition handles that this modules and the included modules contain.
 * @return all template parameter definition handles that this modules andthe included modules contain.
 */
List getAllTemplateParameterDefinitions(){
  List elementList=module.getModuleNameSpace(Module.TEMPLATE_PARAMETER_NAME_SPACE).getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all template parameter definition handles that this modules and the included modules contain.
 * @return all template parameter definition handles that this modules andthe included modules contain.
 */
List getAllTemplateParameterDefinitions(){
  List elementList=module.getModuleNameSpace(Module.TEMPLATE_PARAMETER_NAME_SPACE).getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 78665
Project: 78665
Buggy source:
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  List elementList=module.getNameSpace(Module.DATA_SET_NAME_SPACE).getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 78666
Project: 78666
Buggy source:
/** 
 * Returns all data set handles that this modules and the included modules contain.
 * @return all data set handles that this modules and the included modulescontain.
 */
public List getAllDataSets(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all data set handles that this modules and the included modules contain.
 * @return all data set handles that this modules and the included modulescontain.
 */
public List getAllDataSets(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}
Program: 78667
Project: 78667
Buggy source:
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  List elementList=module.getNameSpace(Module.DATA_SOURCE_NAME_SPACE).getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 78668
Project: 78668
Buggy source:
/** 
 * Returns all style element handles that this modules and the included modules contain.
 * @return all style element handles that this modules and the includedmodules contain.
 */
public List getAllStyles(){
  List elementList=module.getModuleNameSpace(Module.STYLE_NAME_SPACE).getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all style element handles that this modules and the included modules contain.
 * @return all style element handles that this modules and the includedmodules contain.
 */
public List getAllStyles(){
  List elementList=module.getModuleNameSpace(Module.STYLE_NAME_SPACE).getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}
Program: 78669
Project: 78669
Buggy source:
/** 
 * Returns all theme element handles that this modules and the included modules contain.
 * @return all theme element handles that this modules and the includedmodules contain.
 */
public List getAllThemes(){
  List elementList=module.getModuleNameSpace(Module.THEME_NAME_SPACE).getElements();
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all theme element handles that this modules and the included modules contain.
 * @return all theme element handles that this modules and the includedmodules contain.
 */
public List getAllThemes(){
  List elementList=module.getModuleNameSpace(Module.THEME_NAME_SPACE).getElements(IModuleNameSpace.ONE_LEVEL);
  return generateHandleList(elementList);
}
Program: 78670
Project: 78670
Buggy source:
/** 
 * Returns the libraries this report design includes directly or indirectly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly or indirectly.
 */
public List getAllLibraries(){
  if (module.getLibraries() == null)   return Collections.EMPTY_LIST;
  List libraries=new ArrayList();
  Iterator iter=module.getAllLibraries().iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    libraries.add(library.handle());
  }
  return libraries;
}

Fixed version (ground truth):
/** 
 * Returns the libraries this report design includes directly or indirectly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly or indirectly.
 */
public List getAllLibraries(){
  return getLibraries(IModuleNameSpace.ARBITARY_LEVEL);
}
Program: 78671
Project: 78671
Buggy source:
/** 
 * Returns whether the namespace to check is duplicate in target module. This method helps to judge whether the library to check can be included in target module.
 * @param namespaceToCheck the namespace to check
 * @return true if the namespace to check is duplicate.
 */
public boolean isDuplicateNamespace(String namespaceToCheck){
  Module rootHost=this;
  while (rootHost instanceof Library && ((Library)rootHost).getHost() != null)   rootHost=((Library)rootHost).getHost();
  List libraries=rootHost.getAllLibraries();
  Iterator iter=libraries.iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    if (library.getNamespace().equals(namespaceToCheck))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the namespace to check is duplicate in target module. This method helps to judge whether the library to check can be included in target module.
 * @param namespaceToCheck the namespace to check
 * @return true if the namespace to check is duplicate.
 */
public boolean isDuplicateNamespace(String namespaceToCheck){
  Module rootHost=this;
  while (rootHost instanceof Library && ((Library)rootHost).getHost() != null)   rootHost=((Library)rootHost).getHost();
  List libraries=rootHost.getLibraries(IModuleNameSpace.ARBITARY_LEVEL);
  Iterator iter=libraries.iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    if (library.getNamespace().equals(namespaceToCheck))     return true;
  }
  return false;
}
Program: 78672
Project: 78672
Buggy source:
/** 
 * Returns the resolved theme of the report design/library.
 * @param module the module to resolve the theme
 * @return the resolved theme of the report design/library
 */
public Theme getTheme(Module module){
  if (theme == null)   return null;
  if (theme.isResolved())   return (Theme)theme.getElement();
  IModuleNameSpace resolver=module.getModuleNameSpace(Module.THEME_NAME_SPACE);
  ElementRefValue refValue=resolver.resolve(ReferenceValueUtil.needTheNamespacePrefix(theme,this));
  Theme target=null;
  if (refValue.isResolved()) {
    target=(Theme)refValue.getElement();
    theme.resolve(target);
    target.addClient(this,THEME_PROP);
  }
  return target;
}

Fixed version (ground truth):
/** 
 * Returns the resolved theme of the report design/library.
 * @param module the module to resolve the theme
 * @return the resolved theme of the report design/library
 */
public Theme getTheme(Module module){
  if (theme == null)   return null;
  if (theme.isResolved())   return (Theme)theme.getElement();
  IModuleNameSpace resolver=module.getModuleNameSpace(Module.THEME_NAME_SPACE);
  ElementRefValue refValue=resolver.resolve(ReferenceValueUtil.needTheNamespacePrefix(theme,this),null);
  Theme target=null;
  if (refValue.isResolved()) {
    target=(Theme)refValue.getElement();
    theme.resolve(target);
    target.addClient(this,THEME_PROP);
  }
  return target;
}
Program: 78673
Project: 78673
Buggy source:
/** 
 * Returns only libraries this module includes directly.
 * @return list of libraries.
 */
public List getLibraries(){
  if (libraries != null)   return new ArrayList(libraries);
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
/** 
 * Returns only libraries this module includes directly.
 * @return list of libraries.
 */
public List getLibraries(){
  return getLibraries(IModuleNameSpace.ONE_LEVEL);
}
Program: 78674
Project: 78674
Buggy source:
/** 
 * Returns the module with the given namespace. This method checks the namespace in both directly and indirectly included libraries.
 * @param namespace the module namespace
 * @return the module with the given namespace
 */
public Library getLibraryWithNamespace(String namespace){
  if (libraries == null)   return null;
  List list=getAllLibraries();
  Iterator iter=list.iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    if (library.getNamespace().equals(namespace))     return library;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the module with the given namespace. This method checks the namespace in included libraries within the given depth.
 * @param namespace the module namespace
 * @param level the depth of the library
 * @return the module with the given namespace
 * @see IModuleNameSpace
 */
public Library getLibraryWithNamespace(String namespace,int level){
  if (libraries == null)   return null;
  List list=getLibraries(level);
  Iterator iter=list.iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    if (library.getNamespace().equals(namespace))     return library;
  }
  return null;
}
Program: 78675
Project: 78675
Buggy source:
/** 
 * Finds a shared style in this module and its included modules.
 * @param name Name of the style to find.
 * @return The style, or null if the style is not found.
 */
public StyleElement findStyle(String name){
  ElementRefValue refValue=moduleNameSpaces[STYLE_NAME_SPACE].resolve(name);
  return (StyleElement)refValue.getElement();
}

Fixed version (ground truth):
/** 
 * Finds a shared style in this module and its included modules.
 * @param name Name of the style to find.
 * @return The style, or null if the style is not found.
 */
public StyleElement findStyle(String name){
  ElementRefValue refValue=moduleNameSpaces[STYLE_NAME_SPACE].resolve(name,null);
  return (StyleElement)refValue.getElement();
}
Program: 78676
Project: 78676
Buggy source:
/** 
 * Finds a theme in this module and its included modules.
 * @param name Name of the style to find.
 * @return The style, or null if the style is not found.
 */
public Theme findTheme(String name){
  ElementRefValue refValue=moduleNameSpaces[THEME_NAME_SPACE].resolve(name);
  return (Theme)refValue.getElement();
}

Fixed version (ground truth):
/** 
 * Finds a theme in this module and its included modules.
 * @param name Name of the style to find.
 * @return The style, or null if the style is not found.
 */
public Theme findTheme(String name){
  ElementRefValue refValue=moduleNameSpaces[THEME_NAME_SPACE].resolve(name,null);
  return (Theme)refValue.getElement();
}
Program: 78677
Project: 78677
Buggy source:
/** 
 * Returns all libaries this module contains.
 * @return list of libraries.
 */
public List getAllLibraries(){
  if (libraries == null)   return Collections.EMPTY_LIST;
  List allLibraries=new ArrayList();
  allLibraries.addAll(getLibraries());
  Iterator iter=getLibraries().iterator();
  while (iter.hasNext()) {
    Library library=(Library)iter.next();
    allLibraries.addAll(library.getAllLibraries());
  }
  return allLibraries;
}

Fixed version (ground truth):
/** 
 * Returns all libaries this module contains.
 * @return list of libraries.
 */
public List getAllLibraries(){
  return getLibraries(IModuleNameSpace.ARBITARY_LEVEL);
}
Program: 78678
Project: 78678
Buggy source:
/** 
 * Checks the Action object and then output corresponding tag and property.
 * @param action The <code>IHyperlinkAction</code> object.
 * @return A <code>boolean</code> value indicating whether the Actionobject is valid or not.
 */
protected boolean handleAction(IHyperlinkAction action){
  if (action == null) {
    return false;
  }
  Action act=new Action(action);
  if (actionHandler == null) {
    return false;
  }
  String link=actionHandler.getURL(act,renderContext);
  boolean ret=(link != null && !link.equals("String_Node_Str"));
  if (ret) {
    if (action.getType() == IAction.ACTION_BOOKMARK) {
      link="String_Node_Str" + link;
    }
 else {
      if (urlEncoding != null) {
        link=URLEncoder.encode(link,urlEncoding);
      }
    }
    writer.openTag(HTMLTags.TAG_A);
    writer.attribute(HTMLTags.ATTR_HREF,link);
    writer.attribute(HTMLTags.ATTR_TARGET,action.getTargetWindow());
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Checks the Action object and then output corresponding tag and property.
 * @param action The <code>IHyperlinkAction</code> object.
 * @return A <code>boolean</code> value indicating whether the Actionobject is valid or not.
 */
protected boolean handleAction(IHyperlinkAction action){
  if (action == null) {
    return false;
  }
  Action act=new Action(action);
  if (actionHandler == null) {
    return false;
  }
  String link=actionHandler.getURL(act,renderContext);
  boolean ret=(link != null && !link.equals("String_Node_Str"));
  if (ret) {
    writer.openTag(HTMLTags.TAG_A);
    writer.attribute(HTMLTags.ATTR_HREF,link);
    writer.attribute(HTMLTags.ATTR_TARGET,action.getTargetWindow());
  }
  return ret;
}
Program: 78679
Project: 78679
Buggy source:
/** 
 * builds URL for drillthrough action
 * @param action instance of the IAction instance
 * @param context the context for building the action string
 * @return a URL 
 */
protected String buildDrillAction(IAction action,Object context){
  String baseURL=null;
  if (context != null && context instanceof HTMLRenderContext) {
    baseURL=((HTMLRenderContext)context).getBaseURL();
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    link.append(baseURL);
    link.append("String_Node_Str");
    try {
      link.append(URLEncoder.encode(reportName,"String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e1) {
    }
    String format=action.getFormat();
    if (format != null && format.length() > 0) {
      link.append("String_Node_Str" + format);
    }
    if (action.getParameterBindings() != null) {
      Iterator paramsIte=action.getParameterBindings().entrySet().iterator();
      while (paramsIte.hasNext()) {
        Map.Entry entry=(Map.Entry)paramsIte.next();
        try {
          link.append("String_Node_Str" + URLEncoder.encode((String)entry.getKey(),"String_Node_Str") + "String_Node_Str"+ URLEncoder.encode((String)entry.getValue(),"String_Node_Str"));
        }
 catch (        UnsupportedEncodingException e) {
        }
      }
    }
  }
  if (action.getBookmark() != null) {
    link.append("String_Node_Str");
    link.append(action.getBookmark());
  }
  return link.toString();
}

Fixed version (ground truth):
/** 
 * builds URL for drillthrough action
 * @param action instance of the IAction instance
 * @param context the context for building the action string
 * @return a URL
 */
protected String buildDrillAction(IAction action,Object context){
  String baseURL=null;
  if (context != null && context instanceof HTMLRenderContext) {
    baseURL=((HTMLRenderContext)context).getBaseURL();
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    link.append(baseURL);
    appendReportDesignName(link,reportName);
    String format=action.getFormat();
    appendFormat(link,format);
    Map params=action.getParameterBindings();
    if (params != null) {
      Iterator paramsIte=params.entrySet().iterator();
      while (paramsIte.hasNext()) {
        Map.Entry entry=(Map.Entry)paramsIte.next();
        String key=(String)entry.getKey();
        Object valueObj=entry.getValue();
        appendParamter(link,key,valueObj);
      }
    }
  }
  String bookmark=action.getBookmark();
  appendBookmark(link,bookmark);
  return link.toString();
}
Program: 78680
Project: 78680
Buggy source:
protected void handleFileImage(String imageFile,IImageContent imageContent){
  ReportDesignHandle reportDesign=context.getDesign();
  if (reportDesign != null) {
    URL url=reportDesign.findResource(imageFile,IResourceLocator.IMAGE);
    if (url != null) {
      try {
        URI uri=new URI(url.toExternalForm());
        File file=new File(uri);
        imageFile=file.getAbsolutePath();
      }
 catch (      URISyntaxException x) {
      }
    }
  }
  imageContent.setURI(imageFile);
  imageContent.setImageSource(IImageContent.IMAGE_FILE);
  imageContent.setExtension(FileUtil.getExtFromFileName(imageFile,FileUtil.SEPARATOR_PATH));
  if (imageFile == null) {
    logger.log(Level.SEVERE,"String_Node_Str");
    context.addException(new EngineException(MessageConstants.MISSING_IMAGE_FILE_ERROR));
  }
}

Fixed version (ground truth):
protected void handleFileImage(String imageFile,IImageContent imageContent){
  ReportDesignHandle reportDesign=context.getDesign();
  if (reportDesign != null) {
    URL url=reportDesign.findResource(imageFile,IResourceLocator.IMAGE);
    if (url != null) {
      String fileName=url.getFile();
      if (fileName != null) {
        imageFile=fileName;
      }
    }
  }
  imageContent.setURI(imageFile);
  imageContent.setImageSource(IImageContent.IMAGE_FILE);
  imageContent.setExtension(FileUtil.getExtFromFileName(imageFile,FileUtil.SEPARATOR_PATH));
  if (imageFile == null) {
    logger.log(Level.SEVERE,"String_Node_Str");
    context.addException(new EngineException(MessageConstants.MISSING_IMAGE_FILE_ERROR));
  }
}
Program: 78682
Project: 78682
Buggy source:
private String getUniqueReportName(){
  IProject[] pjs=ResourcesPlugin.getWorkspace().getRoot().getProjects();
  resetUniqueCount();
  boolean goon=true;
  while (goon) {
    goon=false;
    for (int i=0; i < pjs.length; i++) {
      if (pjs[i].isAccessible()) {
        if (!validDuplicate(NEW_REPORT_FILE_NAME_PREFIX,NEW_REPORT_FILE_EXTENSION,UNIQUE_COUNTER,pjs[i])) {
          UNIQUE_COUNTER++;
          goon=true;
          break;
        }
      }
    }
  }
  if (UNIQUE_COUNTER == 0) {
    return NEW_REPORT_FILE_NAME;
  }
  return NEW_REPORT_FILE_NAME_PREFIX + "String_Node_Str" + UNIQUE_COUNTER+ NEW_REPORT_FILE_EXTENSION;
}

Fixed version (ground truth):
private String getUniqueReportName(){
  IProject[] pjs=ResourcesPlugin.getWorkspace().getRoot().getProjects();
  if (pjs.length != 0) {
    resetUniqueCount();
    boolean goon=true;
    while (goon) {
      goon=false;
      for (int i=0; i < pjs.length; i++) {
        if (pjs[i].isAccessible()) {
          if (!validDuplicate(NEW_REPORT_FILE_NAME_PREFIX,NEW_REPORT_FILE_EXTENSION,UNIQUE_COUNTER,pjs[i])) {
            UNIQUE_COUNTER++;
            goon=true;
            break;
          }
        }
      }
    }
    if (UNIQUE_COUNTER == 0) {
      return NEW_REPORT_FILE_NAME;
    }
    return NEW_REPORT_FILE_NAME_PREFIX + "String_Node_Str" + UNIQUE_COUNTER+ NEW_REPORT_FILE_EXTENSION;
  }
 else {
    String extension=NEW_REPORT_FILE_EXTENSION;
    String path=Platform.getLocation().toOSString();
    String name=NEW_REPORT_FILE_NAME_PREFIX + NEW_REPORT_FILE_EXTENSION;
    int count=0;
    File file;
    file=new File(path,name);
    while (file.exists()) {
      count++;
      name=NEW_REPORT_FILE_NAME_PREFIX + "String_Node_Str" + count+ NEW_REPORT_FILE_EXTENSION;
      file=null;
      file=new File(path,name);
    }
    file=null;
    return name;
  }
}
Program: 78683
Project: 78683
Buggy source:
public void addPages(){
  newReportFileWizardPage=new WizardNewReportCreationPage(WIZARDPAGE);
  addPage(newReportFileWizardPage);
  templateChoicePage=new WizardTemplateChoicePage(TEMPLATECHOICEPAGE);
  addPage(templateChoicePage);
  newReportFileWizardPage.setTitle(REPORT);
  newReportFileWizardPage.setDescription(CREATE_A_NEW_REPORT);
  templateChoicePage.setTitle(REPORT);
  templateChoicePage.setDescription(SELECT_A_REPORT_TEMPLATE);
  settingPage=new WizardReportSettingPage(null);
  settingPage.setTitle(Messages.getString("String_Node_Str"));
  addPage(settingPage);
  newReportFileWizardPage.setInitialFileName(getNewFileFullName(NEW_REPORT_FILE_NAME_PREFIX));
  newReportFileWizardPage.setInitialFileLocation(getDefaultLocation());
}

Fixed version (ground truth):
public void addPages(){
  newReportFileWizardPage=new WizardNewReportCreationPage(WIZARDPAGE);
  addPage(newReportFileWizardPage);
  templateChoicePage=new WizardTemplateChoicePage(TEMPLATECHOICEPAGE);
  addPage(templateChoicePage);
  newReportFileWizardPage.setTitle(REPORT);
  newReportFileWizardPage.setDescription(CREATE_A_NEW_REPORT);
  templateChoicePage.setTitle(REPORT);
  templateChoicePage.setDescription(SELECT_A_REPORT_TEMPLATE);
  settingPage=new WizardReportSettingPage(null);
  settingPage.setTitle(Messages.getFormattedString("String_Node_Str",new Object[]{Messages.getString("String_Node_Str")}));
  addPage(settingPage);
  newReportFileWizardPage.setInitialFileName(getNewFileFullName(NEW_REPORT_FILE_NAME_PREFIX));
  newReportFileWizardPage.setInitialFileLocation(getDefaultLocation());
}
Program: 78684
Project: 78684
Buggy source:
public Object[] getDataForColumns(String[] sExpressions,int iMaxRecords,boolean byRow){
  byRow=false;
  Object[] array=new Object[ROW_COUNT];
  for (int i=0; i < array.length; i++) {
    Object[] innerArray=new Object[sExpressions.length];
    for (int j=0; j < sExpressions.length; j++) {
      String str=sExpressions[j];
      int index=Integer.valueOf(str.substring(5,str.length() - 3)).intValue() - 1;
      innerArray[j]=new Integer(((String[])getPreviewData().get(i))[index]);
    }
    array[i]=innerArray;
  }
  return array;
}

Fixed version (ground truth):
public Object[] getDataForColumns(String[] sExpressions,int iMaxRecords,boolean byRow){
  byRow=false;
  Object[] array=new Object[sExpressions.length];
  for (int i=0; i < sExpressions.length; i++) {
    Object[] innerArray=new Object[ROW_COUNT];
    for (int j=0; j < ROW_COUNT; j++) {
      String str=sExpressions[i];
      int intStart=str.lastIndexOf(' ') + 1;
      int index=Integer.valueOf(str.substring(intStart,intStart + 1)).intValue() - 1;
      innerArray[j]=new Integer(((String[])getPreviewData().get(j))[index]);
    }
    array[i]=innerArray;
  }
  return array;
}
Program: 78685
Project: 78685
Buggy source:
public void dragSetData(DragSourceEvent event){
  if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
    TreeItem[] selection=availableDbObjectsTree.getSelection();
    if (selection.length > 0) {
      Object obj=selection[0].getData();
      if (obj instanceof DbObject) {
        event.data=((DbObject)obj).getName();
      }
 else       if (obj instanceof Procedure) {
        event.data=((Procedure)obj).getProcedureName();
      }
 else       event.data=selection[0].getData();
    }
  }
}

Fixed version (ground truth):
public void dragSetData(DragSourceEvent event){
  if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
    TreeItem[] selection=availableDbObjectsTree.getSelection();
    if (selection.length > 0) {
      Object obj=selection[0].getData();
      if (obj instanceof DbObject) {
        event.data=((DbObject)obj).getName();
      }
 else       if (obj instanceof Procedure) {
        event.data=((Procedure)obj).getProcedureNameWithSchema();
      }
 else       event.data=selection[0].getData();
    }
  }
}
Program: 78686
Project: 78686
Buggy source:
/** 
 * Adds drag support to tree..Must set tree before execution.
 */
public void addDragSupportToTree(){
  DragSource dragSource=new DragSource(availableDbObjectsTree,DND.DROP_COPY);
  dragSource.setTransfer(new Transfer[]{TextTransfer.getInstance()});
  dragSource.addDragListener(new DragSourceAdapter(){
    public void dragStart(    DragSourceEvent event){
      TreeItem[] selection=availableDbObjectsTree.getSelection();
      if (selection.length > 0) {
        if (selection[0].getData() instanceof DbObject) {
          if (((DbObject)selection[0].getData()).getType() == DbObject.PROCEDURE_TYPE) {
            event.doit=false;
            return;
          }
        }
 else         if (selection[0].getData() instanceof ProcedureParameter) {
          event.doit=false;
          return;
        }
      }
 else       if (selection.length <= 0 || selection[0].getData() == null) {
        event.doit=false;
        return;
      }
    }
    public void dragSetData(    DragSourceEvent event){
      if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
        TreeItem[] selection=availableDbObjectsTree.getSelection();
        if (selection.length > 0) {
          Object obj=selection[0].getData();
          if (obj instanceof DbObject) {
            event.data=((DbObject)obj).getName();
          }
 else           if (obj instanceof Procedure) {
            event.data=((Procedure)obj).getProcedureName();
          }
 else           event.data=selection[0].getData();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Adds drag support to tree..Must set tree before execution.
 */
public void addDragSupportToTree(){
  DragSource dragSource=new DragSource(availableDbObjectsTree,DND.DROP_COPY);
  dragSource.setTransfer(new Transfer[]{TextTransfer.getInstance()});
  dragSource.addDragListener(new DragSourceAdapter(){
    public void dragStart(    DragSourceEvent event){
      TreeItem[] selection=availableDbObjectsTree.getSelection();
      if (selection.length > 0) {
        if (selection[0].getData() instanceof DbObject) {
          if (((DbObject)selection[0].getData()).getType() == DbObject.PROCEDURE_TYPE) {
            event.doit=false;
            return;
          }
        }
 else         if (selection[0].getData() instanceof ProcedureParameter) {
          event.doit=false;
          return;
        }
      }
 else       if (selection.length <= 0 || selection[0].getData() == null) {
        event.doit=false;
        return;
      }
    }
    public void dragSetData(    DragSourceEvent event){
      if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
        TreeItem[] selection=availableDbObjectsTree.getSelection();
        if (selection.length > 0) {
          Object obj=selection[0].getData();
          if (obj instanceof DbObject) {
            event.data=((DbObject)obj).getName();
          }
 else           if (obj instanceof Procedure) {
            event.data=((Procedure)obj).getProcedureNameWithSchema();
          }
 else           event.data=selection[0].getData();
        }
      }
    }
  }
);
}
Program: 78688
Project: 78688
Buggy source:
public int compare(Object o1,Object o2){
  TableItem it1=(TableItem)o1;
  TableItem it2=(TableItem)o2;
  int result=0;
  if (asc) {
    result=it1.getText(columnIndex).compareTo(it2.getText(columnIndex));
  }
 else {
    result=it2.getText(columnIndex).compareTo(it1.getText(columnIndex));
  }
  return result;
}

Fixed version (ground truth):
public int compare(String source,String target){
  int result=0;
  if (columnIndex == 1)   result=super.compare(getFileName(source),getFileName(target));
 else   if (columnIndex == 2)   result=super.compare(getFilePath(source),getFilePath(target));
  if (!asc)   return result;
 else   return result*=-1;
}
Program: 78689
Project: 78689
Buggy source:
/** 
 * refresh jarViewer
 */
private void refreshJarViewer(){
  jarViewer.setInput(null);
  jarViewer.setInput(jarMap);
  for (int i=0; i < jarViewer.getTable().getItemCount(); i++) {
    TableItem ti=jarViewer.getTable().getItem(i);
    Object element=ti.getData();
    String c0="String_Node_Str", c1="String_Node_Str", c2="String_Node_Str";
    if (element instanceof Map.Entry) {
      Map.Entry entry=(Map.Entry)element;
      JarFile jarInfo=(JarFile)entry.getValue();
      c0=jarInfo.getState();
      c1=(String)entry.getKey();
      c2=jarInfo.getFilePath();
    }
    ti.setText(0,c0);
    ti.setText(1,c1);
    ti.setText(2,c2);
  }
}

Fixed version (ground truth):
/** 
 * refresh jarViewer
 */
private void refreshJarViewer(){
  jarViewer.setInput(null);
  jarViewer.setInput(jarMap);
  refreshJar();
}
Program: 78690
Project: 78690
Buggy source:
/** 
 * Carry out sort operation against certain jar column
 * @param columnIndex the column based on which the sort operation would be carried out 
 * @param asc the sort direction
 */
private void sortJar(final int columnIndex,final boolean asc){
  TableItem[] tableItems=jarViewer.getTable().getItems();
  sort(columnIndex,asc,tableItems);
  String[][] records=mapTableItemsTo2DArray(tableItems);
  jarViewer.getTable().removeAll();
  TableItem tableItem;
  for (int i=0; i < tableItems.length; i++) {
    tableItem=new TableItem(jarViewer.getTable(),SWT.NONE);
    tableItem.setText(records[i]);
  }
}

Fixed version (ground truth):
/** 
 * Carry out sort operation against certain jar column
 * @param columnIndex the column based on which the sort operation would be carried out 
 * @param asc the sort direction
 */
private void sortJar(final int columnIndex,final boolean asc){
  try {
    jarViewer.setSorter(new ViewerSorter(new RuleBasedCollator(((RuleBasedCollator)Collator.getInstance()).getRules()){
      public int compare(      String source,      String target){
        int result=0;
        if (columnIndex == 1)         result=super.compare(getFileName(source),getFileName(target));
 else         if (columnIndex == 2)         result=super.compare(getFilePath(source),getFilePath(target));
        if (!asc)         return result;
 else         return result*=-1;
      }
    }
));
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  refreshJar();
}
Program: 78691
Project: 78691
Buggy source:
/** 
 * actions after add button is click in jarPage
 */
private void addJar(){
  jarChanged=true;
  FileDialog dlg=new FileDialog(getShell());
  dlg.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str"});
  if (dlg.open() != null) {
    String fn=dlg.getFilterPath() + File.separator + dlg.getFileName();
    if (jarMap.containsKey(dlg.getFileName()) && !((JarFile)jarMap.get(dlg.getFileName())).getState().equals(JarFile.ODA_FILE_NOT_EXIST_TOKEN)) {
      ExceptionHandler.openErrorMessageBox(JdbcPlugin.getResourceString("String_Node_Str"),JdbcPlugin.getResourceString("String_Node_Str"));
      return;
    }
    JarFile jarInfo=new JarFile(dlg.getFileName(),fn,"String_Node_Str",false);
    if (jarsToBeDeleted.containsKey(dlg.getFileName())) {
      jarsToBeDeleted.remove(dlg.getFileName());
    }
 else {
      jarsToBeCopied.put(dlg.getFileName(),jarInfo);
    }
    jarsToBeCopiedRuntime.put(dlg.getFileName(),jarInfo);
    jarMap.put(dlg.getFileName(),jarInfo);
    refreshJarViewer();
    updateJarButtons();
  }
}

Fixed version (ground truth):
/** 
 * actions after add button is click in jarPage
 */
private void addJar(){
  jarChanged=true;
  FileDialog dlg=new FileDialog(getShell());
  dlg.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str"});
  if (dlg.open() != null) {
    String fn=dlg.getFilterPath() + File.separator + dlg.getFileName();
    if (jarMap.containsKey(dlg.getFileName()) && !((JarFile)jarMap.get(dlg.getFileName())).getState().equals(JarFile.ODA_FILE_NOT_EXIST_TOKEN)) {
      ExceptionHandler.openErrorMessageBox(JdbcPlugin.getResourceString("String_Node_Str"),JdbcPlugin.getResourceString("String_Node_Str"));
      return;
    }
    JarFile jarInfo=new JarFile(dlg.getFileName(),fn,"String_Node_Str",false);
    if (jarsToBeDeleted.containsKey(dlg.getFileName())) {
      jarsToBeDeleted.remove(dlg.getFileName());
    }
 else {
      jarsToBeCopied.put(dlg.getFileName(),jarInfo);
    }
    if (jarsToBeDeletedRuntime.containsKey(dlg.getFileName()))     jarsToBeDeletedRuntime.remove(dlg.getFileName());
 else     jarsToBeCopiedRuntime.put(dlg.getFileName(),jarInfo);
    jarMap.put(dlg.getFileName(),jarInfo);
    refreshJarViewer();
    updateJarButtons();
  }
}
Program: 78692
Project: 78692
Buggy source:
/** 
 * refresh driverViewer
 */
private void refreshDriverViewer(){
  driverViewer.setInput(null);
  driverViewer.setInput(driverMap);
  for (int i=0; i < driverViewer.getTable().getItemCount(); i++) {
    TableItem ti=driverViewer.getTable().getItem(i);
    Object element=ti.getData();
    String c1="String_Node_Str", c2="String_Node_Str", c3="String_Node_Str";
    if (element instanceof Map.Entry) {
      Map.Entry entry=(Map.Entry)element;
      DriverInfo driverInfo=(DriverInfo)entry.getValue();
      c1=entry.getKey().toString();
      c2=driverInfo.getDisplayName();
      c3=driverInfo.getUrlTemplate();
    }
    ti.setText(0,"String_Node_Str");
    ti.setText(1,c1);
    ti.setText(2,c2);
    ti.setText(3,c3);
  }
}

Fixed version (ground truth):
/** 
 * refresh driverViewer
 */
private void refreshDriverViewer(){
  driverViewer.setInput(null);
  driverViewer.setInput(driverMap);
  refreshDriver();
}
Program: 78693
Project: 78693
Buggy source:
/** 
 * actions after restore button is click in jarPage
 */
private void restoreJar(){
  jarChanged=true;
  if (jarViewer.getTable().getSelectionIndex() >= 0 && jarViewer.getTable().getSelectionIndex() < jarViewer.getTable().getItemCount()) {
    Map.Entry fn=(Map.Entry)jarViewer.getTable().getSelection()[0].getData();
    ((JarFile)fn.getValue()).setRestored();
    jarsToBeCopied.put(((JarFile)fn.getValue()).getFileName(),(JarFile)fn.getValue());
    checkJarState();
    refreshJarViewer();
    updateJarButtons();
  }
}

Fixed version (ground truth):
/** 
 * actions after restore button is click in jarPage
 */
private void restoreJar(){
  jarChanged=true;
  if (jarViewer.getTable().getSelectionIndex() >= 0 && jarViewer.getTable().getSelectionIndex() < jarViewer.getTable().getItemCount()) {
    Map.Entry fn=(Map.Entry)jarViewer.getTable().getSelection()[0].getData();
    ((JarFile)fn.getValue()).setRestored();
    jarsToBeCopied.put(((JarFile)fn.getValue()).getFileName(),(JarFile)fn.getValue());
    ((JarFile)fn.getValue()).checkJarState();
    refreshJarViewer();
    updateJarButtons();
  }
}
Program: 78694
Project: 78694
Buggy source:
/** 
 * Carry out sort operation against certain driver column
 * @param columnIndex the column based on which the sort operation would be carried out 
 * @param asc the sort direction
 */
private void sortDriver(final int columnIndex,final boolean asc){
  TableItem[] tableItems=driverViewer.getTable().getItems();
  sort(columnIndex,asc,tableItems);
  String[][] records=mapTableItemsTo2DArray(tableItems);
  driverViewer.getTable().removeAll();
  TableItem tableItem;
  for (int i=0; i < tableItems.length; i++) {
    tableItem=new TableItem(driverViewer.getTable(),SWT.NONE);
    tableItem.setText(records[i]);
  }
}

Fixed version (ground truth):
/** 
 * Carry out sort operation against certain driver column
 * @param columnIndex the column based on which the sort operation would be carried out 
 * @param asc the sort direction
 */
private void sortDriver(final int columnIndex,final boolean asc){
  try {
    driverViewer.setSorter(new ViewerSorter(new RuleBasedCollator(((RuleBasedCollator)Collator.getInstance()).getRules()){
      public int compare(      String source,      String target){
        int result=0;
        if (columnIndex == 1)         result=super.compare(getDriverClassName(source),getDriverClassName(target));
 else         if (columnIndex == 2)         result=super.compare(getDisplayName(source),getDisplayName(target));
 else         if (columnIndex == 3)         result=super.compare(getUrlTemplate(source),getUrlTemplate(target));
        if (!asc)         return result;
 else         return result*=-1;
      }
    }
));
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  refreshDriver();
}
Program: 78695
Project: 78695
Buggy source:
/** 
 * actions after delete button is click in jarPage
 */
private void deleteJar(){
  jarChanged=true;
  if (jarViewer.getTable().getSelectionIndex() >= 0 && jarViewer.getTable().getSelectionIndex() < jarViewer.getTable().getItemCount()) {
    int idx=jarViewer.getTable().getSelectionIndex();
    Map.Entry fn=(Map.Entry)jarViewer.getTable().getSelection()[0].getData();
    JarFile jarFile=(JarFile)fn.getValue();
    jarFile.setToBeDeleted(true);
    if (jarsToBeCopied.containsKey(jarFile.getFileName())) {
      jarsToBeCopied.remove(jarFile.getFileName());
    }
 else {
      jarsToBeDeleted.put(jarFile.getFileName(),jarFile);
    }
    jarsToBeDeletedRuntime.put(jarFile.getFileName(),jarFile);
    jarMap.remove(fn.getKey());
    jarViewer.getTable().remove(idx);
    jarViewer.refresh();
    if (idx >= jarViewer.getTable().getItemCount()) {
      idx--;
    }
    jarViewer.getTable().select(idx);
    refreshJarViewer();
    updateJarButtons();
  }
}

Fixed version (ground truth):
/** 
 * actions after delete button is click in jarPage
 */
private void deleteJar(){
  jarChanged=true;
  if (jarViewer.getTable().getSelectionIndex() >= 0 && jarViewer.getTable().getSelectionIndex() < jarViewer.getTable().getItemCount()) {
    int idx=jarViewer.getTable().getSelectionIndex();
    Map.Entry fn=(Map.Entry)jarViewer.getTable().getSelection()[0].getData();
    JarFile jarFile=(JarFile)fn.getValue();
    jarFile.setToBeDeleted(true);
    if (jarsToBeCopied.containsKey(jarFile.getFileName())) {
      jarsToBeCopied.remove(jarFile.getFileName());
    }
 else {
      if (jarFile.getState() != JarFile.ODA_FILE_NOT_EXIST_TOKEN)       jarsToBeDeleted.put(jarFile.getFileName(),jarFile);
    }
    if (jarsToBeCopiedRuntime.containsKey(jarFile.getFileName()))     jarsToBeCopiedRuntime.remove(jarFile.getFileName());
 else {
      if (jarFile.getState() != JarFile.ODA_FILE_NOT_EXIST_TOKEN)       jarsToBeDeletedRuntime.put(jarFile.getFileName(),jarFile);
    }
    jarMap.remove(fn.getKey());
    jarViewer.getTable().remove(idx);
    jarViewer.refresh();
    if (idx >= jarViewer.getTable().getItemCount()) {
      idx--;
    }
    jarViewer.getTable().select(idx);
    refreshJarViewer();
    updateJarButtons();
  }
}