nus-yam/ex-repair huggingface dataset:
Program: 71245
Project: 71245
Buggy source:
public static String formatDate(Object data){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  Date date=getDate(data);
  if (date == null) {
    return null;
  }
  return dateFormat.format(date);
}

Fixed version (ground truth):
public static String formatDate(Object data){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str",Locale.ENGLISH);
  Date date=getDate(data);
  if (date == null) {
    return null;
  }
  return dateFormat.format(date);
}
Program: 71246
Project: 71246
Buggy source:
/** 
 * Prepares one expression
 * @param expr
 * @param groupLevel
 * @param cx
 * @param reg
 */
private void prepareExpression(IBaseExpression expr,int groupLevel,ScriptContext cx,AggregateRegistry reg){
}

Fixed version (ground truth):
/** 
 * Prepares one expression
 * @param expr
 * @param groupLevel
 * @param cx
 * @param reg
 */
private void prepareExpression(IBaseExpression expr,int groupLevel,ScriptContext cx,AggregateRegistry reg){
  ExpressionCompiler compiler=this.expressionCompiler;
  if (expr instanceof IScriptExpression) {
    String exprText=((IScriptExpression)expr).getText();
    CompiledExpression handle=compiler.compile(exprText,reg,cx.getContext());
    expr.setHandle(handle);
  }
 else   if (expr instanceof IConditionalExpression) {
    IConditionalExpression ce=(IConditionalExpression)expr;
    ce=transformConditionalExpression(ce);
    prepareExpression(ce.getExpression(),groupLevel,cx,reg);
    if (ce.getOperand1() != null)     prepareExpression(ce.getOperand1(),groupLevel,cx,reg);
    if (ce.getOperand2() != null)     prepareExpression(ce.getOperand2(),groupLevel,cx,reg);
    expr.setHandle(ce);
  }
 else   if (expr instanceof IExpressionCollection) {
    IExpressionCollection ce=(IExpressionCollection)expr;
    Object[] exprs=ce.getExpressions().toArray();
    for (int i=0; i < exprs.length; i++) {
      prepareExpression((IBaseExpression)exprs[i],groupLevel,cx,reg);
    }
  }
}
Program: 71248
Project: 71248
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(engine.getContext().getScriptContext().getContext());
  }
  new CoreJavaScriptInitializer().initialize(engine.getContext().getScriptContext().getContext(),scope);
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(engine.getContext().getScriptContext().getContext());
  }
  new CoreJavaScriptInitializer().initialize(engine.getContext().getScriptContext().getContext(),scope);
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ "String_Node_Str"+ getCount()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 71249
Project: 71249
Buggy source:
/** 
 * Convenient to use EcoreUtil.copy without explicit casting. But please note that EcoreUtil.copy is costly, in general we should only use it in ui code.
 * @param < T >
 * @param src
 * @return
 */
@SuppressWarnings("String_Node_Str") public static <T extends EObject>T eCopy(T src){
  return (T)EcoreUtil.copy(src);
}

Fixed version (ground truth):
/** 
 * Convenient to use EcoreUtil.copy without explicit casting. But please note that EcoreUtil.copy is costly, in general we should only use it in ui code.
 * @param < T >
 * @param src
 * @since 2.5.0
 * @return
 */
@SuppressWarnings("String_Node_Str") public static <T extends EObject>T eCopy(T src){
  return (T)EcoreUtil.copy(src);
}
Program: 71250
Project: 71250
Buggy source:
/** 
 * Returns all instances of <code>SeriesDefinition</code> on category of chart.
 * @param chart chart model object.
 * @return a list of instances of <code>SeriesDefinition</code>.
 * @since 2.3
 */
public static EList<SeriesDefinition> getBaseSeriesDefinitions(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return ((Axis)((ChartWithAxes)chart).getAxes().get(0)).getSeriesDefinitions();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    return ((ChartWithoutAxes)chart).getSeriesDefinitions();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns all instances of <code>SeriesDefinition</code> on category of chart.
 * @param chart chart model object.
 * @return a list of instances of <code>SeriesDefinition</code>.
 * @since 2.3
 */
public static EList<SeriesDefinition> getBaseSeriesDefinitions(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return ((ChartWithAxes)chart).getAxes().get(0).getSeriesDefinitions();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    return ((ChartWithoutAxes)chart).getSeriesDefinitions();
  }
  return null;
}
Program: 71251
Project: 71251
Buggy source:
private static String[] toStringNameArray(List objList){
  if (objList == null) {
    return null;
  }
  String[] rt=new String[objList.size()];
  int i=0;
  for (Iterator itr=objList.iterator(); itr.hasNext(); ) {
    Object obj=itr.next();
    if (obj instanceof AbstractEnumerator) {
      rt[i++]=((AbstractEnumerator)obj).getName();
    }
 else {
      rt[i++]=String.valueOf(obj);
    }
  }
  return rt;
}

