Program: 70490
Project: 70490
Buggy source:
/** 
 * execute the html text.
 * @param design
 * @param emitter
 */
protected IContent executeHtmlText(){
  TextItemDesign textDesign=(TextItemDesign)getDesign();
  IForeignContent textContent=report.createForeignContent();
  setContent(textContent);
  executeQuery();
  initializeContent(textDesign,textContent);
  processAction(textDesign,textContent);
  processBookmark(textDesign,textContent);
  processStyle(textDesign,textContent);
  processVisibility(textDesign,textContent);
  String text=evaluate(textDesign.getText());
  String textType=evaluate(textDesign.getTextType());
  HashMap<String,String> exprs=null;
  if (textDesign.hasExpression()) {
    exprs=TextItemDesign.extractExpression(text,textType);
  }
  if (exprs != null && !exprs.isEmpty()) {
    HashMap<String,Object> results=new HashMap<String,Object>();
    Iterator<Entry<String,String>> iter=exprs.entrySet().iterator();
    while (iter.hasNext()) {
      Entry<String,String> entry=(Entry<String,String>)iter.next();
      String expr=(String)entry.getValue();
      try {
        Object value=evaluate(expr);
        results.put(entry.getKey(),value);
      }
 catch (      BirtException ex) {
        context.addException(ex);
      }
    }
    Object[] value=new Object[2];
    value[0]=null;
    value[1]=results;
    textContent.setRawValue(value);
  }
 else {
    textContent.setRawValue(new Object[]{null,null});
  }
  textContent.setRawType(IForeignContent.TEMPLATE_TYPE);
  if (context.isInFactory()) {
    handleOnCreate(textContent);
  }
  startTOCEntry(content);
  return textContent;
}

Fixed version (ground truth):
/** 
 * execute the html text.
 * @param design
 * @param emitter
 */
protected IContent executeHtmlText(){
  TextItemDesign textDesign=(TextItemDesign)getDesign();
  IForeignContent textContent=report.createForeignContent();
  setContent(textContent);
  executeQuery();
  initializeContent(textDesign,textContent);
  processAction(textDesign,textContent);
  processBookmark(textDesign,textContent);
  processStyle(textDesign,textContent);
  processVisibility(textDesign,textContent);
  Expression<String> textExpression=textDesign.getText();
  String text=evaluate(textExpression);
  String textType=evaluate(textDesign.getTextType());
  HashMap<String,String> exprs=null;
  if (textDesign.hasExpression()) {
    if (textExpression.isExpression()) {
      exprs=TextItemDesign.extractExpression(text,textType);
    }
 else {
      exprs=textDesign.getExpressions();
    }
  }
  if (exprs != null && !exprs.isEmpty()) {
    HashMap<String,Object> results=new HashMap<String,Object>();
    Iterator<Entry<String,String>> iter=exprs.entrySet().iterator();
    while (iter.hasNext()) {
      Entry<String,String> entry=(Entry<String,String>)iter.next();
      String expr=(String)entry.getValue();
      try {
        Object value=evaluate(expr);
        results.put(entry.getKey(),value);
      }
 catch (      BirtException ex) {
        context.addException(ex);
      }
    }
    Object[] value=new Object[2];
    value[0]=null;
    value[1]=results;
    textContent.setRawValue(value);
  }
 else {
    textContent.setRawValue(new Object[]{null,null});
  }
  textContent.setRawType(IForeignContent.TEMPLATE_TYPE);
  if (context.isInFactory()) {
    handleOnCreate(textContent);
  }
  startTOCEntry(content);
  return textContent;
}