Program: 143631
Project: 143631
Buggy source:
private void setUpComponent(Component comp,IRecordInternal record,Object compColor,Object fgColor,Object compFont,Object compBorder,int visibleRowIndex){
  if (tabIndex < 0) {
    TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex);
  }
 else {
    if (elementTabIndexes.size() > 0) {
      Integer idx=elementTabIndexes.get(cellToElement.get(comp));
      if (idx == null) {
        TabIndexHelper.setUpTabIndexAttributeModifier(comp,ISupportWebTabSeq.SKIP);
      }
 else {
        TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex + 1 + visibleRowIndex * elementTabIndexes.size() + idx.intValue());
      }
    }
 else {
      TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex + 1);
    }
  }
  if (compColor != null) {
    MarkupContainer cellContainer=comp.getParent();
    String compColorStr=compColor.toString();
    if (cellContainer instanceof CellContainer) {
      cellContainer.add(new StyleAppendingModifier(new Model<String>("String_Node_Str" + compColorStr)));
    }
  }
  WebCellBasedView.this.applyStyleOnComponent(comp,compColor,fgColor,compFont,compBorder);
  if (scriptable.isReadOnly() && validationEnabled && comp instanceof IScriptableProvider&& ((IScriptableProvider)comp).getScriptObject() instanceof HasRuntimeReadOnly) {
    ((HasRuntimeReadOnly)((IScriptableProvider)comp).getScriptObject()).setReadOnly(true);
  }
  List<Component> readOnlyComponents=((WebForm)fc.getFormUI()).getReadOnlyComponents();
  if (readOnlyComponents.indexOf(WebCellBasedView.this) != -1 && readOnlyComponents.indexOf(comp) == -1)   readOnlyComponents.add(comp);
  if (!isEnabled() && comp instanceof IComponent) {
    ((IComponent)comp).setComponentEnabled(false);
  }
  if (comp instanceof IDisplayRelatedData && record != null) {
    ((IDisplayRelatedData)comp).setRecord(record,true);
  }
  MarkupContainer parent=comp.getParent();
  if (parent instanceof CellContainer) {
    parent.setVisible(comp.isVisible());
  }
  if (compBorder != null) {
    IPersist elem=WebCellBasedView.this.cellToElement.get(comp);
    Object colId=WebCellBasedView.this.elementToColumnIdentifierComponent.get(elem);
    final int idx=WebCellBasedView.this.visibleColummIdentifierComponents.indexOf(colId);
    final int[] borderWidth=new int[]{0,0};
    Border cb=ComponentFactoryHelper.createBorder((String)compBorder);
    if (cb != null) {
      int defaultLeftPadding;
      int defaultRightPadding;
switch (elem.getTypeID()) {
case IRepository.FIELDS:
        Insets fieldMargin=null;
      if (comp instanceof IFieldComponent) {
        fieldMargin=((IFieldComponent)comp).getMargin();
      }
    defaultLeftPadding=fieldMargin != null ? fieldMargin.left : TemplateGenerator.DEFAULT_FIELD_PADDING.left;
  defaultRightPadding=fieldMargin != null ? fieldMargin.right : TemplateGenerator.DEFAULT_FIELD_PADDING.right;
break;
case IRepository.GRAPHICALCOMPONENTS:
Insets gcMargin=null;
if (elem instanceof GraphicalComponent) {
gcMargin=((GraphicalComponent)elem).getMargin();
}
defaultLeftPadding=gcMargin != null ? gcMargin.left : TemplateGenerator.DEFAULT_LABEL_PADDING.left;
defaultRightPadding=gcMargin != null ? gcMargin.right : TemplateGenerator.DEFAULT_LABEL_PADDING.right;
break;
default :
defaultLeftPadding=0;
defaultRightPadding=0;
}
Insets borderInsets=cb.getBorderInsets(null);
borderWidth[0]=borderInsets.left + defaultLeftPadding;
borderWidth[1]=borderInsets.right + defaultRightPadding;
}
comp.add(new StyleAppendingModifier(new Model<String>(){
@Override public String getObject(){
StringBuilder style=new StringBuilder();
if (idx > 0) {
style.append("String_Node_Str").append(borderWidth[0]).append("String_Node_Str");
}
if (idx < WebCellBasedView.this.visibleColummIdentifierComponents.size() - 1) {
style.append("String_Node_Str").append(borderWidth[1]).append("String_Node_Str");
}
return style.toString();
}
}
));
}
}