Fixed version (ground truth):
private static String[] toStringNameArray(List objList){
  if (objList == null) {
    return null;
  }
  String[] rt=new String[objList.size()];
  int i=0;
  for (Iterator itr=objList.iterator(); itr.hasNext(); ) {
    Object obj=itr.next();
    if (obj instanceof Enumerator) {
      rt[i++]=((Enumerator)obj).getName();
    }
 else {
      rt[i++]=String.valueOf(obj);
    }
  }
  return rt;
}
Program: 71252
Project: 71252
Buggy source:
private void selectItemInComboExpList(ISelection selection){
  ISelection sel=selection;
  if (sel.isEmpty() && cmbExpList.getItemCount() > 0) {
    IPropertyDefn propDefn=(IPropertyDefn)cmbExprListViewer.getElementAt(0);
    if (propDefn != null) {
      sel=new StructuredSelection(propDefn);
    }
  }
  cmbExprListViewer.setSelection(sel);
  return;
}

Fixed version (ground truth):
private void selectItemInComboExpList(ISelection selection){
  ISelection sel=selection;
  if (sel.isEmpty() && cmbExpList.getItemCount() > 0) {
    IPropertyDefn propDefn=(IPropertyDefn)cmbExprListViewer.getElementAt(0);
    if (propDefn != null) {
      sel=new StructuredSelection(propDefn);
    }
  }
  cmbExprListViewer.setSelection(getNewSelection(sel));
  return;
}
Program: 71253
Project: 71253
Buggy source:
/** 
 * Returns report runnable from design file
 * @param request
 * @param path
 * @return
 * @throws EngineException
 */
public static IReportRunnable getRunnableFromDesignFile(HttpServletRequest request,String designFile,Map options) throws EngineException {
  IReportRunnable reportRunnable=null;
  File file=new File(designFile);
  if (file.exists()) {
    reportRunnable=ReportEngineService.getInstance().openReportDesign(designFile,options);
  }
 else {
    InputStream is=null;
    URL url=null;
    try {
      designFile=ParameterAccessor.workingFolder + "String_Node_Str" + ParameterAccessor.getParameter(request,ParameterAccessor.PARAM_REPORT);
      if (!designFile.startsWith("String_Node_Str"))       designFile="String_Node_Str" + designFile;
      url=request.getSession().getServletContext().getResource(designFile);
      if (url != null)       is=url.openStream();
      if (is != null)       reportRunnable=ReportEngineService.getInstance().openReportDesign(url.toString(),is,options);
    }
 catch (    Exception e) {
    }
  }
  return reportRunnable;
}

Fixed version (ground truth):
/** 
 * Returns report runnable from design file
 * @param request
 * @param path
 * @return
 * @throws EngineException
 */
public static IReportRunnable getRunnableFromDesignFile(HttpServletRequest request,String designFile,Map options) throws EngineException {
  IReportRunnable reportRunnable=null;
  File file=new File(designFile);
  if (file.exists()) {
    reportRunnable=ReportEngineService.getInstance().openReportDesign(designFile,options);
  }
 else {
    InputStream is=null;
    URL url=null;
    try {
      if (!ParameterAccessor.isUniversalPath(designFile)) {
        designFile=ParameterAccessor.workingFolder + "String_Node_Str" + ParameterAccessor.getParameter(request,ParameterAccessor.PARAM_REPORT);
      }
      String resoureFile=designFile;
      if (!resoureFile.startsWith("String_Node_Str")) {
        resoureFile="String_Node_Str" + resoureFile;
      }
      url=request.getSession().getServletContext().getResource(resoureFile);
      if (url != null) {
        is=url.openStream();
      }
 else {
        url=new URL(designFile);
        is=url.openStream();
      }
      if (is != null) {
        reportRunnable=ReportEngineService.getInstance().openReportDesign(url.toString(),is,options);
      }
    }
 catch (    Exception e) {
    }
  }
  return reportRunnable;
}
Program: 71254
Project: 71254
Buggy source:
/** 
 * Checks if a given file name is a relative path.
 * @param fileName The file name.
 * @return A <code>boolean</code> value indicating if the file name is arelative path or not.
 */
public static boolean isRelativePath(String fileName){
  if (fileName == null) {
    return false;
  }
  return !new File(fileName).isAbsolute();
}

Fixed version (ground truth):
/** 
 * Checks if a given file name is a relative path. This will only check for local file path.
 * @param fileName The file name.
 * @return A <code>boolean</code> value indicating if the file name is arelative path or not.
 */
