nus-yam/ex-repair huggingface dataset:
Program: 75249
Project: 75249
Buggy source:
/** 
 * This method is used to validate the column binding to see if it contains aggregations. If so then return true, else return false;
 * @param columnBindings
 * @param boundColumnName
 * @throws BirtException
 */
private boolean referToAggregation(List bindings,String boundColumnName) throws BirtException {
  if (boundColumnName == null)   return true;
  Iterator columnBindings=bindings.iterator();
  while (columnBindings != null && columnBindings.hasNext()) {
    IComputedColumn column=this.modelAdaptor.adaptComputedColumn((ComputedColumnHandle)columnBindings.next());
    if (column.getName().equals(boundColumnName)) {
      ScriptExpression sxp=(ScriptExpression)column.getExpression();
      if (ExpressionUtil.hasAggregation(sxp.getText())) {
        return true;
      }
 else {
        Iterator columnBindingNameIt=ExpressionUtil.extractColumnExpressions(sxp.getText()).iterator();
        while (columnBindingNameIt.hasNext()) {
          IColumnBinding columnBinding=(IColumnBinding)columnBindingNameIt.next();
          if (referToAggregation(bindings,columnBinding.getResultSetColumnName()))           return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This method is used to validate the column binding to see if it contains aggregations. If so then return true, else return false;
 * @param columnBindings
 * @param boundColumnName
 * @throws BirtException
 */
private boolean referToAggregation(List bindings,String boundColumnName) throws BirtException {
  if (boundColumnName == null)   return true;
  Iterator columnBindings=bindings.iterator();
  while (columnBindings != null && columnBindings.hasNext()) {
    IComputedColumn column=this.modelAdaptor.adaptComputedColumn((ComputedColumnHandle)columnBindings.next());
    if (column.getName().equals(boundColumnName)) {
      ScriptExpression sxp=(ScriptExpression)column.getExpression();
      if (column.getAggregateFunction() != null || ExpressionUtil.hasAggregation(sxp.getText())) {
        return true;
      }
 else {
        Iterator columnBindingNameIt=ExpressionUtil.extractColumnExpressions(sxp.getText()).iterator();
        while (columnBindingNameIt.hasNext()) {
          IColumnBinding columnBinding=(IColumnBinding)columnBindingNameIt.next();
          if (referToAggregation(bindings,columnBinding.getResultSetColumnName()))           return true;
        }
      }
    }
  }
  return false;
}
Program: 75250
Project: 75250
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  composite.setLayout(layout);
  SashForm sashForm=new SashForm(composite,SWT.NONE);
  sashForm.setOrientation(SWT.HORIZONTAL);
  sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
  createTreeViewer(sashForm);
  createPropertyPane(sashForm);
  sashForm.setWeights(new int[]{20,80});
  Label label=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  initTreeSelection();
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  composite.setLayout(layout);
  sashForm=new SashForm(composite,SWT.NONE);
  sashForm.setOrientation(SWT.HORIZONTAL);
  sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
  createTreeViewer(sashForm);
  createPropertyPane(sashForm);
  Label label=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  initTreeSelection();
  return composite;
}
Program: 75251
Project: 75251
Buggy source:
public void dispose(){
  if (getCommandStack() != null) {
    WrapperCommandStack stack=(WrapperCommandStack)getCommandStack();
    stack.removeCommandStackListener(getCommandStackListener());
  }
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  if (getCommandStack() != null && getCommandStack() instanceof WrapperCommandStack) {
    WrapperCommandStack stack=(WrapperCommandStack)getCommandStack();
    stack.removeCommandStackListener(getCommandStackListener());
  }
  super.dispose();
}
Program: 75252
Project: 75252
Buggy source:
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#findTocByName(java.lang.String,java.lang.String,org.eclipse.birt.report.service.api.InputOptions)
 */
public String findTocByName(String docName,String name,InputOptions options){
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#findTocByName(java.lang.String,java.lang.String,org.eclipse.birt.report.service.api.InputOptions)
 */
public String findTocByName(String docName,String name,InputOptions options){
  IReportDocument doc=ReportEngineService.getInstance().openReportDocument(getReportDesignName(options),docName,getModuleOptions(options));
  if (doc == null)   return null;
  try {
    return BirtUtility.findTocByName(doc,name,options);
  }
  finally {
    doc.close();
  }
}
Program: 75254
Project: 75254
Buggy source:
public Object get(String arg0,Scriptable scope){
  try {
    if (this.currentIterator == null)     return null;
    if ("String_Node_Str".equalsIgnoreCase(arg0) || "String_Node_Str".equalsIgnoreCase(arg0)) {
      return new Integer(this.currentIterator.getRowIndex());
    }
    if ("String_Node_Str".equalsIgnoreCase(arg0)) {
      return new JSResultIteratorObject(it.getParent());
    }
    return this.currentIterator.getValue(arg0);
  }
 catch (  BirtException e) {
    return null;
  }
}

Fixed version (ground truth):
public Object get(int index,Scriptable start){
  return this.get(String.valueOf(index),start);
}
Program: 75255
Project: 75255
Buggy source:
/** 
 * @deprecated
 * @return wrapped report design handle.
 */
public ModuleHandle getReportDesignHandle(){
  return model;
}

Fixed version (ground truth):
/** 
 * @deprecated
 * @return wrapped report design handle.
 */
public ModuleHandle getReportDesignHandle(){
  if (model == null) {
    IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    model=(ModuleHandle)reportHandleMap.get(activeWindow);
  }
  return model;
}
Program: 75256
Project: 75256
Buggy source:
/** 
 * Sets report design.
 * @param handle the model
 */
public void setReportDesignHandle(ModuleHandle handle){
  model=handle;
}

Fixed version (ground truth):
/** 
 * Sets report design.
 * @param handle the model
 */
public void setReportDesignHandle(ModuleHandle handle){
  PlatformUI.getWorkbench().removeWindowListener(pageListener);
  IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (handle == null) {
    reportHandleMap.remove(activeWindow);
  }
 else {
    PlatformUI.getWorkbench().addWindowListener(pageListener);
  }
  if (activeWindow != null) {
    reportHandleMap.put(activeWindow,handle);
  }
  model=handle;
}
Program: 75257
Project: 75257
Buggy source:
public EditPart createEditPart(EditPart context,Object model){
  EditPart editPart=null;
  if (model instanceof LibraryHandle) {
    return new LibraryReportDesignEditPart(model);
  }
  if (ignoreModel(model)) {
    editPart=new EmptyEditPart(model);
  }
  if (editPart != null) {
    return editPart;
  }
  editPart=super.createEditPart(context,model);
  if (editPart == null || editPart instanceof DummyEditpart) {
    editPart=new EmptyEditPart(model);
  }
  return editPart;
}

Fixed version (ground truth):
public EditPart createEditPart(EditPart context,Object model){
  EditPart editPart=null;
  if (model instanceof LibraryHandle) {
    return new LibraryReportDesignEditPart(model);
  }
  if (ignoreModel(model)) {
    editPart=new EmptyEditPart(model);
  }
  if (editPart != null) {
    return editPart;
  }
  editPart=super.createEditPart(context,model);
  if (!(editPart instanceof DestroyEditPart) && (editPart == null || editPart instanceof DummyEditpart)) {
    editPart=new EmptyEditPart(model);
  }
  return editPart;
}
Program: 75258
Project: 75258
Buggy source:
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      boolean isLevelRemoved=processor(showLevels,result,nullLevelHandle);
      CrosstabAdaptUtil.processInvaildBindings(reportHandle,isLevelRemoved);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      boolean isLevelRemoved=processor(showLevels,result,nullLevelHandle);
      if (isLevelRemoved) {
        CrosstabAdaptUtil.processInvaildBindings(reportHandle);
      }
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 75259
Project: 75259
Buggy source:
public static void processInvaildBindings(CrosstabReportItemHandle handle,boolean isLevelRemoved){
  if (CrosstabPlugin.getDefault().getPluginPreferences().getBoolean(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS) && isLevelRemoved) {
    MessageDialogWithToggle msgDlg=MessageDialogWithToggle.openYesNoQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),!CrosstabPlugin.getDefault().getPluginPreferences().getBoolean(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS),null,null);
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
      removeInvalidBindings(handle);
    }
 else     if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
    }
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID || msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
      CrosstabPlugin.getDefault().getPluginPreferences().setValue(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS,!msgDlg.getToggleState());
    }
  }
 else {
    removeInvalidBindings(handle);
  }
}

