Program: 68728
Project: 68728
Buggy source:
private static void setupHighlightStyle(ReportElementHandle handle,Iterator<HighlightRuleHandle> highlightRules,IStyle style,IBaseResultSet evaluator) throws BirtException {
  DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
  try {
    IModelAdapter modelAdapter=session.getModelAdaptor();
    while (highlightRules.hasNext()) {
      HighlightRuleHandle rule=highlightRules.next();
      ConditionalExpression condExpr=null;
      if (ModuleUtil.isListStyleRuleValue(rule)) {
        condExpr=new ConditionalExpression(modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(HighlightRule.TEST_EXPR_MEMBER).getValue()),DataAdapterUtil.adaptModelFilterOperator(rule.getOperator()),rule.getValue1ExpressionList().getListValue());
      }
 else {
        Expression value1=null;
        List<Expression> val1list=rule.getValue1ExpressionList().getListValue();
        if (val1list != null && val1list.size() > 0) {
          value1=val1list.get(0);
        }
        condExpr=new ConditionalExpression(modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(HighlightRule.TEST_EXPR_MEMBER).getValue()),DataAdapterUtil.adaptModelFilterOperator(rule.getOperator()),modelAdapter.adaptExpression(value1),modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(StyleRule.VALUE2_MEMBER).getValue()));
      }
      IConditionalExpression expression=ExpressionUtil.transformConditionalExpression(condExpr);
      Object value=evaluator.evaluate(expression);
      if (value instanceof Boolean && ((Boolean)value).booleanValue()) {
        setupRuleStyle(rule,style);
      }
    }
  }
  finally {
    session.shutdown();
  }
}

Fixed version (ground truth):
private static void setupHighlightStyle(ReportElementHandle handle,Iterator<HighlightRuleHandle> highlightRules,IStyle style,IBaseResultSet evaluator) throws BirtException {
  DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
  try {
    IModelAdapter modelAdapter=session.getModelAdaptor();
    while (highlightRules.hasNext()) {
      HighlightRuleHandle rule=highlightRules.next();
      ConditionalExpression condExpr=null;
      if (ModuleUtil.isListStyleRuleValue(rule)) {
        condExpr=new ConditionalExpression(modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(HighlightRule.TEST_EXPR_MEMBER).getValue(),ExpressionLocation.CUBE),DataAdapterUtil.adaptModelFilterOperator(rule.getOperator()),rule.getValue1ExpressionList().getListValue());
      }
 else {
        Expression value1=null;
        List<Expression> val1list=rule.getValue1ExpressionList().getListValue();
        if (val1list != null && val1list.size() > 0) {
          value1=val1list.get(0);
        }
        condExpr=new ConditionalExpression(modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(HighlightRule.TEST_EXPR_MEMBER).getValue(),ExpressionLocation.CUBE),DataAdapterUtil.adaptModelFilterOperator(rule.getOperator()),modelAdapter.adaptExpression(value1,ExpressionLocation.CUBE),modelAdapter.adaptExpression((Expression)rule.getExpressionProperty(StyleRule.VALUE2_MEMBER).getValue(),ExpressionLocation.CUBE));
      }
      IConditionalExpression expression=ExpressionUtil.transformConditionalExpression(condExpr);
      Object value=evaluator.evaluate(expression);
      if (value instanceof Boolean && ((Boolean)value).booleanValue()) {
        setupRuleStyle(rule,style);
      }
    }
  }
  finally {
    session.shutdown();
  }
}