public static boolean isRelativePath(String fileName){
  if (fileName == null) {
    return false;
  }
  return !new File(fileName).isAbsolute();
}
Program: 71255
Project: 71255
Buggy source:
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  path=convertSystemPath(path);
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=DataUtil.trimSepEnd(getRealPath(path,context));
  }
 else {
    realPath=DataUtil.trimSepEnd(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}

Fixed version (ground truth):
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
private static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  path=convertSystemPath(path);
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=DataUtil.trimSepEnd(getRealPath(path,context));
  }
 else {
    realPath=DataUtil.trimSepEnd(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}
Program: 71256
Project: 71256
Buggy source:
/** 
 * Returns the real path based on working folder. If file path is an absolute path, return it directly. Else, return the absolute path based on working folder.
 * @param filePath
 * @param request
 * @return
 */
public static String getRealPathOnWorkingFolder(String filePath,HttpServletRequest request){
  if (filePath == null || filePath.length() == 0) {
    return filePath;
  }
  if (!isRelativePath(filePath))   return filePath;
  if (isRelativePath(workingFolder)) {
    filePath=getRealPath(workingFolder + "String_Node_Str" + filePath,request.getSession().getServletContext());
  }
 else {
    filePath=workingFolder + File.separator + filePath;
  }
  return filePath;
}

Fixed version (ground truth):
/** 
 * Returns the real path based on working folder. If file path is an absolute path, return it directly. Else, return the absolute path based on working folder.
 * @param filePath
 * @param request
 * @return
 */
public static String getRealPathOnWorkingFolder(String filePath,HttpServletRequest request){
  if (filePath == null || filePath.length() == 0) {
    return filePath;
  }
  if (isUniversalPath(filePath)) {
    return filePath;
  }
  if (!isUniversalPath(workingFolder)) {
    filePath=getRealPath(workingFolder + "String_Node_Str" + filePath,request.getSession().getServletContext());
  }
 else {
    filePath=workingFolder + "String_Node_Str" + filePath;
  }
  return filePath;
}
Program: 71257
Project: 71257
Buggy source:
/** 
 * Override implementation of doPostService.
 */
protected String doPostService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  request.setAttribute("String_Node_Str",request.getServletPath());
  String className=getClass().getName().substring(getClass().getName().lastIndexOf('.') + 1);
  return JSPRootPath + "String_Node_Str" + className+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Override implementation of doPostService.
 */
protected String doPostService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String className=getClass().getName().substring(getClass().getName().lastIndexOf('.') + 1);
  return JSPRootPath + "String_Node_Str" + className+ "String_Node_Str";
}
Program: 71258
Project: 71258
Buggy source:
/** 
 * @see javax.servlet.http.HttpServlet#service(javax.servlet.ServletRequest,javax.servlet.ServletResponse)
 */
public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  if (req.getCharacterEncoding() == null)   req.setCharacterEncoding(IBirtConstants.DEFAULT_ENCODE);
  super.service(req,res);
}

Fixed version (ground truth):
/** 
 * @see javax.servlet.http.HttpServlet#service(javax.servlet.ServletRequest,javax.servlet.ServletResponse)
 */
public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  if (req.getCharacterEncoding() == null)   req.setCharacterEncoding(IBirtConstants.DEFAULT_ENCODE);
  req.setAttribute("String_Node_Str",((HttpServletRequest)req).getServletPath());
  super.service(req,res);
}
Program: 71259
Project: 71259
Buggy source:
private void switchDataTable(){
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      if (bIsGettingPreviewData) {
        return;
      }
      ColumnBindingInfo[] headers=null;
      List dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        bIsGettingPreviewData=true;
        dataList=getDataServiceProvider().getPreviewData();
        bIsGettingPreviewData=false;
        getDataServiceProvider().setPredefinedExpressions(headers);
        final ColumnBindingInfo[] headerInfo=headers;
        final List data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List data=dataList;
        final String msg=e.getMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            WizardBase.showException(msg);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}

Fixed version (ground truth):
private void switchDataTable(){
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      ColumnBindingInfo[] headers=null;
      List<?> dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        dataList=getPreviewData();
        getDataServiceProvider().setPredefinedExpressions(headers);
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List data=dataList;
        final String msg=e.getMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            WizardBase.showException(msg);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}
Program: 71260
Project: 71260
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  ViewerPlugin dummy=ViewerPlugin.getDefault();
  String appRootPath=System.getProperty(ViewerPlugin.BIRT_VIEWER_ROOT_PATH);
  if (appRootPath != null) {
    ImageManager.getInstance().setURIRootPath(appRootPath);
  }
}
Program: 71261
Project: 71261
Buggy source:
/** 
 * Handle builder dialog action.
 */