Fixed version (ground truth):
public static void processInvaildBindings(CrosstabReportItemHandle handle){
  if (CrosstabPlugin.getDefault().getPluginPreferences().getBoolean(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS)) {
    MessageDialogWithToggle msgDlg=MessageDialogWithToggle.openYesNoQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),!CrosstabPlugin.getDefault().getPluginPreferences().getBoolean(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS),null,null);
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
      removeInvalidBindings(handle);
    }
 else     if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
    }
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID || msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
      CrosstabPlugin.getDefault().getPluginPreferences().setValue(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS,!msgDlg.getToggleState());
    }
  }
 else {
    removeInvalidBindings(handle);
  }
}
Program: 75260
Project: 75260
Buggy source:
public void refreshFigure(){
}

Fixed version (ground truth):
public void refreshFigure(){
  List list=controlFigure.getChildren();
  for (int i=0; i < list.size(); i++) {
    if (list.get(i) instanceof ListControlDisplayNameFigure) {
      ((ListControlDisplayNameFigure)list.get(i)).setText(((ListBandProxy)getModel()).getDisplayName());
    }
  }
}
Program: 75261
Project: 75261
Buggy source:
/** 
 * Start web application.
 */
private static void startWebApp(){
  try {
    WebappAccessor.start(ViewerPlugin.WEBAPP_CONTEXT,WebAppPlugin,Path.EMPTY);
  }
 catch (  CoreException e) {
  }
}

Fixed version (ground truth):
/** 
 * Start web application.
 */
private static void startWebApp(){
  try {
    String debugMode=System.getProperty(REPORT_DEBUT_MODE);
    if (debugMode == null) {
      ViewerClassPathHelper.setWorkspaceClassPath();
    }
    WebappAccessor.start(ViewerPlugin.WEBAPP_CONTEXT,WebAppPlugin,Path.EMPTY);
  }
 catch (  CoreException e) {
  }
}
Program: 75262
Project: 75262
Buggy source:
/** 
 * Runs a webapp on the server. The webapp is defined in a plugin and the path is relative to the plugin directory. <p> It is assumed that webapp names are unique. It is suggested to create unique web app names by prefixing them with the plugin id. </p>
 * @param webappName the name of the web app (also knowns as application context)
 * @param pluginId plugin that defines the webapp
 * @param path webapp relative path to the plugin directory
 * @exception CoreException
 */
