Program: 74343
Project: 74343
Buggy source:
/** 
 * process the mapped rules.
 * @param item the design element used to create the data obj.
 * @param dataObj Data object.
 */
protected void processMappingValue(StyledElementDesign item,IDataContent dataObj){
  MapDesign map=item.getMap();
  if (item instanceof DataItemDesign) {
    if (((DataItemDesign)item).needRefreshMapping()) {
      DataItemHandle dataHandle=(DataItemHandle)item.getHandle();
      FactoryPropertyHandle fph=dataHandle.getFactoryPropertyHandle(StyleHandle.MAP_RULES_PROP);
      if (fph != null) {
        Object val=fph.getValue();
        if (val instanceof List && ((List)val).size() > 0) {
          String testExpr=org.eclipse.birt.core.data.ExpressionUtil.createJSDataExpression(dataHandle.getResultSetColumn());
          for (Iterator itr=((List)val).iterator(); itr.hasNext(); ) {
            MapRule mrh=(MapRule)itr.next();
            if (testExpr.equals(mrh.getTestExpression()) && DesignChoiceConstants.MAP_OPERATOR_NULL.equals(mrh.getOperator())) {
              Object value=null;
              IConditionalExpression newExpression=expressionUtil.createConditionalExpression(mrh.getTestExpression(),mrh.getOperator(),mrh.getValue1(),mrh.getValue2());
              value=evaluate(newExpression);
              if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
                dataObj.setLabelText(mrh.getDisplay());
                dataObj.setLabelKey(mrh.getDisplayKey());
              }
              break;
            }
          }
        }
      }
    }
  }
  if (map != null) {
    for (int i=0; i < map.getRuleCount(); i++) {
      MapRuleDesign rule=map.getRule(i);
      if (rule != null) {
        Object value=null;
        Object expression=rule.getConditionExpr();
        if (expression != null) {
          if (expression instanceof String) {
            value=evaluate((String)expression);
          }
 else {
            value=evaluate((IConditionalExpression)expression);
          }
        }
 else {
          IConditionalExpression newExpression=expressionUtil.createConditionalExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1(),rule.getValue2());
          value=evaluate(newExpression);
        }
        if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
          dataObj.setLabelText(rule.getDisplayText());
          dataObj.setLabelKey(rule.getDisplayKey());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * process the mapped rules.
 * @param item the design element used to create the data obj.
 * @param dataObj Data object.
 */
protected void processMappingValue(StyledElementDesign item,IDataContent dataObj){
  MapDesign map=item.getMap();
  if (item instanceof DataItemDesign) {
    if (((DataItemDesign)item).needRefreshMapping()) {
      DataItemHandle dataHandle=(DataItemHandle)item.getHandle();
      FactoryPropertyHandle fph=dataHandle.getFactoryPropertyHandle(StyleHandle.MAP_RULES_PROP);
      if (fph != null) {
        Object val=fph.getValue();
        if (val instanceof List && ((List)val).size() > 0) {
          String testExpr=org.eclipse.birt.core.data.ExpressionUtil.createJSDataExpression(dataHandle.getResultSetColumn());
          for (Iterator itr=((List)val).iterator(); itr.hasNext(); ) {
            MapRule mrh=(MapRule)itr.next();
            if (testExpr.equals(mrh.getTestExpression()) && DesignChoiceConstants.MAP_OPERATOR_NULL.equals(mrh.getOperator())) {
              Object value=null;
              IConditionalExpression newExpression=expressionUtil.createConditionalExpression(mrh.getTestExpression(),mrh.getOperator(),mrh.getValue1(),mrh.getValue2());
              value=evaluate(newExpression);
              if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
                dataObj.setLabelText(mrh.getDisplay());
                dataObj.setLabelKey(mrh.getDisplayKey());
              }
              break;
            }
          }
        }
      }
    }
  }
  if (map != null) {
    for (int i=0; i < map.getRuleCount(); i++) {
      MapRuleDesign rule=map.getRule(i);
      if (rule != null) {
        Object value=null;
        Object expression=rule.getConditionExpr();
        if (expression != null) {
          if (expression instanceof String) {
            value=evaluate((String)expression);
          }
 else {
            value=evaluate((IConditionalExpression)expression);
          }
        }
 else {
          IConditionalExpression newExpression=null;
          if (rule.ifValueIsList()) {
            newExpression=expressionUtil.createConditionExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1List());
          }
 else {
            newExpression=expressionUtil.createConditionalExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1(),rule.getValue2());
          }
          value=evaluate(newExpression);
        }
        if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
          dataObj.setLabelText(rule.getDisplayText());
          dataObj.setLabelKey(rule.getDisplayKey());
        }
      }
    }
  }
}