nus-yam/ex-repair huggingface dataset:
Program: 73316
Project: 73316
Buggy source:
protected Dimension getSpecifiedDimension(IImageContent content){
  Dimension dim=new Dimension(DEFAULT_WIDHT,DEFAULT_HEIGHT);
  try {
    intrinsic=getIntrinsicDimension(content);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage());
  }
  boolean scale=false;
  int specifiedWidth=getDimensionValue(content.getWidth());
  int specifiedHeight=getDimensionValue(content.getHeight());
  if (intrinsic == null) {
    dim.setDimension(specifiedWidth == 0 ? DEFAULT_WIDHT : specifiedWidth,specifiedHeight == 0 ? DEFAULT_HEIGHT : specifiedHeight);
    return dim;
  }
  if (scale) {
    double ratio=intrinsic.getRatio();
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,(int)(specifiedWidth / ratio));
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension((int)(specifiedHeight * ratio),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
 else {
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,intrinsic.getHeight());
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension(intrinsic.getWidth(),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
  return dim;
}

Fixed version (ground truth):
protected Dimension getSpecifiedDimension(IImageContent content,int pWidth,boolean scale){
  Dimension dim=new Dimension(DEFAULT_WIDHT,DEFAULT_HEIGHT);
  try {
    intrinsic=getIntrinsicDimension(content);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage());
  }
  int specifiedWidth=getDimensionValue(content.getWidth(),pWidth);
  int specifiedHeight=getDimensionValue(content.getHeight());
  if (intrinsic == null) {
    dim.setDimension(specifiedWidth == 0 ? DEFAULT_WIDHT : specifiedWidth,specifiedHeight == 0 ? DEFAULT_HEIGHT : specifiedHeight);
    return dim;
  }
  if (scale) {
    double ratio=intrinsic.getRatio();
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,(int)(specifiedWidth / ratio));
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension((int)(specifiedHeight * ratio),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
 else {
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,intrinsic.getHeight());
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension(intrinsic.getWidth(),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
  return dim;
}
Program: 73317
Project: 73317
Buggy source:
private ReportItemHandle getSelectedElement(){
  if (getTableEditPart() != null && getTableEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableEditPart().getModel();
  }
  if (getListEditPart() != null && getListEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getListEditPart().getModel();
  }
  return null;
}

Fixed version (ground truth):
private ReportItemHandle getSelectedElement(){
  if (getTableEditPart() != null && getTableEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableEditPart().getModel();
  }
  if (getTableMultipleEditPart() != null && getTableMultipleEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableMultipleEditPart().getModel();
  }
  if (getListEditPart() != null && getListEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getListEditPart().getModel();
  }
  return null;
}
Program: 73318
Project: 73318
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  super.execute(event);
  TableEditPart editPart=getTableEditPart();
  ListEditPart listPart=getListEditPart();
  if (editPart != null || listPart != null) {
    CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
    DataBindingDialog dialog=new DataBindingDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),getSelectedElement());
    if (dialog.open() == Dialog.OK) {
      stack.commit();
    }
 else {
      stack.rollback();
    }
  }
  return new Boolean(true);
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  super.execute(event);
  TableEditPart editPart=getTableEditPart();
  ListEditPart listPart=getListEditPart();
  ReportElementEditPart part=getTableMultipleEditPart();
  if (editPart != null || listPart != null || part != null) {
    CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
    DataBindingDialog dialog=new DataBindingDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),getSelectedElement());
    if (dialog.open() == Dialog.OK) {
      stack.commit();
    }
 else {
      stack.rollback();
    }
  }
  return new Boolean(true);
}
Program: 73319
Project: 73319
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  super.execute(event);
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  currentModel=context.getVariable(ICommandParameterNameContants.INSERT_GROUP_CURRENT_MODEL_NAME);
  int position=0;
  Object obj=context.getVariable(ICommandParameterNameContants.INSERT_GROUP_POSITION);
  if (obj != null && obj instanceof Integer) {
    position=((Integer)obj).intValue();
  }
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str");
  }
  CommandStack stack=getActiveCommandStack();
  stack.startTrans(STACK_MSG_ADD_GROUP);
  boolean retValue=false;
  if (getTableEditPart() != null) {
    retValue=getTableEditPart().insertGroup(position);
  }
 else {
    retValue=getListEditPart().insertGroup(position);
  }
  if (retValue) {
    stack.commit();
  }
 else {
    stack.rollbackAll();
  }
  return new Boolean(true);
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  super.execute(event);
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  currentModel=context.getVariable(ICommandParameterNameContants.INSERT_GROUP_CURRENT_MODEL_NAME);
  int position=0;
  Object obj=context.getVariable(ICommandParameterNameContants.INSERT_GROUP_POSITION);
  if (obj != null && obj instanceof Integer) {
    position=((Integer)obj).intValue();
  }
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str");
  }
  CommandStack stack=getActiveCommandStack();
  stack.startTrans(STACK_MSG_ADD_GROUP);
  boolean retValue=false;
  if (getTableEditPart() != null) {
    retValue=getTableEditPart().insertGroup(position);
  }
 else   if (getTableMultipleEditPart() != null) {
    retValue=UIUtil.createGroup((DesignElementHandle)getTableMultipleEditPart().getModel(),position);
  }
 else {
    retValue=getListEditPart().insertGroup(position);
  }
  if (retValue) {
    stack.commit();
  }
 else {
    stack.rollbackAll();
  }
  return new Boolean(true);
}
Program: 73320
Project: 73320
Buggy source:
private ReportItemHandle getSelectedElement(){
  if (getTableEditPart() != null && getTableEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableEditPart().getModel();
  }
  if (getListEditPart() != null && getListEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getListEditPart().getModel();
  }
  return null;
}