public synchronized static void start(String webappName,String pluginId,IPath path) throws CoreException {
  if (applicationsStarted)   return;
  String projectClassPaths=WorkspaceClasspathManager.getClassPath();
  if (projectClassPaths == null) {
    projectClassPaths="String_Node_Str";
  }
  System.setProperty(WORKSPACE_CLASSPATH_KEY,projectClassPaths);
  IPath webappPath=getWebappPath(pluginId,path);
  IWebappServer server=AppServerWrapper.getInstance().getAppServer();
  PluginClassLoaderWrapper loader=new PluginClassLoaderWrapper(pluginId);
  server.start(webappName,webappPath,loader);
  applicationsStarted=true;
}

Fixed version (ground truth):
/** 
 * Runs a webapp on the server. The webapp is defined in a plugin and the path is relative to the plugin directory. <p> It is assumed that webapp names are unique. It is suggested to create unique web app names by prefixing them with the plugin id. </p>
 * @param webappName the name of the web app (also knowns as application context)
 * @param pluginId plugin that defines the webapp
 * @param path webapp relative path to the plugin directory
 * @exception CoreException
 */
public synchronized static void start(String webappName,String pluginId,IPath path) throws CoreException {
  if (applicationsStarted)   return;
  IPath webappPath=getWebappPath(pluginId,path);
  IWebappServer server=AppServerWrapper.getInstance().getAppServer();
  PluginClassLoaderWrapper loader=new PluginClassLoaderWrapper(pluginId);
  server.start(webappName,webappPath,loader);
  applicationsStarted=true;
}
Program: 75265
Project: 75265
Buggy source:
/** 
 * Determin aClass implements java.sql.Driver interface
 * @param aClass
 * @return
 */