private void handleBuilderAction(){
  try {
    String sExpr=context.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,getExpression(getInputControl()),context.getExtendedItem(),sTitle);
    boolean isSuccess=setUIText(getInputControl(),sExpr);
    query.setDefinition(sExpr);
    if (!isSuccess) {
      Event event=new Event();
      event.type=IChartDataSheet.EVENT_QUERY;
      event.data=queryType;
      context.getDataSheet().notifyListeners(event);
    }
  }
 catch (  ChartException e1) {
    WizardBase.displayException(e1);
  }
}

Fixed version (ground truth):
/** 
 * Handle builder dialog action.
 */
protected void handleBuilderAction(){
  try {
    String sExpr=context.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,getExpression(getInputControl()),context.getExtendedItem(),sTitle);
    boolean isSuccess=setUIText(getInputControl(),sExpr);
    query.setDefinition(sExpr);
    if (!isSuccess) {
      Event event=new Event();
      event.type=IChartDataSheet.EVENT_QUERY;
      event.data=queryType;
      context.getDataSheet().notifyListeners(event);
    }
  }
 catch (  ChartException e1) {
    WizardBase.displayException(e1);
  }
}
Program: 71262
Project: 71262
Buggy source:
/** 
 * @see javax.servlet.http.HttpServlet#service(javax.servlet.ServletRequest,javax.servlet.ServletResponse)
 */
public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  if (req.getCharacterEncoding() == null)   req.setCharacterEncoding(IBirtConstants.DEFAULT_ENCODE);
  super.service(req,res);
}

Fixed version (ground truth):
/** 
 * @see javax.servlet.http.HttpServlet#service(javax.servlet.ServletRequest,javax.servlet.ServletResponse)
 */
public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  if (req.getCharacterEncoding() == null)   req.setCharacterEncoding(IBirtConstants.DEFAULT_ENCODE);
  req.setAttribute("String_Node_Str",((HttpServletRequest)req).getServletPath());
  super.service(req,res);
}
Program: 71263
Project: 71263
Buggy source:
public final String[] validate(Chart cm,Object oContext){
  final ArrayList alProblems=new ArrayList(4);
  final ExtendedItemHandle eih=(ExtendedItemHandle)oContext;
  if (DEUtil.getDataSetList(eih).size() == 0 && ChartXTabUtil.getBindingCube(eih) == null) {
    alProblems.add(Messages.getString("String_Node_Str"));
  }
  final QueryUIHelper.SeriesQueries[] qsqa=new QueryUIHelper().getSeriesQueryDefinitions(cm);
  Collection co;
  for (int i=0; i < qsqa.length; i++) {
    co=qsqa[i].validate();
    if (co != null) {
      alProblems.addAll(co);
    }
  }
  return (String[])alProblems.toArray(new String[alProblems.size()]);
}

Fixed version (ground truth):
public final String[] validate(Chart cm,Object oContext){
  final ArrayList<String> alProblems=new ArrayList<String>(4);
  final ExtendedItemHandle eih=(ExtendedItemHandle)oContext;
  if (DEUtil.getDataSetList(eih).size() == 0 && ChartXTabUtil.getBindingCube(eih) == null) {
    alProblems.add(Messages.getString("String_Node_Str"));
  }
  final QueryUIHelper.SeriesQueries[] qsqa=new QueryUIHelper().getSeriesQueryDefinitions(cm);
  Collection<String> co;
  for (int i=0; i < qsqa.length; i++) {
    co=qsqa[i].validate();
    if (co != null) {
      alProblems.addAll(co);
    }
  }
  return alProblems.toArray(new String[alProblems.size()]);
}
Program: 71265
Project: 71265
Buggy source:
public Collection validate(){
  ArrayList al=null;
  for (int i=0; i < qua.length; i++) {
    if (!qua[i].isDefined()) {
      if (al == null) {
        al=new ArrayList(qua.length);
      }
      al.add(Messages.getString("String_Node_Str",sSeriesType));
    }
  }
  if (qua.length == 0) {
    al=new ArrayList(qua.length);
    al.add(Messages.getString("String_Node_Str",sSeriesType));
  }
  return al;
}