Fixed version (ground truth):
private ReportItemHandle getSelectedElement(){
  if (getTableEditPart() != null && getTableEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableEditPart().getModel();
  }
  if (getTableMultipleEditPart() != null && getTableMultipleEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getTableMultipleEditPart().getModel();
  }
  if (getListEditPart() != null && getListEditPart().getModel() instanceof ReportItemHandle) {
    return (ReportItemHandle)getListEditPart().getModel();
  }
  return null;
}
Program: 73323
Project: 73323
Buggy source:
/** 
 * Creats sub menu in the specified action group of the specified menu manager.
 * @param menuManager The menu manager contains the action group.
 * @param group_name The action group contains the sub menu.
 */
private void createInsertGroupHeaderFooter(IMenuManager menuManager,String group_name){
  if (getFirstElement() instanceof RowHandle) {
    return;
  }
  if (getFirstElement() instanceof SlotHandle) {
    return;
  }
  MenuManager subMenu=new MenuManager(INSERT_GROUP_HEADER_FOOTER_ITEM_TEXT);
  ListingHandle parentHandle=null;
  if (!getTableEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((TableEditPart)getTableEditParts().get(0)).getModel();
  }
 else {
    return;
  }
  SlotHandle handle=parentHandle.getGroups();
  Iterator iter=handle.iterator();
  while (iter.hasNext()) {
    GroupHandle groupHandle=(GroupHandle)iter.next();
    MenuManager groupMenu=new MenuManager(groupHandle.getName());
    groupMenu.add(new InsertGroupHeaderFooterAction(groupHandle,InsertGroupHeaderFooterAction.HEADER));
    groupMenu.add(new InsertGroupHeaderFooterAction(groupHandle,InsertGroupHeaderFooterAction.FOOTER));
    subMenu.add(groupMenu);
  }
  menuManager.appendToGroup(group_name,subMenu);
}

Fixed version (ground truth):
/** 
 * Creats sub menu in the specified action group of the specified menu manager.
 * @param menuManager The menu manager contains the action group.
 * @param group_name The action group contains the sub menu.
 */
private void createInsertGroupHeaderFooter(IMenuManager menuManager,String group_name){
  if (getFirstElement() instanceof RowHandle) {
    return;
  }
  if (getFirstElement() instanceof SlotHandle) {
    return;
  }
  MenuManager subMenu=new MenuManager(INSERT_GROUP_HEADER_FOOTER_ITEM_TEXT);
  ListingHandle parentHandle=null;
  if (!getTableEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((TableEditPart)getTableEditParts().get(0)).getModel();
  }
 else   if (!getTableMultipleEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((ReportElementEditPart)getTableMultipleEditParts().get(0)).getModel();
  }
 else {
    return;
  }
  SlotHandle handle=parentHandle.getGroups();
  Iterator iter=handle.iterator();
  while (iter.hasNext()) {
    GroupHandle groupHandle=(GroupHandle)iter.next();
    MenuManager groupMenu=new MenuManager(groupHandle.getName());
    groupMenu.add(new InsertGroupHeaderFooterAction(groupHandle,InsertGroupHeaderFooterAction.HEADER));
    groupMenu.add(new InsertGroupHeaderFooterAction(groupHandle,InsertGroupHeaderFooterAction.FOOTER));
    subMenu.add(groupMenu);
  }
  menuManager.appendToGroup(group_name,subMenu);
}
Program: 73325
Project: 73325
Buggy source:
/** 
 * Copy new handle
 * @param element The elemnent to copy
 * @param currentDesignHandle Current design handle
 * @return The copied handle
 * @throws CloneNotSupportedException
 */