Fixed version (ground truth):
private void setUpComponent(Component comp,IRecordInternal record,Object compColor,Object fgColor,Object compFont,Object compBorder,int visibleRowIndex){
  if (tabIndex < 0) {
    TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex);
  }
 else {
    if (elementTabIndexes.size() > 0) {
      Integer idx=elementTabIndexes.get(cellToElement.get(comp));
      if (idx == null) {
        TabIndexHelper.setUpTabIndexAttributeModifier(comp,ISupportWebTabSeq.SKIP);
      }
 else {
        TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex + 1 + visibleRowIndex * elementTabIndexes.size() + idx.intValue());
      }
    }
 else {
      TabIndexHelper.setUpTabIndexAttributeModifier(comp,tabIndex + 1);
    }
  }
  if (compColor != null) {
    MarkupContainer cellContainer=comp.getParent();
    String compColorStr=compColor.toString();
    if (cellContainer instanceof CellContainer) {
      cellContainer.add(new StyleAppendingModifier(new Model<String>("String_Node_Str" + compColorStr)));
    }
  }
  WebCellBasedView.this.applyStyleOnComponent(comp,compColor,fgColor,compFont,compBorder);
  if (scriptable.isReadOnly() && validationEnabled && comp instanceof IScriptableProvider&& ((IScriptableProvider)comp).getScriptObject() instanceof HasRuntimeReadOnly) {
    ((HasRuntimeReadOnly)((IScriptableProvider)comp).getScriptObject()).setReadOnly(true);
  }
  List<Component> readOnlyComponents=((WebForm)fc.getFormUI()).getReadOnlyComponents();
  if (readOnlyComponents.indexOf(WebCellBasedView.this) != -1 && readOnlyComponents.indexOf(comp) == -1)   readOnlyComponents.add(comp);
  if (!isEnabled() && comp instanceof IComponent) {
    ((IComponent)comp).setComponentEnabled(false);
  }
  if (comp instanceof IDisplayRelatedData && record != null) {
    ((IDisplayRelatedData)comp).setRecord(record,true);
  }
  MarkupContainer parent=comp.getParent();
  if (parent instanceof CellContainer) {
    parent.setVisible(comp.isVisible());
  }
  if (compBorder != null) {
    IPersist elem=WebCellBasedView.this.cellToElement.get(comp);
    Object colId=WebCellBasedView.this.elementToColumnIdentifierComponent.get(elem);
    final int idx=WebCellBasedView.this.visibleColummIdentifierComponents.indexOf(colId);
    final int[] borderWidth=new int[]{0,0};
    Border cb=ComponentFactoryHelper.createBorder((String)compBorder);
    if (cb != null) {
      int defaultLeftPadding;
      int defaultRightPadding;
switch (elem.getTypeID()) {
case IRepository.FIELDS:
        Insets fieldMargin=null;
      if (comp instanceof IFieldComponent) {
        fieldMargin=((IFieldComponent)comp).getMargin();
      }
    defaultLeftPadding=fieldMargin != null ? fieldMargin.left : TemplateGenerator.DEFAULT_FIELD_PADDING.left;
  defaultRightPadding=fieldMargin != null ? fieldMargin.right : TemplateGenerator.DEFAULT_FIELD_PADDING.right;
break;
case IRepository.GRAPHICALCOMPONENTS:
Insets gcMargin=null;
if (elem instanceof GraphicalComponent) {
gcMargin=((GraphicalComponent)elem).getMargin();
}
defaultLeftPadding=gcMargin != null ? gcMargin.left : TemplateGenerator.DEFAULT_LABEL_PADDING.left;
defaultRightPadding=gcMargin != null ? gcMargin.right : TemplateGenerator.DEFAULT_LABEL_PADDING.right;
break;
default :
defaultLeftPadding=0;
defaultRightPadding=0;
}
Insets borderInsets=ComponentFactoryHelper.getBorderInsetsForNoComponent(cb);
borderWidth[0]=borderInsets.left + defaultLeftPadding;
borderWidth[1]=borderInsets.right + defaultRightPadding;
}
comp.add(new StyleAppendingModifier(new Model<String>(){
@Override public String getObject(){
StringBuilder style=new StringBuilder();
if (idx > 0) {
style.append("String_Node_Str").append(borderWidth[0]).append("String_Node_Str");
}
if (idx < WebCellBasedView.this.visibleColummIdentifierComponents.size() - 1) {
style.append("String_Node_Str").append(borderWidth[1]).append("String_Node_Str");
}
return style.toString();
}
}
));
}
}