Fixed version (ground truth):
public Collection<String> validate(){
  ArrayList<String> al=null;
  if (qua.length == 0) {
    al=new ArrayList<String>(qua.length);
    al.add(Messages.getString("String_Node_Str",sSeriesType));
  }
 else {
    Object seriesName=((Series)qua[0].eContainer()).getSeriesIdentifier();
    String nameExt="String_Node_Str";
    if (seriesName != null && seriesName.toString().length() > 0) {
      nameExt="String_Node_Str" + seriesName.toString() + "String_Node_Str";
    }
    for (int i=0; i < qua.length; i++) {
      if (!qua[i].isDefined()) {
        if (al == null) {
          al=new ArrayList<String>(qua.length);
        }
        al.add(Messages.getString("String_Node_Str",sSeriesType + nameExt));
      }
    }
  }
  return al;
}
Program: 71266
Project: 71266
Buggy source:
public void handleEvent(Event event){
  String oldQuery=query.getDefinition() == null ? "String_Node_Str" : query.getDefinition();
  String text=cmbDefinition.getText();
  if (!isTableSharedBinding() && text.equals(oldQuery)) {
    return;
  }
  Object checkResult=context.getDataServiceProvider().checkData(queryType,text);
  if (checkResult != null && checkResult instanceof Boolean) {
    if (!((Boolean)checkResult).booleanValue()) {
      WizardBase.showException(Messages.getString("String_Node_Str"));
      cmbDefinition.setText(oldQuery);
      return;
    }
 else {
      WizardBase.removeException();
    }
  }
  updateQuery(text);
  if (!oldQuery.equals(text) && queryType == ChartUIConstants.QUERY_VALUE) {
    if (context.getDataServiceProvider().update(ChartUIConstants.QUERY_VALUE,text)) {
      Event e=new Event();
      e.data=BaseDataDefinitionComponent.this;
      e.widget=cmbDefinition;
      e.type=IChartDataSheet.EVENT_QUERY;
      context.getDataSheet().notifyListeners(e);
    }
  }
  if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) && ChartUIConstants.QUERY_CATEGORY.equals(queryType) && context.getModel() instanceof ChartWithAxes) {
    ((ChartWithAxes)context.getModel()).setTransposed(cmbDefinition.getSelectionIndex() > 0);
  }
  if (predefinedQuery.length == 0 && (getQuery().getDefinition() == null || getQuery().getDefinition().equals("String_Node_Str"))) {
    cmbDefinition.setEnabled(false);
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  String oldQuery=query.getDefinition() == null ? "String_Node_Str" : query.getDefinition();
  String text=cmbDefinition.getText();
  if (!isTableSharedBinding() && text.equals(oldQuery)) {
    return;
  }
  updateQuery(text);
  if (!oldQuery.equals(text) && queryType == ChartUIConstants.QUERY_VALUE) {
    if (context.getDataServiceProvider().update(ChartUIConstants.QUERY_VALUE,text)) {
      Event e=new Event();
      e.data=BaseDataDefinitionComponent.this;
      e.widget=cmbDefinition;
      e.type=IChartDataSheet.EVENT_QUERY;
      context.getDataSheet().notifyListeners(e);
    }
  }
  if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) && ChartUIConstants.QUERY_CATEGORY.equals(queryType) && context.getModel() instanceof ChartWithAxes) {
    ((ChartWithAxes)context.getModel()).setTransposed(cmbDefinition.getSelectionIndex() > 0);
  }
  if (predefinedQuery.length == 0 && (getQuery().getDefinition() == null || getQuery().getDefinition().equals("String_Node_Str"))) {
    cmbDefinition.setEnabled(false);
  }
}
Program: 71267
Project: 71267
Buggy source:
/** 
 * Handle builder dialog action.
 */
protected void handleBuilderAction(){
  try {
    String sExpr=context.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,getExpression(getInputControl()),context.getExtendedItem(),sTitle);
    boolean isSuccess=setUIText(getInputControl(),sExpr);
    query.setDefinition(sExpr);
    if (!isSuccess) {
      Event event=new Event();
      event.type=IChartDataSheet.EVENT_QUERY;
      event.data=queryType;
      context.getDataSheet().notifyListeners(event);
    }
  }
 catch (  ChartException e1) {
    WizardBase.displayException(e1);
  }
}

Fixed version (ground truth):
/** 
 * Handle builder dialog action.
 */
protected void handleBuilderAction(){
  try {
    String sExpr=context.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,getExpression(getInputControl()),context.getExtendedItem(),sTitle);
    boolean isSuccess=setUIText(getInputControl(),sExpr);
    updateQuery(sExpr);
    if (!isSuccess) {
      Event event=new Event();
      event.type=IChartDataSheet.EVENT_QUERY;
      event.data=queryType;
      context.getDataSheet().notifyListeners(event);
    }
  }
 catch (  ChartException e1) {
    WizardBase.displayException(e1);
  }
}
Program: 71268
Project: 71268
Buggy source:
/** 
 * Update query by specified expression. <p> Under shared binding case, update grouping/aggregate attributes of chart model if the selected item is group/aggregate expression.
 */
public void updateQuery(String expression){
  if (!isTableSharedBinding()) {
    setQueryExpression(expression);
    return;
  }
  updateQueryForSharedBinding(expression);
  String regex="String_Node_Str";
  if (expression.matches(regex)) {
    DataDefinitionTextManager.getInstance().updateControlBackground(getInputControl(),expression);
    final Event e=new Event();
    e.data=BaseDataDefinitionComponent.this;
    e.widget=getInputControl();
    e.type=IChartDataSheet.EVENT_QUERY;
    e.detail=IChartDataSheet.DETAIL_UPDATE_COLOR;
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        context.getDataSheet().notifyListeners(e);
      }
    }
);
  }
 else {
    getInputControl().setBackground(null);
  }
}