private DesignElementHandle copyNewHandle(IDesignElement element,ModuleHandle currentDesignHandle) throws CloneNotSupportedException {
  IDesignElement newElement=isCloned ? element : (IDesignElement)element.clone();
  DesignElementHandle handle=newElement.getHandle(currentDesignHandle.getModule());
  if (newContainer instanceof ThemeHandle) {
    currentDesignHandle.rename((ThemeHandle)newContainer,handle);
  }
 else   if (newContainer instanceof SlotHandle && ((SlotHandle)newContainer).getElementHandle() instanceof ThemeHandle) {
    currentDesignHandle.rename(((SlotHandle)newContainer).getElementHandle(),handle);
  }
 else {
    currentDesignHandle.rename(handle);
  }
  return handle;
}

Fixed version (ground truth):
/** 
 * Copy new handle
 * @param element The elemnent to copy
 * @param currentDesignHandle Current design handle
 * @return The copied handle
 * @throws CloneNotSupportedException
 */
private IDesignElement copyNewHandle(IDesignElement element) throws CloneNotSupportedException {
  IDesignElement newElement=isCloned ? element : (IDesignElement)element.clone();
  return newElement;
}
Program: 73326
Project: 73326
Buggy source:
/** 
 * Add this design element to report.
 * @param newHandle The design element to add
 */
private void addHandleToReport(DesignElementHandle newHandle) throws ContentException, NameException, SemanticException {
  SlotHandle slotHandle=null;
  if (newContainer instanceof DesignElementHandle) {
    slotHandle=((DesignElementHandle)newContainer).getSlot(slotID);
  }
 else   if (newContainer instanceof SlotHandle) {
    slotHandle=(SlotHandle)newContainer;
  }
  if (slotHandle != null) {
    slotHandle.paste(newHandle,position);
  }
 else   if (newContainer instanceof PropertyHandle) {
    ((PropertyHandle)newContainer).paste(newHandle,position);
  }
 else   if (newContainer instanceof DesignElementHandle) {
    ((DesignElementHandle)newContainer).getPropertyHandle(contentString).paste(newHandle,position);
  }
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(newHandle) + "String_Node_Str"+ slotHandle.getSlotID()+ "String_Node_Str"+ DEUtil.getDisplayLabel(slotHandle.getElementHandle())+ "String_Node_Str"+ position);
  }
}

Fixed version (ground truth):
/** 
 * Add this design element to report.
 * @param newHandle The design element to add
 */
private void addHandleToReport(IDesignElement newElement,ModuleHandle currentDesignHandle) throws ContentException, NameException, SemanticException {
  DesignElementHandle newHandle=newElement.getHandle(currentDesignHandle.getModule());
  if (newContainer instanceof ThemeHandle) {
    currentDesignHandle.rename((ThemeHandle)newContainer,newHandle);
  }
 else   if (newContainer instanceof SlotHandle && ((SlotHandle)newContainer).getElementHandle() instanceof ThemeHandle) {
    currentDesignHandle.rename(((SlotHandle)newContainer).getElementHandle(),newHandle);
  }
 else {
    currentDesignHandle.rename(newHandle);
  }
  SlotHandle slotHandle=null;
  if (newContainer instanceof DesignElementHandle) {
    slotHandle=((DesignElementHandle)newContainer).getSlot(slotID);
  }
 else   if (newContainer instanceof SlotHandle) {
    slotHandle=(SlotHandle)newContainer;
  }
  if (slotHandle != null) {
    slotHandle.paste(newElement,position);
  }
 else   if (newContainer instanceof PropertyHandle) {
    ((PropertyHandle)newContainer).paste(newElement,position);
  }
 else   if (newContainer instanceof DesignElementHandle) {
    ((DesignElementHandle)newContainer).getPropertyHandle(contentString).paste(newElement,position);
  }
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(newHandle) + "String_Node_Str"+ slotHandle.getSlotID()+ "String_Node_Str"+ DEUtil.getDisplayLabel(slotHandle.getElementHandle())+ "String_Node_Str"+ position);
  }
}
Program: 73327
Project: 73327
Buggy source:
/** 
 * Executes the Command.
 */