private static boolean implementsSQLDriverClass(Class aClass){
  if (DriverClass.isAssignableFrom(aClass)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determine aClass implements java.sql.Driver interface
 * @param aClass
 * @return
 */
private static boolean implementsSQLDriverClass(Class aClass){
  if (DriverClass.isAssignableFrom(aClass)) {
    return true;
  }
  return false;
}
Program: 75266
Project: 75266
Buggy source:
/** 
 * Get all resouces included in a jar file
 * @param jarFile
 * @return
 */
private static String[] getAllResouceNames(File jarFile){
  ArrayList jarEntries=new ArrayList();
  try {
    ZipFile zf=new ZipFile(jarFile);
    Enumeration e=zf.entries();
    while (e.hasMoreElements()) {
      ZipEntry ze=(ZipEntry)e.nextElement();
      if (!ze.isDirectory()) {
        jarEntries.add(ze.getName());
      }
    }
    zf.close();
  }
 catch (  IOException e1) {
  }
catch (  Exception e) {
    ExceptionHandler.showException(PlatformUI.getWorkbench().getDisplay().getActiveShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
  return (String[])jarEntries.toArray(new String[jarEntries.size()]);
}

Fixed version (ground truth):
/** 
 * Get all resources included in a jar file
 * @param jarFile
 * @return
 */
private static String[] getAllResouceNames(File jarFile){
  ArrayList jarEntries=new ArrayList();
  try {
    ZipFile zf=new ZipFile(jarFile);
    Enumeration e=zf.entries();
    while (e.hasMoreElements()) {
      ZipEntry ze=(ZipEntry)e.nextElement();
      if (!ze.isDirectory()) {
        jarEntries.add(ze.getName());
      }
    }
    zf.close();
  }
 catch (  IOException e1) {
  }
catch (  Exception e) {
    ExceptionHandler.showException(PlatformUI.getWorkbench().getDisplay().getActiveShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
  return (String[])jarEntries.toArray(new String[jarEntries.size()]);
}
Program: 75267
Project: 75267
Buggy source:
/** 
 * remove driver(s) from runtime driver list
 * @param fileList
 */
public static void removeFromDriverList(List fileList){
  for (int i=0; i < fileList.size(); i++) {
    String fileName=((File)fileList.get(i)).getName();
    jdbcDriverInfos.removeAll((List)file2Drivers.get(fileName));
    file2Drivers.remove(fileName);
  }
}

Fixed version (ground truth):
/** 
 * remove driver(s) from runtime driver list
 * @param fileList
 */
public static void removeFromDriverList(List fileList){
  for (int i=0; i < fileList.size(); i++) {
    String fileName=((File)fileList.get(i)).getName();
    jdbcDriverInfos.removeAll((List)file2Drivers.get(fileName));
    file2Drivers.remove(fileName);
    if (failLoadFileList.contains(fileList.get(i)))     failLoadFileList.remove(fileList.get(i));
  }
}
Program: 75268
Project: 75268
Buggy source:
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}

Fixed version (ground truth):
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  if (!failLoadFileList.isEmpty()) {
    fileList.addAll(failLoadFileList);
  }
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}
Program: 75270
Project: 75270
Buggy source:
/** 
 * Resets cached jdbc driver list to null, force reget the infomation when required next time.
 */
public static void resetJdbcDriverNames(){
  jdbcDriverInfos=null;
  driverNameMap=null;
  file2Drivers=null;
}

Fixed version (ground truth):
/** 
 * Resets cached jdbc driver list to null, force reget the information when required next time.
 */
public static void resetJdbcDriverNames(){
  jdbcDriverInfos=null;
  failLoadFileList=null;
  driverNameMap=null;
  file2Drivers=null;
}
Program: 75271
Project: 75271
Buggy source:
/** 
 * modify resourceName,perpare for loadClass()
 * @param resourceName
 * @return
 */
private static String modifyResourceName(String resourceName){
  resourceName=(resourceName.replaceAll("String_Node_Str","String_Node_Str")).substring(0,resourceName.length() - 6);
  return resourceName;
}

Fixed version (ground truth):
/** 
 * modify resourceName,prepare for loadClass()
 * @param resourceName
 * @return
 */
private static String modifyResourceName(String resourceName){
  resourceName=(resourceName.replaceAll("String_Node_Str","String_Node_Str")).substring(0,resourceName.length() - 6);
  return resourceName;
}
Program: 75272
Project: 75272
Buggy source:
/** 
 * Get a List of JDBCDriverInformations loaded from the given fileList
 * @param fileList the File List
 * @param urlClassLoader
 * @return List of JDBCDriverInformation
 */
private static List getJDBCDriverInfoList(List fileList,URLClassLoader urlClassLoader){
  List driverList=new ArrayList();
  for (int i=0; i < fileList.size(); i++) {
    String[] resourceNames=getAllResouceNames((File)fileList.get(i));
    List subDriverList=new ArrayList();
    for (int j=0; j < resourceNames.length; j++) {
      String resourceName=resourceNames[j];
      if (resourceName.endsWith("String_Node_Str")) {
        resourceName=modifyResourceName(resourceName);
        Class aClass=loadClass(urlClassLoader,resourceName);
        if (isImplementedDriver(aClass)) {
          JDBCDriverInformation info=JDBCDriverInformation.newInstance(aClass);
          if (info != null) {
            driverList.add(info);
            subDriverList.add(info);
          }
        }
      }
    }
    file2Drivers.put(((File)fileList.get(i)).getName(),subDriverList);
  }
  return driverList;
}

Fixed version (ground truth):
/** 
 * Get a List of JDBCDriverInformations loaded from the given fileList
 * @param fileList the File List
 * @param urlClassLoader
 * @return List of JDBCDriverInformation
 */
private static List getJDBCDriverInfoList(List fileList,URLClassLoader urlClassLoader){
  List driverList=new ArrayList();
  for (int i=0; i < fileList.size(); i++) {
    String[] resourceNames=getAllResouceNames((File)fileList.get(i));
    List subDriverList=new ArrayList();
    for (int j=0; j < resourceNames.length; j++) {
      String resourceName=resourceNames[j];
      if (resourceName.endsWith("String_Node_Str")) {
        resourceName=modifyResourceName(resourceName);
        Class aClass=loadClass(urlClassLoader,resourceName);
        if (isImplementedDriver(aClass)) {
          JDBCDriverInformation info=JDBCDriverInformation.newInstance(aClass);
          if (info != null) {
            driverList.add(info);
            subDriverList.add(info);
          }
        }
      }
    }
    if (subDriverList.isEmpty()) {
      if (!failLoadFileList.contains(fileList.get(i)))       failLoadFileList.add(fileList.get(i));
    }
 else {
      if (failLoadFileList.contains(fileList.get(i)))       failLoadFileList.remove(fileList.get(i));
    }
    file2Drivers.put(((File)fileList.get(i)).getName(),subDriverList);
  }
  return driverList;
}
Program: 75273
Project: 75273
Buggy source:
protected String getText(){
  String text=((DataItemHandle)getModel()).getResultSetColumn();
  if (text == null || text.length() == 0) {
    text=FIGURE_DEFAULT_TEXT;
  }
 else {
    if (text.length() > TRUNCATE_LENGTH) {
      text=text.substring(0,TRUNCATE_LENGTH - 2) + ELLIPSIS;
    }
    text="String_Node_Str" + text + "String_Node_Str";
  }
  if (hasBindingFunction()) {
    text=PREFIX + text;
  }
  return text;
}

Fixed version (ground truth):
protected String getText(){
  String text=((DataItemHandle)getModel()).getResultSetColumn();
  if (text == null || text.length() == 0) {
    text=FIGURE_DEFAULT_TEXT;
  }
 else {
    if (text.length() > TRUNCATE_LENGTH) {
      text=text.substring(0,TRUNCATE_LENGTH - 2) + ELLIPSIS;
    }
    text="String_Node_Str" + text + "String_Node_Str";
  }
  if (hasBindingFunction()) {
    ((LabelFigure)getFigure()).setSpecialPREFIX(PREFIX);
    text=PREFIX + text;
  }
  return text;
}
Program: 75274
Project: 75274
Buggy source:
protected String getText(){
  if (!hasBindingFunction()) {
    return super.getText();
  }
  String retValue=getMeasureName();
  if (retValue == null) {
    return super.getText();
  }
  return PREFIX + "String_Node_Str" + retValue+ "String_Node_Str";
}

Fixed version (ground truth):
protected String getText(){
  if (!hasBindingFunction()) {
    return super.getText();
  }
  String retValue=getMeasureName();
  if (retValue == null) {
    return super.getText();
  }
  ((LabelFigure)getFigure()).setSpecialPREFIX(PREFIX);
  return PREFIX + "String_Node_Str" + retValue+ "String_Node_Str";
}
Program: 75275
Project: 75275
Buggy source:
/** 
 * @param name
 * @param resultSets
 * @param writer
 * @throws IOException
 */
public static void save(String name,IAggregationResultSet[] resultSets,IDocArchiveWriter writer) throws IOException {
  RAOutputStream outputStream=writer.createRandomAccessStream(name);
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  if (resultSets == null) {
    dataOutputStream.writeInt(-1);
    return;
  }
  dataOutputStream.writeInt(resultSets.length);
  dataOutputStream.close();
  for (int i=0; i < resultSets.length; i++) {
    outputStream=writer.createRandomAccessStream(name + i);
    dataOutputStream=new DataOutputStream(outputStream);
    saveOneResultSet(dataOutputStream,resultSets[i]);
  }
}

Fixed version (ground truth):
/** 
 * @param name
 * @param resultSets
 * @param writer
 * @throws IOException
 */
public static void save(String name,IAggregationResultSet[] resultSets,IDocArchiveWriter writer) throws IOException {
  RAOutputStream outputStream=writer.createRandomAccessStream(name);
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  if (resultSets == null) {
    dataOutputStream.writeInt(-1);
    return;
  }
  dataOutputStream.writeInt(resultSets.length);
  dataOutputStream.close();
  for (int i=0; i < resultSets.length; i++) {
    outputStream=writer.createRandomAccessStream(name + PREFIX_RESULTSET + i);
    dataOutputStream=new DataOutputStream(outputStream);
    saveOneResultSet(dataOutputStream,resultSets[i]);
    dataOutputStream.close();
  }
}
Program: 75276
Project: 75276
Buggy source:
/** 
 * @param name
 * @param reader
 * @throws IOException
 */
public static IAggregationResultSet[] load(String name,IDocArchiveReader reader) throws IOException {
  RAInputStream inputStream=reader.getStream(name);
  DataInputStream dataInputStream=new DataInputStream(inputStream);
  int size=dataInputStream.readInt();
  inputStream.close();
  if (size <= 0) {
    return null;
  }
  IAggregationResultSet[] result=new IAggregationResultSet[size];
  for (int i=0; i < size; i++) {
    inputStream=reader.getStream(name + i);
    dataInputStream=new DataInputStream(inputStream);
    result[i]=loadOneResultSet(dataInputStream);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param name
 * @param reader
 * @throws IOException
 */
public static IAggregationResultSet[] load(String name,IDocArchiveReader reader) throws IOException {
  RAInputStream inputStream=reader.getStream(name);
  DataInputStream dataInputStream=new DataInputStream(inputStream);
  int size=dataInputStream.readInt();
  inputStream.close();
  if (size <= 0) {
    return null;
  }
  IAggregationResultSet[] result=new IAggregationResultSet[size];
  for (int i=0; i < size; i++) {
    inputStream=reader.getStream(name + PREFIX_RESULTSET + i);
    dataInputStream=new DataInputStream(inputStream);
    result[i]=loadOneResultSet(dataInputStream);
    dataInputStream.close();
  }
  return result;
}
Program: 75277
Project: 75277
Buggy source:
/** 
 * if the Node is row Node, return true
 * @param refNode
 * @return
 */
private static boolean getDirectColRefExpr(Node refNode){
  assert(refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM);
  Node rowName=refNode.getFirstChild();
  assert(rowName != null);
  if (rowName.getType() != Token.NAME)   return false;
  String str=rowName.getString();
  assert(str != null);
  if (!str.equals(STRING_ROW))   return false;
  Node rowColumn=rowName.getNext();
  assert(rowColumn != null);
  if (refNode.getType() == Token.GETPROP && rowColumn.getType() == Token.STRING) {
    return true;
  }
 else   if (refNode.getType() == Token.GETELEM) {
    if (rowColumn.getType() == Token.NUMBER || rowColumn.getType() == Token.STRING)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * if the Node is row Node, return true
 * @param refNode
 * @return
 */
private static boolean getDirectColRefExpr(Node refNode,boolean mode){
  assert(refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM);
  Node rowName=refNode.getFirstChild();
  assert(rowName != null);
  if (rowName.getType() != Token.NAME)   return false;
  String str=rowName.getString();
  assert(str != null);
  if (mode && !str.equals(STRING_ROW))   return false;
 else   if (!mode && !str.equals(STRING_DATASET_ROW))   return false;
  Node rowColumn=rowName.getNext();
  assert(rowColumn != null);
  if (refNode.getType() == Token.GETPROP && rowColumn.getType() == Token.STRING) {
    return true;
  }
 else   if (refNode.getType() == Token.GETELEM) {
    if (rowColumn.getType() == Token.NUMBER || rowColumn.getType() == Token.STRING)     return true;
  }
  return false;
}
Program: 75278
Project: 75278
Buggy source:
/** 
 * whether the expression is column reference
 * @param expression
 * @return
 */
public static boolean isColumnExpression(String expression){
  boolean isColumn=false;
  if (expression == null || expression.trim().length() == 0)   return isColumn;
  if (compiledExprCache.containsKey(expression))   return ((Boolean)compiledExprCache.get(expression)).booleanValue();
  Context context=Context.enter();
  ScriptOrFnNode tree;
  try {
    CompilerEnvirons m_compilerEnv=new CompilerEnvirons();
    m_compilerEnv.initFromContext(context);
    Parser p=new Parser(m_compilerEnv,context.getErrorReporter());
    tree=p.parse(expression,null,0);
  }
 catch (  Exception e) {
    compiledExprCache.put(expression,Boolean.valueOf(false));
    return false;
  }
 finally {
    Context.exit();
  }
  if (tree.getFirstChild() == tree.getLastChild()) {
    if (tree.getFirstChild().getType() != Token.EXPR_RESULT && tree.getFirstChild().getType() != Token.EXPR_VOID && tree.getFirstChild().getType() != Token.BLOCK) {
      isColumn=false;
    }
    Node exprNode=tree.getFirstChild();
    Node child=exprNode.getFirstChild();
    assert(child != null);
    if (child.getType() == Token.GETELEM || child.getType() == Token.GETPROP)     isColumn=getDirectColRefExpr(child);
 else     isColumn=false;
  }
 else {
    isColumn=false;
  }
  compiledExprCache.put(expression,Boolean.valueOf(isColumn));
  return isColumn;
}

Fixed version (ground truth):
/** 
 * whether the expression is column reference
 * @param expression
 * @return
 */
public static boolean isColumnExpression(String expression,boolean mode){
  boolean isColumn=false;
  if (expression == null || expression.trim().length() == 0)   return isColumn;
  if (getCompiledExpCacheMap(mode).containsKey(expression)) {
    return ((Boolean)getCompiledExpCacheMap(mode).get(expression)).booleanValue();
  }
  Context context=Context.enter();
  ScriptOrFnNode tree;
  try {
    CompilerEnvirons m_compilerEnv=new CompilerEnvirons();
    m_compilerEnv.initFromContext(context);
    Parser p=new Parser(m_compilerEnv,context.getErrorReporter());
    tree=p.parse(expression,null,0);
  }
 catch (  Exception e) {
    getCompiledExpCacheMap(mode).put(expression,Boolean.valueOf(false));
    return false;
  }
 finally {
    Context.exit();
  }
  if (tree.getFirstChild() == tree.getLastChild()) {
    if (tree.getFirstChild().getType() != Token.EXPR_RESULT && tree.getFirstChild().getType() != Token.EXPR_VOID && tree.getFirstChild().getType() != Token.BLOCK) {
      isColumn=false;
    }
    Node exprNode=tree.getFirstChild();
    Node child=exprNode.getFirstChild();
    assert(child != null);
    if (child.getType() == Token.GETELEM || child.getType() == Token.GETPROP)     isColumn=getDirectColRefExpr(child,mode);
 else     isColumn=false;
  }
 else {
    isColumn=false;
  }
  getCompiledExpCacheMap(mode).put(expression,Boolean.valueOf(isColumn));
  return isColumn;
}
Program: 75279
Project: 75279
Buggy source:
/** 
 * replace the row[], row.xx with dataSetRow[],dataSetRow.xx
 * @param refNode
 * @return
 */
public static String getReplacedColRefExpr(String columnStr){
  if (isColumnExpression(columnStr)) {
    return columnStr.replaceFirst("String_Node_Str","String_Node_Str");
  }
 else   return columnStr;
}

Fixed version (ground truth):
/** 
 * replace the row[], row.xx with dataSetRow[],dataSetRow.xx
 * @param refNode
 * @return
 */
public static String getReplacedColRefExpr(String columnStr){
  if (isColumnExpression(columnStr,true)) {
    return columnStr.replaceFirst("String_Node_Str","String_Node_Str");
  }
 else   return columnStr;
}
Program: 75280
Project: 75280
Buggy source:
public ICubeQueryResults execute(Scriptable scope){
  return new CubeQueryResults(this,this.session,scope == null ? this.session.getSharedScope() : scope,this.context);
}

Fixed version (ground truth):
public ICubeQueryResults execute(Scriptable scope){
  Scriptable cubeScope;
  Context cx=Context.enter();
  try {
    cubeScope=cx.newObject(scope == null ? this.session.getSharedScope() : scope);
    cubeScope.setParentScope(scope == null ? this.session.getSharedScope() : scope);
    cubeScope.setPrototype(scope == null ? this.session.getSharedScope() : scope);
  }
  finally {
    Context.exit();
  }
  return new CubeQueryResults(this,this.session,cubeScope,this.context);
}
Program: 75281
Project: 75281
Buggy source:
public void setFontSize(float fontSize){
  this.fontSize=fontSize;
}

Fixed version (ground truth):
public void setFontSize(float fontSize){
  this.fontSize=fontSize;
  this.fontPadding=this.fontSize / 5f;
  this.lineWidth=this.fontSize / 20f;
}
Program: 75283
Project: 75283
Buggy source:
private boolean isMappedTo(char c,String from,String to){
  BaseFont font=fontMappingManager.getMappedFont(c,createCssValueList(from),Font.NORMAL);
  return isIn(to,font.getFullFontName());
}

Fixed version (ground truth):
private boolean isMappedTo(char c,String from,String to){
  BaseFont font=FontHandlerUtil.getMappedFont(handler,c,fontMappingManager,createCssValueList(from),Font.NORMAL);
  return isIn(to,font.getFullFontName());
}
Program: 75284
Project: 75284
Buggy source:
/** 
 * Selects a proper font for a character.
 */
public boolean selectFont(char character){
  assert(fontManager != null);
  BaseFont candidateFont=fontManager.getMappedFont(character,fontFamilies,fontStyle);
  assert(candidateFont != null);
  checkFontStatus(candidateFont);
  return candidateFont.charExists(character);
}

Fixed version (ground truth):
/** 
 * Selects a proper font for a character.
 */
public boolean selectFont(char character){
  assert(fontManager != null);
  BaseFont candidateFont=getMappedFont(character);
  assert(candidateFont != null);
  checkFontStatus(candidateFont);
  return candidateFont.charExists(character);
}
Program: 75285
Project: 75285
Buggy source:
private boolean isCharDefinedInFont(char c,String fontName,int fontStyle){
  BaseFont bf=createFont(fontName,fontStyle);
  return null != bf && bf.charExists(c);
}

Fixed version (ground truth):
public boolean isCharDefinedInFont(char c,String fontName,int fontStyle){
  BaseFont bf=createFont(fontName,fontStyle);
  return null != bf && bf.charExists(c);
}
Program: 75286
Project: 75286
Buggy source:
private String getLogicalFont(String fontFamilyName){
  String fontName=getMappedFontName(fontFamilyName,fontAliases);
  return fontName == null ? fontFamilyName : fontName;
}

Fixed version (ground truth):
public String getLogicalFont(String fontFamilyName){
  String fontName=getMappedFontName(fontFamilyName,fontAliases);
  return fontName == null ? fontFamilyName : fontName;
}
Program: 75287
Project: 75287
Buggy source:
private String getPhysicalFont(char c,String logicalFont,String defaultFont){
  if (isCompositeFont(logicalFont)) {
    Map compositeFont=(Map)compositeFonts.get(logicalFont);
    String blockFont=getBlockFont(compositeFont,c);
    if (blockFont != null) {
      return blockFont;
    }
  }
  return defaultFont;
}

Fixed version (ground truth):
public String getPhysicalFont(char c,String logicalFont,String defaultFont){
  if (isCompositeFont(logicalFont)) {
    Map compositeFont=(Map)compositeFonts.get(logicalFont);
    String blockFont=getBlockFont(compositeFont,c);
    if (blockFont != null) {
      return blockFont;
    }
  }
  return defaultFont;
}
Program: 75288
Project: 75288
Buggy source:
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @param encoding the encoding for the font.
 * @return the created BaseFont.
 */
private BaseFont createFont(String ffn,int fontStyle){
  String key=ffn + fontStyle;
synchronized (baseFonts) {
    BaseFont font=(BaseFont)baseFonts.get(key);
    if (font == null) {
      String encoding=getEncoding(ffn);
      Font f=null;
      try {
        f=FontFactory.getFont(ffn,encoding,BaseFont.NOT_EMBEDDED,14,fontStyle);
      }
 catch (      Throwable de) {
        logger.log(Level.WARNING,de.getLocalizedMessage());
        return null;
      }
      font=f.getBaseFont();
      if (font != null) {
        baseFonts.put(key,font);
      }
    }
    return font;
  }
}

Fixed version (ground truth):
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @param encoding the encoding for the font.
 * @return the created BaseFont.
 */
public BaseFont createFont(String ffn,int fontStyle){
  String key=ffn + fontStyle;
synchronized (baseFonts) {
    BaseFont font=(BaseFont)baseFonts.get(key);
    if (font == null) {
      String encoding=getEncoding(ffn);
      Font f=null;
      try {
        f=FontFactory.getFont(ffn,encoding,BaseFont.NOT_EMBEDDED,14,fontStyle);
      }
 catch (      Throwable de) {
        logger.log(Level.WARNING,de.getLocalizedMessage());
        return null;
      }
      font=f.getBaseFont();
      if (font != null) {
        baseFonts.put(key,font);
      }
    }
    return font;
  }
}
Program: 75289
Project: 75289
Buggy source:
public Image(IImageContent content){
  String imgUri=content.getURI();
  byte[] imgData=content.getData();
  this.imageMap=(String)content.getImageMap();
  this.mimeType=content.getMIMEType();
  this.extension=content.getExtension();
  if (extension == null) {
    if (mimeType != null) {
      extension=FileUtil.getExtFromType(mimeType);
    }
  }
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
    if (imgUri != null) {
      this.id=imgUri;
      this.source=IImage.FILE_IMAGE;
    }
  break;
case IImageContent.IMAGE_NAME:
if (imgData != null) {
  this.data=imgData;
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case IImageContent.IMAGE_EXPRESSION:
if (imgData != null) {
this.data=imgData;
this.source=IImage.CUSTOM_IMAGE;
this.id=content.getInstanceID().toString();
}
break;
case IImageContent.IMAGE_URL:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}

Fixed version (ground truth):
public Image(IImageContent content){
  String imgUri=content.getURI();
  byte[] imgData=content.getData();
  this.imageMap=(String)content.getImageMap();
  this.mimeType=content.getMIMEType();
  this.extension=content.getExtension();
  if (extension == null) {
    if (mimeType != null) {
      extension=FileUtil.getExtFromType(mimeType);
    }
  }
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
    if (imgUri != null) {
      this.id=imgUri;
      this.source=IImage.FILE_IMAGE;
    }
  break;
case IImageContent.IMAGE_NAME:
if (imgData != null) {
  this.data=imgData;
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case IImageContent.IMAGE_EXPRESSION:
if (imgData != null) {
this.data=imgData;
this.source=IImage.CUSTOM_IMAGE;
this.id=content.getInstanceID().toUniqueString();
}
break;
case IImageContent.IMAGE_URL:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}
Program: 75292
Project: 75292
Buggy source:
private void simulateItalic(PdfContentByte cb,float x,float y){
  float alpha=(float)Math.tan(0f * Math.PI / 180);
  float beta=(float)Math.tan(15f * Math.PI / 180);
  cb.setTextMatrix(1,alpha,beta,1,x,y);
}

Fixed version (ground truth):
private void simulateItalic(PdfContentByte cb,float x,float y){
  float alpha=(float)Math.tan(0f * Math.PI / 180);
  float beta=EmitterUtil.getItalicHorizontalCoefficient();
  cb.setTextMatrix(1,alpha,beta,1,x,y);
}
Program: 75293
Project: 75293
Buggy source:
public void drawString(String str,float x,float y,FontInfo fontInfo,float letterSpacing,float wordSpacing,Color color,boolean linethrough,boolean overline,boolean underline,CSSValue align){
  y=transformY(y);
  gSave();
  String text=str;
  if (fontInfo != null) {
    BaseFont baseFont=fontInfo.getBaseFont();
    String fontName=getFontName(baseFont);
    text=applyFont(fontName,fontInfo.getFontStyle(),fontInfo.getFontSize(),text);
  }
  color=color == null ? Color.black : color;
  setColor(color);
  out.print(x);
  out.print("String_Node_Str");
  out.print(y);
  out.print("String_Node_Str");
  out.print(overline ? "String_Node_Str" : "String_Node_Str");
  out.print(linethrough ? "String_Node_Str" : "String_Node_Str");
  out.print(underline ? "String_Node_Str" : "String_Node_Str");
  out.print(wordSpacing);
  out.print("String_Node_Str");
  out.print(letterSpacing);
  out.print("String_Node_Str");
  out.print(text);
  out.println("String_Node_Str");
  gRestore();
}

Fixed version (ground truth):
public void drawString(String str,float x,float y,FontInfo fontInfo,float letterSpacing,float wordSpacing,Color color,boolean linethrough,boolean overline,boolean underline,CSSValue align){
  y=transformY(y);
  gSave();
  String text=str;
  if (fontInfo != null) {
    BaseFont baseFont=fontInfo.getBaseFont();
    String fontName=baseFont.getPostscriptFontName();
    text=applyFont(fontName,fontInfo.getFontStyle(),fontInfo.getFontSize(),text);
  }
  color=color == null ? Color.black : color;
  setColor(color);
  out.print(x);
  out.print("String_Node_Str");
  out.print(y);
  out.print("String_Node_Str");
  out.print(overline ? "String_Node_Str" : "String_Node_Str");
  out.print(linethrough ? "String_Node_Str" : "String_Node_Str");
  out.print(underline ? "String_Node_Str" : "String_Node_Str");
  out.print(wordSpacing);
  out.print("String_Node_Str");
  out.print(letterSpacing);
  out.print("String_Node_Str");
  out.print(text);
  out.println("String_Node_Str");
  gRestore();
}
Program: 75294
Project: 75294
Buggy source:
private String applyFont(String fontName,int fontStyle,float fontSize,String text){
  if (isIntrinsicFont(fontName)) {
    return applyIntrinsicFont(fontName,fontStyle,fontSize,text);
  }
 else {
    try {
      String searchName=fontName + getFontSuffix(fontStyle);
      String fontPath=getFontPath(searchName);
      if (fontPath == null) {
        return applyIntrinsicFont(fontName,fontStyle,fontSize,text);
      }
      ITrueTypeWriter trueTypeWriter=getTrueTypeFontWriter(fontPath);
      String displayName=searchName.replace(' ','_');
      trueTypeWriter.useDisplayName(displayName);
      trueTypeWriter.ensureGlyphsAvailable(text);
      setFont(displayName,fontSize);
      return toHexString(text);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return null;
  }
}

Fixed version (ground truth):
private String applyFont(String fontName,int fontStyle,float fontSize,String text){
  if (isIntrinsicFont(fontName)) {
    return applyIntrinsicFont(fontName,fontStyle,fontSize,text);
  }
 else {
    try {
      String fontPath=getFontPath(fontName);
      if (fontPath == null) {
        return applyIntrinsicFont(fontName,fontStyle,fontSize,text);
      }
      ITrueTypeWriter trueTypeWriter=getTrueTypeFontWriter(fontPath);
      String displayName=fontName.replace(' ','_');
      trueTypeWriter.useDisplayName(displayName);
      trueTypeWriter.ensureGlyphsAvailable(text);
      setFont(displayName,fontSize);
      return toHexString(text);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return null;
  }
}
Program: 75295
Project: 75295
Buggy source:
private String getFontPath(String fontName){
  try {
    Object fontImpl=getField(FontFactory.class,"String_Node_Str",null);
    Properties trueTypeFonts=(Properties)getField(FontFactoryImp.class,"String_Node_Str",fontImpl);
    String fontPath=trueTypeFonts.getProperty(fontName.toLowerCase());
    return fontPath;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
private String getFontPath(String fontName){
  try {
    FontFactoryImp fontImpl=FontFactory.getFontImp();
    Properties trueTypeFonts=(Properties)getField(FontFactoryImp.class,"String_Node_Str",fontImpl);
    String fontPath=trueTypeFonts.getProperty(fontName.toLowerCase());
    return fontPath;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 75298
Project: 75298
Buggy source:
/** 
 * Create HTML render option.
 * @param svgFlag
 * @param servletPath
 * @param request
 * @return HTML render option from the given arguments
 */
private HTMLRenderOption createHTMLRenderOption(boolean svgFlag,String servletPath,HttpServletRequest request){
  String baseURL=null;
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null)   baseURL="String_Node_Str";
  baseURL+=request.getContextPath();
  HTMLRenderOption renderOption=new HTMLRenderOption();
  renderOption.setImageDirectory(ParameterAccessor.getImageTempFolder(request));
  renderOption.setBaseImageURL(baseURL + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setEnableAgentStyleEngine(ParameterAccessor.isAgentStyle(request));
  renderOption.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderOption;
}

Fixed version (ground truth):
/** 
 * Create HTML render option.
 * @param svgFlag
 * @param servletPath
 * @param request
 * @return HTML render option from the given arguments
 */
private HTMLRenderOption createHTMLRenderOption(boolean svgFlag,String servletPath,HttpServletRequest request){
  String baseURL=null;
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null) {
    if (ParameterAccessor.isOpenAsAttachment(request) || !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase(ParameterAccessor.getFormat(request))) {
      baseURL=request.getScheme() + "String_Node_Str" + request.getServerName()+ "String_Node_Str"+ request.getServerPort();
    }
 else {
      baseURL="String_Node_Str";
    }
  }
  baseURL+=request.getContextPath();
  HTMLRenderOption renderOption=new HTMLRenderOption();
  renderOption.setImageDirectory(ParameterAccessor.getImageTempFolder(request));
  renderOption.setBaseImageURL(baseURL + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setEnableAgentStyleEngine(ParameterAccessor.isAgentStyle(request));
  renderOption.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderOption;
}