Fixed version (ground truth):
/** 
 * Update query by specified expression. <p> Under shared binding case, update grouping/aggregate attributes of chart model if the selected item is group/aggregate expression.
 */
public void updateQuery(String expression){
  if (getInputControl() instanceof CCombo) {
    String oldQuery=query.getDefinition() == null ? "String_Node_Str" : query.getDefinition();
    Object checkResult=context.getDataServiceProvider().checkData(queryType,expression);
    if (checkResult != null && checkResult instanceof Boolean) {
      if (!((Boolean)checkResult).booleanValue()) {
        WizardBase.showException(Messages.getString("String_Node_Str"));
        setUIText(getInputControl(),oldQuery);
        return;
      }
 else {
        WizardBase.removeException();
      }
    }
  }
  if (!isTableSharedBinding()) {
    setQueryExpression(expression);
    return;
  }
  updateQueryForSharedBinding(expression);
  String regex="String_Node_Str";
  if (expression.matches(regex)) {
    DataDefinitionTextManager.getInstance().updateControlBackground(getInputControl(),expression);
    final Event e=new Event();
    e.data=BaseDataDefinitionComponent.this;
    e.widget=getInputControl();
    e.type=IChartDataSheet.EVENT_QUERY;
    e.detail=IChartDataSheet.DETAIL_UPDATE_COLOR;
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        context.getDataSheet().notifyListeners(e);
      }
    }
);
  }
 else {
    getInputControl().setBackground(null);
  }
}
Program: 71270
Project: 71270
Buggy source:
public String getMessage(String key,Locale locale,Object[] params){
  String msg=context.getDesign().getMessage(key,locale);
  if (msg == null)   return "String_Node_Str";
  return MessageFormat.format(msg,params);
}