public void execute(){
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str");
  }
  try {
    if (!isCut || sourceHandle == null || sourceHandle.getContainer() == null) {
      isCut=false;
    }
    calculatePositionAndSlotId();
    dropSourceHandle(sourceHandle);
    ModuleHandle currentDesignHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    DesignElementHandle newHandle=copyNewHandle(cloneElement,currentDesignHandle);
    addHandleToReport(newHandle);
  }
 catch (  Exception e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Executes the Command.
 */
public void execute(){
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str");
  }
  try {
    if (!isCut || sourceHandle == null || sourceHandle.getContainer() == null) {
      isCut=false;
    }
    calculatePositionAndSlotId();
    dropSourceHandle(sourceHandle);
    ModuleHandle currentDesignHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    addHandleToReport(copyNewHandle(cloneElement),currentDesignHandle);
  }
 catch (  Exception e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
}
Program: 73328
Project: 73328
Buggy source:
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append('(');
  Iterator iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=(IArgumentInfoList)iter.next();
    for (Iterator argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=(IArgumentInfo)argumentIter.next();
      String type=argument.getType();
      signature.append(JSEditor.convertToParameterName(type));
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}

Fixed version (ground truth):
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append("String_Node_Str");
  Iterator iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=(IArgumentInfoList)iter.next();
    for (Iterator argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=(IArgumentInfo)argumentIter.next();
      String argName=argument.getName();
      if (argName == null || argName.length() == 0) {
        String type=argument.getType();
        argName=JSEditor.convertToParameterName(type);
      }
      signature.append(argName);
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}
Program: 73329
Project: 73329
Buggy source:
private void updateScriptContext(DesignElementHandle handle,String method){
  List args=DEUtil.getDesignElementMethodArgumentsInfo(handle,method);
  JSSyntaxContext context=scriptEditor.getContext();
  context.clear();
  for (Iterator iter=args.iterator(); iter.hasNext(); ) {
    IArgumentInfo element=(IArgumentInfo)iter.next();
    String name=element.getName();
    String type=element.getType();
    if (!context.setVariable(name,type)) {
      context.setVariable(name,element.getClassType());
    }
  }
  if (handle instanceof ExtendedItemHandle) {
    ExtendedItemHandle exHandle=(ExtendedItemHandle)handle;
    List mtds=exHandle.getMethods(method);
    if (mtds != null && mtds.size() > 0) {
      for (int i=0; i < mtds.size(); i++) {
        IMethodInfo mi=(IMethodInfo)mtds.get(i);
        for (Iterator itr=mi.argumentListIterator(); itr.hasNext(); ) {
          IArgumentInfoList ailist=(IArgumentInfoList)itr.next();
          for (Iterator argItr=ailist.argumentsIterator(); argItr.hasNext(); ) {
            IArgumentInfo aiinfo=(IArgumentInfo)argItr.next();
            IClassInfo ci=aiinfo.getClassType();
            String name=convertToParameterName(ci.getName());
            context.setVariable(name,ci);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateScriptContext(DesignElementHandle handle,String method){
  List args=DEUtil.getDesignElementMethodArgumentsInfo(handle,method);
  JSSyntaxContext context=scriptEditor.getContext();
  context.clear();
  for (Iterator iter=args.iterator(); iter.hasNext(); ) {
    IArgumentInfo element=(IArgumentInfo)iter.next();
    String name=element.getName();
    String type=element.getType();
    if (!context.setVariable(name,type)) {
      context.setVariable(name,element.getClassType());
    }
  }
  if (handle instanceof ExtendedItemHandle) {
    ExtendedItemHandle exHandle=(ExtendedItemHandle)handle;
    List mtds=exHandle.getMethods(method);
    if (mtds != null && mtds.size() > 0) {
      for (int i=0; i < mtds.size(); i++) {
        IMethodInfo mi=(IMethodInfo)mtds.get(i);
        for (Iterator itr=mi.argumentListIterator(); itr.hasNext(); ) {
          IArgumentInfoList ailist=(IArgumentInfoList)itr.next();
          for (Iterator argItr=ailist.argumentsIterator(); argItr.hasNext(); ) {
            IArgumentInfo aiinfo=(IArgumentInfo)argItr.next();
            String argName=aiinfo.getName();
            IClassInfo ci=aiinfo.getClassType();
            if (argName == null || argName.length() == 0) {
              argName=convertToParameterName(ci.getName());
            }
            context.setVariable(argName,ci);
          }
        }
      }
    }
  }
}
Program: 73333
Project: 73333
Buggy source:
private void addAggregateOn(Binding binding,List lstAggOn,ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  for (Iterator iAggs=lstAggOn.iterator(); iAggs.hasNext(); ) {
    String aggOn=(String)iAggs.next();
    String[] levelNames=CubeUtil.splitLevelName(aggOn);
    String dimExpr=ExpressionUtil.createJSDimensionExpression(levelNames[0],levelNames[1]);
    binding.addAggregateOn(dimExpr);
    if (cubeQuery != null && cube != null) {
      bindSeriesQuery(QueryImpl.create(dimExpr),cubeQuery,cube);
    }
  }
}

Fixed version (ground truth):
private void addAggregateOn(Binding binding,List lstAggOn,ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  for (Iterator iAggs=lstAggOn.iterator(); iAggs.hasNext(); ) {
    String aggOn=(String)iAggs.next();
    String[] levelNames=CubeUtil.splitLevelName(aggOn);
    String dimExpr=ExpressionUtil.createJSDimensionExpression(levelNames[0],levelNames[1]);
    binding.addAggregateOn(dimExpr);
  }
}
Program: 73334
Project: 73334
Buggy source:
public void run(){
  try {
    while (!process.isTerminated()) {
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
      }
    }
    if (process.getExitValue() == ReportLauncher.EXIT_OK) {
      File file=new File(fileName);
      String openName=ReportLauncher.getOutputFileName(outputFolder,file.getName(),suffix);
      if (openName != null && new File(openName).exists()) {
        Program.launch(openName);
      }
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (process.getExitValue() == ReportLauncher.EXIT_OK) {
      File file=new File(fileName);
      String openName=ReportLauncher.getOutputFileName(outputFolder,file.getName(),suffix);
      if (openName != null && new File(openName).exists()) {
        Program.launch(openName);
      }
    }
  }
 catch (  DebugException e) {
  }
}
Program: 73335
Project: 73335
Buggy source:
static void handleProcessTermination(ILaunch launch,final IProcess process,final String fileName,final String outputFolder) throws CoreException {
  if (launch.getLaunchConfiguration().getAttribute(ATTR_OPEN_TARGET,false) && launch.getLaunchConfiguration().getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE) != TASK_TYPE_RUN) {
    final String suffix=launch.getLaunchConfiguration().getAttribute(ATTR_TARGET_FORMAT,DEFAULT_TARGET_FORMAT);
    Thread monitorThread=new Thread(new Runnable(){
      public void run(){
        try {
          while (!process.isTerminated()) {
            try {
              Thread.sleep(100);
            }
 catch (            InterruptedException e) {
            }
          }
          if (process.getExitValue() == ReportLauncher.EXIT_OK) {
            File file=new File(fileName);
            String openName=ReportLauncher.getOutputFileName(outputFolder,file.getName(),suffix);
            if (openName != null && new File(openName).exists()) {
              Program.launch(openName);
            }
          }
        }
 catch (        Exception e) {
        }
      }
    }
,"String_Node_Str");
    monitorThread.setDaemon(true);
    monitorThread.start();
  }
}

Fixed version (ground truth):
static void handleProcessTermination(ILaunch launch,final IProcess process,final String fileName,final String outputFolder) throws CoreException {
  if (launch.getLaunchConfiguration().getAttribute(ATTR_OPEN_TARGET,false) && launch.getLaunchConfiguration().getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE) != TASK_TYPE_RUN) {
    final String suffix=launch.getLaunchConfiguration().getAttribute(ATTR_TARGET_FORMAT,DEFAULT_TARGET_FORMAT);
    Thread monitorThread=new Thread(new Runnable(){
      public void run(){
        while (!process.isTerminated()) {
          try {
            Thread.sleep(100);
          }
 catch (          InterruptedException e) {
          }
        }
        DebugUI.getStandardDisplay().asyncExec(new Runnable(){
          public void run(){
            try {
              if (process.getExitValue() == ReportLauncher.EXIT_OK) {
                File file=new File(fileName);
                String openName=ReportLauncher.getOutputFileName(outputFolder,file.getName(),suffix);
                if (openName != null && new File(openName).exists()) {
                  Program.launch(openName);
                }
              }
            }
 catch (            DebugException e) {
            }
          }
        }
);
      }
    }
,"String_Node_Str");
    monitorThread.setDaemon(true);
    monitorThread.start();
  }
}
Program: 73336
Project: 73336
Buggy source:
public Object[] findSourceElements(String name) throws CoreException {
  int index=name.lastIndexOf(File.separator);
  if (index < 0) {
    return EMPTY;
  }
  String id=name.substring(index + 1);
  String tName=name.substring(0,index);
  ArrayList sources=new ArrayList();
  File directory=getDirectory();
  File file=new File(directory,tName);
  if (file.exists() && file.isFile()) {
    sources.add(new ScriptLocalFileStorage(file,id));
  }
  if (sources.isEmpty())   return EMPTY;
  return sources.toArray();
}

Fixed version (ground truth):
public Object[] findSourceElements(String name) throws CoreException {
  int index=name.indexOf(File.separator);
  if (index < 0) {
    return EMPTY;
  }
  String id=name.substring(index + 1);
  String tName=name.substring(0,index);
  ArrayList sources=new ArrayList();
  File directory=getDirectory();
  File file=new File(directory,tName);
  if (file.exists() && file.isFile()) {
    sources.add(new ScriptLocalFileStorage(file,id));
  }
  if (sources.isEmpty())   return EMPTY;
  return sources.toArray();
}
Program: 73337
Project: 73337
Buggy source:
public Object visitListItem(ListItemDesign list,Object value){
  BaseQueryDefinition query;
  if (list.useCachedResult()) {
    query=getRefenceQuery(list);
    if (query == null) {
      registerUnresolvedQueryReference(list);
      return null;
    }
  }
 else {
    query=createQuery(list,value);
  }
  if (query == null) {
    handleListingBand(list.getHeader(),query,true,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
 else {
    handleListingBand(list.getHeader(),query,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    if (!query.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        query.setUsesDetails(false);
      }
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
  try {
    transformExpressions(list,query);
  }
 catch (  BirtException ex) {
    context.addException(list.getHandle(),ex);
  }
  return getResultQuery(query,value);
}

Fixed version (ground truth):
public Object visitListItem(ListItemDesign list,Object value){
  BaseQueryDefinition query;
  if (list.useCachedResult()) {
    query=getRefenceQuery(list);
    if (query == null) {
      registerUnresolvedQueryReference(list);
      return null;
    }
  }
 else {
    query=createQuery(list,value);
  }
  if (query == null) {
    handleListingBand(list.getHeader(),query,true,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
 else {
    handleListingQuery(list,query);
    handleListingBand(list.getHeader(),query,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    if (!query.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        query.setUsesDetails(false);
      }
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
  try {
    transformExpressions(list,query);
  }
 catch (  BirtException ex) {
    context.addException(list.getHandle(),ex);
  }
  return getResultQuery(query,value);
}
Program: 73338
Project: 73338
Buggy source:
public Object visitTableItem(TableItemDesign table,Object value){
  BaseQueryDefinition query;
  if (table.useCachedResult()) {
    query=getRefenceQuery(table);
    if (query == null) {
      registerUnresolvedQueryReference(table);
      return null;
    }
  }
 else {
    query=createQuery(table,value);
  }
  if (query == null) {
    handleListingBand(table.getHeader(),query,true,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
 else {
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),query,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=table.getDetail();
    if (!query.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        query.setUsesDetails(false);
      }
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
  try {
    transformExpressions(table,query);
  }
 catch (  BirtException ex) {
    context.addException(table.getHandle(),ex);
  }
  return getResultQuery(query,value);
}

Fixed version (ground truth):
public Object visitTableItem(TableItemDesign table,Object value){
  BaseQueryDefinition query;
  if (table.useCachedResult()) {
    query=getRefenceQuery(table);
    if (query == null) {
      registerUnresolvedQueryReference(table);
      return null;
    }
  }
 else {
    query=createQuery(table,value);
  }
  if (query == null) {
    handleListingBand(table.getHeader(),query,true,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
 else {
    handleListingQuery(table,query);
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),query,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=table.getDetail();
    if (!query.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        query.setUsesDetails(false);
      }
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
  try {
    transformExpressions(table,query);
  }
 catch (  BirtException ex) {
    context.addException(table.getHandle(),ex);
  }
  return getResultQuery(query,value);
}
Program: 73340
Project: 73340
Buggy source:
public void close(){
  super.close();
  nextExecutor=null;
}

Fixed version (ground truth):
public void close(){
  super.close();
  nextExecutor=null;
  measureCellCache=null;
}
Program: 73341
Project: 73341
Buggy source:
protected void prepareChildren(){
  super.prepareChildren();
  walker.reload();
}

Fixed version (ground truth):
protected void prepareChildren(){
  super.prepareChildren();
  initMeasureCache();
  walker.reload();
}
Program: 73343
Project: 73343
Buggy source:
protected void prepareChildren(){
  super.prepareChildren();
  rowEdgeStarted=false;
  isLayoutDownThenOver=PAGE_LAYOUT_DOWN_THEN_OVER.equals(crosstabItem.getPageLayout());
  walker.reload();
}

Fixed version (ground truth):
protected void prepareChildren(){
  super.prepareChildren();
  initMeasureCache();
  rowEdgeStarted=false;
  isLayoutDownThenOver=PAGE_LAYOUT_DOWN_THEN_OVER.equals(crosstabItem.getPageLayout());
  walker.reload();
}
Program: 73344
Project: 73344
Buggy source:
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=crosstabItem.getMeasure(ev.measureIndex).getCell().getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
if (targetSpanGroupIndex != -1) {
try {
EdgeCursor rowEdgeCursor=getRowEdgeCursor();
if (rowEdgeCursor != null) {
targetSpanGroupIndex--;
if (targetSpanGroupIndex == -1) {
return !rowEdgeCursor.isFirst();
}
 else {
DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(targetSpanGroupIndex);
if (!GroupUtil.isDummyGroup(dc)) {
  return rowEdgeCursor.getPosition() > dc.getEdgeStart();
}
}
}
}
 catch (OLAPException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
}
}
return false;
}

Fixed version (ground truth):
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(ev.measureIndex).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
if (targetSpanGroupIndex != -1) {
try {
EdgeCursor rowEdgeCursor=getRowEdgeCursor();
if (rowEdgeCursor != null) {
targetSpanGroupIndex--;
if (targetSpanGroupIndex == -1) {
return !rowEdgeCursor.isFirst();
}
 else {
DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(targetSpanGroupIndex);
if (!GroupUtil.isDummyGroup(dc)) {
  return rowEdgeCursor.getPosition() > dc.getEdgeStart();
}
}
}
}
 catch (OLAPException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
}
}
return false;
}
Program: 73346
Project: 73346
Buggy source:
protected void prepareChildren(){
  super.prepareChildren();
  isLayoutDownThenOver=PAGE_LAYOUT_DOWN_THEN_OVER.equals(crosstabItem.getPageLayout());
  if (isLayoutDownThenOver) {
    startTotalDimensionIndex=dimensionIndex;
    startTotalLevelIndex=levelIndex;
  }
 else {
    EdgeGroup nextGroup=GroupUtil.getNextGroup(rowGroups,dimensionIndex,levelIndex);
    startTotalDimensionIndex=nextGroup.dimensionIndex;
    startTotalLevelIndex=nextGroup.levelIndex;
  }
  DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimensionIndex);
  LevelViewHandle lv=dv.getLevel(levelIndex);
  isSubTotalBefore=lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation());
  boolean isVerticalMeasure=MEASURE_DIRECTION_VERTICAL.equals(crosstabItem.getMeasureDirection());
  isFirstTotalRow=rowIndex == GroupUtil.getFirstTotalRowIndex(crosstabItem,dimensionIndex,levelIndex,isVerticalMeasure);
  totalRowSpan=GroupUtil.getTotalRowSpan(crosstabItem,dimensionIndex,levelIndex,isVerticalMeasure);
  walker.reload();
}

Fixed version (ground truth):
protected void prepareChildren(){
  super.prepareChildren();
  initMeasureCache();
  isLayoutDownThenOver=PAGE_LAYOUT_DOWN_THEN_OVER.equals(crosstabItem.getPageLayout());
  if (isLayoutDownThenOver) {
    startTotalDimensionIndex=dimensionIndex;
    startTotalLevelIndex=levelIndex;
  }
 else {
    EdgeGroup nextGroup=GroupUtil.getNextGroup(rowGroups,dimensionIndex,levelIndex);
    startTotalDimensionIndex=nextGroup.dimensionIndex;
    startTotalLevelIndex=nextGroup.levelIndex;
  }
  DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimensionIndex);
  LevelViewHandle lv=dv.getLevel(levelIndex);
  isSubTotalBefore=lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation());
  boolean isVerticalMeasure=MEASURE_DIRECTION_VERTICAL.equals(crosstabItem.getMeasureDirection());
  isFirstTotalRow=rowIndex == GroupUtil.getFirstTotalRowIndex(crosstabItem,dimensionIndex,levelIndex,isVerticalMeasure);
  totalRowSpan=GroupUtil.getTotalRowSpan(crosstabItem,dimensionIndex,levelIndex,isVerticalMeasure);
  walker.reload();
}
Program: 73347
Project: 73347
Buggy source:
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=crosstabItem.getMeasure(ev.measureIndex).getCell().getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetRowSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
int currentGroupIndex=GroupUtil.getGroupIndex(rowGroups,dimensionIndex,levelIndex);
if (targetRowSpanGroupIndex != -1) {
return targetRowSpanGroupIndex <= currentGroupIndex;
}
}
return false;
}

Fixed version (ground truth):
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(ev.measureIndex).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetRowSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
int currentGroupIndex=GroupUtil.getGroupIndex(rowGroups,dimensionIndex,levelIndex);
if (targetRowSpanGroupIndex != -1) {
return targetRowSpanGroupIndex <= currentGroupIndex;
}
}
return false;
}
Program: 73348
Project: 73348
Buggy source:
/** 
 * Test disable some column binding on diskCache.
 * @throws Exception
 */
public void testDiskCacheColumnBinding() throws Exception {
  String initialStr=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  incomprehensiveColumnBinding();
  if (initialStr == null)   System.clearProperty("String_Node_Str");
 else   System.setProperty("String_Node_Str",initialStr);
}

Fixed version (ground truth):
/** 
 * Test disable some column binding on diskCache.
 * @throws Exception
 */
public void testDiskCacheColumnBinding() throws Exception {
  String initialStr=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  incomprehensiveColumnBinding();
  if (initialStr == null)   System.getProperties().remove("String_Node_Str");
 else   System.setProperty("String_Node_Str",initialStr);
}
Program: 73349
Project: 73349
Buggy source:
WrapperedRAInputStream(RAInputStream input,long startOffset,int size) throws DataException {
  this.raIn=input;
  this.startOffset=startOffset;
  this.size=size;
  try {
    this.skip(this.startOffset);
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
WrapperedRAInputStream(RAInputStream input,long startOffset,int size) throws DataException {
  this.raIn=input;
  this.startOffset=startOffset;
  this.size=size;
  try {
    this.raIn.seek(this.startOffset);
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}
Program: 73350
Project: 73350
Buggy source:
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  setCurrentBP(0);
  setupMinHeight();
}

Fixed version (ground truth):
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  setCurrentBP(0);
  setCurrentIP(0);
  setupMinHeight();
}
Program: 73351
Project: 73351
Buggy source:
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getRequestPort(),getEventPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error("String_Node_Str");
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error("String_Node_Str");
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  configEngine();
}

Fixed version (ground truth):
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getRequestPort(),getEventPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error("String_Node_Str");
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error("String_Node_Str");
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
}
Program: 73352
Project: 73352
Buggy source:
private void configEngine(){
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler(){
    public String getURL(    IAction actionDefn,    Object context){
      if (actionDefn.getType() == IAction.ACTION_DRILLTHROUGH)       return "String_Node_Str" + URLEncoder.encode(super.getURL(actionDefn,context));
      return super.getURL(actionDefn,context);
    }
  }
);
  engineConfig.getEmitterConfigs().put(RenderOption.OUTPUT_FORMAT_HTML,emitterConfig);
  String userClassPath=getUserClassPath();
  logger.info("String_Node_Str" + userClassPath);
  if (userClassPath != null) {
    engineConfig.setProperty(EngineConstants.PROJECT_CLASSPATH_KEY,userClassPath);
  }
}

Fixed version (ground truth):
private void configEngine(){
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler(){
    public String getURL(    IAction actionDefn,    Object context){
      if (actionDefn.getType() == IAction.ACTION_DRILLTHROUGH)       return "String_Node_Str" + URLEncoder.encode(super.getURL(actionDefn,context));
      return super.getURL(actionDefn,context);
    }
  }
);
  engineConfig.getEmitterConfigs().put(RenderOption.OUTPUT_FORMAT_HTML,emitterConfig);
  String userClassPath=getUserClassPath();
  logger.info("String_Node_Str" + userClassPath);
  if (userClassPath != null) {
    engineConfig.getAppContext().put(EngineConstants.PROJECT_CLASSPATH_KEY,userClassPath);
  }
}
Program: 73353
Project: 73353
Buggy source:
private BookmarkDef getBookmark(IContent content){
  if (content.getBookmark() == null)   return null;
  return new BookmarkDef(content.getBookmark());
}

Fixed version (ground truth):
private BookmarkDef getBookmark(IContent content){
  String bookmark=content.getBookmark();
  if (bookmark == null)   return null;
  if (!ExcelUtil.isValidBookmarkName(bookmark)) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  return new BookmarkDef(content.getBookmark());
}
Program: 73354
Project: 73354
Buggy source:
private HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      return new HyperlinkDef(linkaction.getBookmark().replaceAll("String_Node_Str","String_Node_Str"),IHyperlinkAction.ACTION_BOOKMARK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=service.getOption(IRenderOption.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        return new HyperlinkDef(actionHandler.getURL(act,service.getReportContext()),IHyperlinkAction.ACTION_DRILLTHROUGH,null);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      String bookmark=linkaction.getBookmark();
      if (ExcelUtil.isValidBookmarkName(bookmark)) {
        return new HyperlinkDef(linkaction.getBookmark(),IHyperlinkAction.ACTION_BOOKMARK,null);
      }
 else {
        return null;
      }
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=service.getOption(IRenderOption.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        return new HyperlinkDef(actionHandler.getURL(act,service.getReportContext()),IHyperlinkAction.ACTION_DRILLTHROUGH,null);
      }
    }
  }
  return null;
}