Program: 58558
Project: 58558
Buggy source:
/** 
 * Method to generate Dashboard (meta schema) from View Builder.
 * @param viewBuilder ViewBuilder of type dashboard.
 * @return Dashboard.
 */
public MetaView build(DashboardBuilder dashboardBuilder){
  log.debug("String_Node_Str",dashboardBuilder.getName());
  Dashboard dashboard=new Dashboard();
  String boardName=dashboardBuilder.getName();
  dashboard.setTitle(dashboardBuilder.getTitle());
  dashboard.setName(dashboardBuilder.getName());
  List<AbstractWidget> dashlets=new ArrayList<AbstractWidget>();
  dashboardBuilder.clearGeneratedActions();
  for (  DashletBuilder dashletBuilder : dashboardBuilder.getDashletBuilderList()) {
    Dashlet dashlet=new Dashlet();
    String name=null;
    String model=null;
    MetaView metaView=dashletBuilder.getMetaView();
    MetaAction action=dashletBuilder.getAction();
    String actionName=null;
    if (metaView != null) {
      name=metaView.getName();
      model=metaView.getModel();
      MetaAction metaAction=getAction(boardName,name,model,dashletBuilder);
      actionName=metaAction.getName();
      dashboardBuilder.addGeneratedAction(metaAction);
    }
 else     if (action != null) {
      model=action.getModel();
      actionName=action.getName();
    }
    dashlet.setAction(actionName);
    dashlet.setHeight("String_Node_Str");
    Integer colSpan=dashletBuilder.getColspan();
    if (colSpan > 12) {
      colSpan=12;
    }
 else     if (colSpan <= 0) {
      colSpan=6;
    }
    dashlet.setColSpan(colSpan);
    dashlets.add(dashlet);
  }
  if (dashlets.isEmpty()) {
    return null;
  }
  dashboard.setItems(dashlets);
  MetaStore.clear();
  return metaService.generateMetaView(dashboard);
}

Fixed version (ground truth):
/** 
 * Method to generate Dashboard (meta schema) from View Builder.
 * @param viewBuilder ViewBuilder of type dashboard.
 * @return Dashboard.
 */
public MetaView build(DashboardBuilder dashboardBuilder){
  log.debug("String_Node_Str",dashboardBuilder.getName());
  if (dashboardBuilder.getDashletBuilderList() == null || dashboardBuilder.getDashletBuilderList().isEmpty()) {
    return null;
  }
  Dashboard dashboard=new Dashboard();
  String boardName=dashboardBuilder.getName();
  dashboard.setTitle(dashboardBuilder.getTitle());
  dashboard.setName(dashboardBuilder.getName());
  List<AbstractWidget> dashlets=new ArrayList<AbstractWidget>();
  dashboardBuilder.clearGeneratedActions();
  for (  DashletBuilder dashletBuilder : dashboardBuilder.getDashletBuilderList()) {
    Dashlet dashlet=new Dashlet();
    String name=null;
    String model=null;
    MetaView metaView=dashletBuilder.getMetaView();
    MetaAction action=dashletBuilder.getAction();
    String actionName=null;
    if (metaView != null) {
      name=metaView.getName();
      model=metaView.getModel();
      MetaAction metaAction=getAction(boardName,name,model,dashletBuilder);
      actionName=metaAction.getName();
      dashboardBuilder.addGeneratedAction(metaAction);
    }
 else     if (action != null) {
      model=action.getModel();
      actionName=action.getName();
    }
    dashlet.setAction(actionName);
    dashlet.setHeight("String_Node_Str");
    Integer colSpan=dashletBuilder.getColspan();
    if (colSpan > 12) {
      colSpan=12;
    }
 else     if (colSpan <= 0) {
      colSpan=6;
    }
    dashlet.setColSpan(colSpan);
    dashlets.add(dashlet);
  }
  if (dashlets.isEmpty()) {
    return null;
  }
  dashboard.setItems(dashlets);
  MetaStore.clear();
  return metaService.generateMetaView(dashboard);
}