Fixed version (ground truth):
public String getMessage(String key,Locale locale,Object[] params){
  String msg=context.getDesign().getMessage(key,locale);
  if (msg == null)   return "String_Node_Str";
  MessageFormat formatter=new MessageFormat(msg,locale);
  return formatter.format(params,new StringBuffer(),null).toString();
}
Program: 71271
Project: 71271
Buggy source:
public static boolean needRemoveInvaildBindings(CrosstabReportItemHandle handle){
  String preferenceData=PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault()).getString(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS);
  if (preferenceData == null || preferenceData.length() == 0 || preferenceData.equals(MessageDialogWithToggle.PROMPT)) {
    MessageDialogWithToggle msgDlg=MessageDialogWithToggle.openYesNoQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,null,null);
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
      return true;
    }
 else     if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
      return false;
    }
    if (msgDlg.getToggleState()) {
      String value="String_Node_Str";
      if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
        value=MessageDialogWithToggle.ALWAYS;
      }
 else       if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
        value=MessageDialogWithToggle.NEVER;
      }
      PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault()).setValue(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS,value);
    }
  }
 else   if (preferenceData != null && preferenceData.equals(MessageDialogWithToggle.ALWAYS)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean needRemoveInvaildBindings(CrosstabReportItemHandle handle){
  String preferenceData=PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault()).getString(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS);
  if (preferenceData == null || preferenceData.length() == 0 || preferenceData.equals(MessageDialogWithToggle.PROMPT)) {
    MessageDialogWithToggle msgDlg=MessageDialogWithToggle.openYesNoQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,null,null);
    if (msgDlg.getToggleState()) {
      String value="String_Node_Str";
      if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
        value=MessageDialogWithToggle.ALWAYS;
      }
 else       if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
        value=MessageDialogWithToggle.NEVER;
      }
      PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault()).setValue(CrosstabPlugin.PREFERENCE_AUTO_DEL_BINDINGS,value);
    }
    if (msgDlg.getReturnCode() == IDialogConstants.YES_ID) {
      return true;
    }
 else     if (msgDlg.getReturnCode() == IDialogConstants.NO_ID) {
      return false;
    }
  }
 else   if (preferenceData != null && preferenceData.equals(MessageDialogWithToggle.ALWAYS)) {
    return true;
  }
  return false;
}
Program: 71272
Project: 71272
Buggy source:
public void writePageProperties(int pageHeight,int pageWidth,int headerHeight,int footerHeight,int topMargin,int bottomMargin,int leftMargin,int rightMargin,String orient){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",pageWidth);
  writer.attribute("String_Node_Str",pageHeight);
  writer.attribute("String_Node_Str",orient);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",topMargin);
  writer.attribute("String_Node_Str",bottomMargin);
  writer.attribute("String_Node_Str",leftMargin);
  writer.attribute("String_Node_Str",rightMargin);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writePageProperties(int pageHeight,int pageWidth,int headerHeight,int footerHeight,int topMargin,int bottomMargin,int leftMargin,int rightMargin,String orient){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",pageWidth);
  writer.attribute("String_Node_Str",pageHeight);
  writer.attribute("String_Node_Str",orient);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",topMargin);
  writer.attribute("String_Node_Str",bottomMargin);
  writer.attribute("String_Node_Str",leftMargin);
  writer.attribute("String_Node_Str",rightMargin);
  writer.attribute("String_Node_Str",topMargin);
  writer.attribute("String_Node_Str",bottomMargin);
  writer.closeTag("String_Node_Str");
}
Program: 71274
Project: 71274
Buggy source:
private void writeText(Data d){
  writer.openTag("String_Node_Str");
  int type=d.getDatatype();
  if (type == SheetData.NUMBER) {
    if (d.getText().equals(NAN_STRING) || d.isBigNumber() || d.isInfility()) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (type == SheetData.DATE) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText().toString();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeText(Data d){
  writer.openTag("String_Node_Str");
  int type=d.getDatatype();
  if (type == SheetData.NUMBER) {
    if (d.getText().equals(NaN) || d.isBigNumber() || d.isInfility()) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (type == SheetData.DATE) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText().toString();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}
Program: 71275
Project: 71275
Buggy source:
private void writeText(Data d){
  writer.openTag("String_Node_Str");
  int type=d.getDatatype();
  if (type == SheetData.NUMBER) {
    if (d.getText().equals(NaN) || d.isBigNumber() || d.isInfility()) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (type == SheetData.DATE) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText().toString();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeText(Data d){
  writer.openTag("String_Node_Str");
  int type=d.getDatatype();
  if (type == SheetData.NUMBER) {
    if (d.isNaN() || d.isBigNumber() || d.isInfility()) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (type == SheetData.DATE) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText().toString();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyle().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}
Program: 71276
Project: 71276
Buggy source:
public void refreshFigure(){
  ReportRootFigure figure=(ReportRootFigure)getFigure();
  figure.setShowMargin(showMargin);
  Dimension size=DEFAULTSIZE;
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
}

Fixed version (ground truth):
public void refreshFigure(){
  ReportRootFigure figure=(ReportRootFigure)getFigure();
  figure.setShowMargin(showMargin);
  Dimension size=DEFAULTSIZE;
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitInsets(INSETS);
}
Program: 71277
Project: 71277
Buggy source:
protected IFigure createFigure(){
  ReportRootFigure figure=new ReportRootFigure();
  figure.setOpaque(true);
  figure.setShowMargin(showMargin);
  LibraryReportDesignLayout layout=new LibraryReportDesignLayout(this);
  Dimension size=DEFAULTSIZE;
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  layout.setInitSize(bounds);
  figure.setLayoutManager(layout);
  figure.setBorder(new ReportDesignMarginBorder(INSETS));
  figure.setBounds(bounds.getCopy());
  return figure;
}

Fixed version (ground truth):
protected IFigure createFigure(){
  ReportRootFigure figure=new ReportRootFigure();
  figure.setOpaque(true);
  figure.setShowMargin(showMargin);
  ReportDesignLayout layout=new ReportDesignLayout(this);
  Dimension size=DEFAULTSIZE;
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  layout.setInitSize(bounds);
  figure.setLayoutManager(layout);
  figure.setBorder(new ReportDesignMarginBorder(INSETS));
  figure.setBounds(bounds.getCopy());
  return figure;
}
Program: 71278
Project: 71278
Buggy source:
public HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    String toolTip=linkaction.getTooltip();
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      String bookmark=linkaction.getBookmark();
      if (ExcelUtil.isValidBookmarkName(bookmark)) {
        return new HyperlinkDef(linkaction.getBookmark(),IHyperlinkAction.ACTION_BOOKMARK,null,toolTip);
      }
 else {
        return null;
      }
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null,toolTip);
    }
 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;
        String url=actionHandler.getURL(act,service.getReportContext());
        if (null != url && url.length() > 0) {
          return new HyperlinkDef(url,IHyperlinkAction.ACTION_DRILLTHROUGH,null,toolTip);
        }
 else {
          return null;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public HyperlinkDef parseHyperLink(IContent content){
  HyperlinkDef hyperlink=null;
  IHyperlinkAction linkAction=content.getHyperlinkAction();
  if (linkAction != null) {
    String tooltip=linkAction.getTooltip();
    String bookmark=linkAction.getBookmark();
    IReportRunnable reportRunnable=service.getReportRunnable();
    IReportContext reportContext=service.getReportContext();
    IHTMLActionHandler actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
switch (linkAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
      if (ExcelUtil.isValidBookmarkName(bookmark)) {
        hyperlink=new HyperlinkDef(bookmark,IHyperlinkAction.ACTION_BOOKMARK,null,tooltip);
      }
    break;
case IHyperlinkAction.ACTION_HYPERLINK:
  String url=org.eclipse.birt.report.engine.layout.emitter.EmitterUtil.getHyperlinkUrl(linkAction,reportRunnable,actionHandler,reportContext);
hyperlink=new HyperlinkDef(url,IHyperlinkAction.ACTION_HYPERLINK,null,tooltip);
break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
url=org.eclipse.birt.report.engine.layout.emitter.EmitterUtil.getHyperlinkUrl(linkAction,reportRunnable,actionHandler,reportContext);
hyperlink=new HyperlinkDef(url,IHyperlinkAction.ACTION_DRILLTHROUGH,null,tooltip);
break;
}
}
return hyperlink;
}
Program: 71279
Project: 71279
Buggy source:
public Object getParent(Object model){
  ExtendedItemHandle element=(ExtendedItemHandle)model;
  try {
    CrosstabCellHandle cell=(CrosstabCellHandle)element.getReportItem();
    if (cell.getContainer() != null) {
      if (cell.getContainer() instanceof MeasureViewHandle) {
        MeasureViewHandle measure=(MeasureViewHandle)cell.getContainer();
        PropertyHandle property=cell.getModelHandle().getContainerPropertyHandle();
        return measure.getModelHandle().getPropertyHandle(property.getPropertyDefn().getName());
      }
 else       if (cell.getContainer() instanceof LevelViewHandle || cell.getContainer() instanceof CrosstabViewHandle) {
        return cell.getContainer().getModelHandle();
      }
    }
  }
 catch (  ExtendedElementException e) {
  }
  return null;
}

Fixed version (ground truth):
public Object getParent(Object model){
  ExtendedItemHandle element=(ExtendedItemHandle)model;
  try {
    CrosstabCellHandle cell=(CrosstabCellHandle)element.getReportItem();
    if (cell.getContainer() != null) {
      if (cell.getContainer() instanceof MeasureViewHandle) {
        MeasureViewHandle measure=(MeasureViewHandle)cell.getContainer();
        PropertyHandle property=cell.getModelHandle().getContainerPropertyHandle();
        return measure.getModelHandle().getPropertyHandle(property.getPropertyDefn().getName());
      }
 else       if (cell.getContainer() instanceof LevelViewHandle || cell.getContainer() instanceof CrosstabViewHandle || cell.getContainer() instanceof CrosstabReportItemHandle) {
        return cell.getContainer().getModelHandle();
      }
    }
  }
 catch (  ExtendedElementException e) {
  }
  return null;
}
Program: 71282
Project: 71282
Buggy source:
protected HyperlinkInfo getHyperlink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  HyperlinkInfo hyperlink=null;
  if (linkaction != null) {
    String toolTip=linkaction.getTooltip();
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      String bookmark=linkaction.getBookmark().replaceAll("String_Node_Str","String_Node_Str");
      hyperlink=new HyperlinkInfo(HyperlinkInfo.BOOKMARK,bookmark,toolTip);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      hyperlink=new HyperlinkInfo(HyperlinkInfo.HYPERLINK,linkaction.getHyperlink(),toolTip);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      String systemId=null;
      if (null != reportRunnable) {
        systemId=reportRunnable.getReportName();
      }
      Action action=new Action(systemId,linkaction);
      if (actionHandler != null) {
        String url=actionHandler.getURL(action,reportContext);
        if (action.getBookmark() == null) {
          hyperlink=new HyperlinkInfo(HyperlinkInfo.HYPERLINK,url,toolTip);
        }
 else {
          hyperlink=new HyperlinkInfo(HyperlinkInfo.HYPERLINK,url,action.getBookmark());
        }
      }
    }
  }
  return hyperlink;
}

Fixed version (ground truth):
protected HyperlinkInfo getHyperlink(IContent content){
  HyperlinkInfo hyperlink=null;
  IHyperlinkAction linkAction=content.getHyperlinkAction();
  if (linkAction != null) {
    String tooltip=linkAction.getTooltip();
    String bookmark=linkAction.getBookmark();
switch (linkAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
      bookmark=bookmark.replaceAll("String_Node_Str","String_Node_Str");
    hyperlink=new HyperlinkInfo(HyperlinkInfo.BOOKMARK,bookmark,tooltip);
  break;
case IHyperlinkAction.ACTION_HYPERLINK:
case IHyperlinkAction.ACTION_DRILLTHROUGH:
String url=org.eclipse.birt.report.engine.layout.emitter.EmitterUtil.getHyperlinkUrl(linkAction,reportRunnable,actionHandler,reportContext);
hyperlink=new HyperlinkInfo(HyperlinkInfo.HYPERLINK,url,tooltip);
break;
}
}
return hyperlink;
}