Program: 57796
Project: 57796
Buggy source:
/** 
 * Init the layout for the center region, showing the horizontal bar of the arch plus all sub-bricks above and below
 */
private void initCenterLayout(){
  archSideThickness=viewFrustum.getWidth() * ARCH_STAND_WIDTH_PERCENT;
  if (isLeftDetailShown || isRightDetailShown) {
    archInnerWidth=0;
  }
 else {
    archInnerWidth=viewFrustum.getWidth() * (ARCH_STAND_WIDTH_PERCENT + 0.024f);
  }
  archHeight=pixelGLConverter.getGLHeightForPixelHeight(ARCH_PIXEL_HEIGHT);
  archBottomY=viewFrustum.getHeight() * ARCH_BOTTOM_PERCENT - archHeight / 2f;
  archTopY=archBottomY + archHeight;
  int dimensionGroupCountInCenter=dimensionGroupManager.getRightGroupStartIndex() - dimensionGroupManager.getCenterGroupStartIndex();
  float centerLayoutWidth=viewFrustum.getWidth() - 2 * (archInnerWidth);
  centerRowLayout=new Row("String_Node_Str");
  centerRowLayout.setPriorityRendereing(true);
  centerRowLayout.setFrameColor(1,1,0,1);
  leftDimensionGroupSpacing=new ElementLayout("String_Node_Str");
  DimensionGroupSpacingRenderer dimensionGroupSpacingRenderer=null;
  if (dimensionGroupCountInCenter < 1) {
    dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,null,null,this);
  }
 else {
    dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,null,dimensionGroupManager.getDimensionGroups().get(dimensionGroupManager.getCenterGroupStartIndex()),this);
  }
  leftDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
  dimensionGroupSpacingRenderer.setLineLength(archHeight);
  if (dimensionGroupCountInCenter > 1)   leftDimensionGroupSpacing.setPixelSizeX(DIMENSION_GROUP_SIDE_SPACING);
 else   leftDimensionGroupSpacing.setGrabX(true);
  centerRowLayout.append(leftDimensionGroupSpacing);
  for (int dimensionGroupIndex=dimensionGroupManager.getCenterGroupStartIndex(); dimensionGroupIndex < dimensionGroupManager.getRightGroupStartIndex(); dimensionGroupIndex++) {
    ElementLayout dynamicDimensionGroupSpacing;
    DimensionGroup group=dimensionGroupManager.getDimensionGroups().get(dimensionGroupIndex);
    group.setCollapsed(false);
    group.setArchHeight(ARCH_PIXEL_HEIGHT);
    centerRowLayout.append(group.getLayout());
    if (dimensionGroupIndex != dimensionGroupManager.getRightGroupStartIndex() - 1) {
      dynamicDimensionGroupSpacing=new ElementLayout("String_Node_Str");
      dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(relationAnalyzer,connectionRenderer,group,dimensionGroupManager.getDimensionGroups().get(dimensionGroupIndex + 1),this);
      dynamicDimensionGroupSpacing.setGrabX(true);
      dynamicDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
      centerRowLayout.append(dynamicDimensionGroupSpacing);
    }
 else {
      rightDimensionGroupSpacing=new ElementLayout("String_Node_Str");
      dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,group,null,this);
      if (dimensionGroupCountInCenter > 1)       rightDimensionGroupSpacing.setPixelSizeX(DIMENSION_GROUP_SIDE_SPACING);
 else       rightDimensionGroupSpacing.setGrabX(true);
      rightDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
      centerRowLayout.append(rightDimensionGroupSpacing);
    }
    dimensionGroupSpacingRenderer.setLineLength(archHeight);
  }
  ViewFrustum centerArchFrustum=new ViewFrustum(viewFrustum.getProjectionMode(),0,centerLayoutWidth,0,viewFrustum.getHeight(),0,1);
  centerLayoutManager=new LayoutManager(centerArchFrustum,pixelGLConverter);
  centerLayoutManager.setBaseElementLayout(centerRowLayout);
  centerLayoutManager.updateLayout();
}

Fixed version (ground truth):
/** 
 * Init the layout for the center region, showing the horizontal bar of the arch plus all sub-bricks above and below
 */
private void initCenterLayout(){
  archSideThickness=viewFrustum.getWidth() * ARCH_STAND_WIDTH_PERCENT;
  if (isLeftDetailShown || isRightDetailShown) {
    archInnerWidth=0;
  }
 else {
    archInnerWidth=viewFrustum.getWidth() * (ARCH_STAND_WIDTH_PERCENT + 0.024f);
  }
  archHeight=pixelGLConverter.getGLHeightForPixelHeight(ARCH_PIXEL_HEIGHT);
  archBottomY=viewFrustum.getHeight() * ARCH_BOTTOM_PERCENT - archHeight / 2f;
  archTopY=archBottomY + archHeight;
  int dimensionGroupCountInCenter=dimensionGroupManager.getRightGroupStartIndex() - dimensionGroupManager.getCenterGroupStartIndex();
  float centerLayoutWidth=viewFrustum.getWidth() - 2 * (archInnerWidth);
  centerRowLayout=new Row("String_Node_Str");
  centerRowLayout.setDebug(true);
  centerRowLayout.setPriorityRendereing(true);
  centerRowLayout.setFrameColor(1,1,0,1);
  leftDimensionGroupSpacing=new ElementLayout("String_Node_Str");
  DimensionGroupSpacingRenderer dimensionGroupSpacingRenderer=null;
  if (dimensionGroupCountInCenter < 1) {
    dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,null,null,this);
  }
 else {
    dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,null,dimensionGroupManager.getDimensionGroups().get(dimensionGroupManager.getCenterGroupStartIndex()),this);
  }
  leftDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
  dimensionGroupSpacingRenderer.setLineLength(archHeight);
  if (dimensionGroupCountInCenter > 1)   leftDimensionGroupSpacing.setPixelSizeX(DIMENSION_GROUP_SIDE_SPACING);
 else   leftDimensionGroupSpacing.setGrabX(true);
  centerRowLayout.append(leftDimensionGroupSpacing);
  for (int dimensionGroupIndex=dimensionGroupManager.getCenterGroupStartIndex(); dimensionGroupIndex < dimensionGroupManager.getRightGroupStartIndex(); dimensionGroupIndex++) {
    ElementLayout dynamicDimensionGroupSpacing;
    DimensionGroup group=dimensionGroupManager.getDimensionGroups().get(dimensionGroupIndex);
    group.setCollapsed(false);
    group.setArchHeight(ARCH_PIXEL_HEIGHT);
    centerRowLayout.append(group.getLayout());
    if (dimensionGroupIndex != dimensionGroupManager.getRightGroupStartIndex() - 1) {
      dynamicDimensionGroupSpacing=new ElementLayout("String_Node_Str");
      dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(relationAnalyzer,connectionRenderer,group,dimensionGroupManager.getDimensionGroups().get(dimensionGroupIndex + 1),this);
      dynamicDimensionGroupSpacing.setGrabX(true);
      dynamicDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
      centerRowLayout.append(dynamicDimensionGroupSpacing);
    }
 else {
      rightDimensionGroupSpacing=new ElementLayout("String_Node_Str");
      dimensionGroupSpacingRenderer=new DimensionGroupSpacingRenderer(null,connectionRenderer,group,null,this);
      if (dimensionGroupCountInCenter > 1)       rightDimensionGroupSpacing.setPixelSizeX(DIMENSION_GROUP_SIDE_SPACING);
 else       rightDimensionGroupSpacing.setGrabX(true);
      rightDimensionGroupSpacing.setRenderer(dimensionGroupSpacingRenderer);
      centerRowLayout.append(rightDimensionGroupSpacing);
    }
    dimensionGroupSpacingRenderer.setLineLength(archHeight);
  }
  ViewFrustum centerArchFrustum=new ViewFrustum(viewFrustum.getProjectionMode(),0,centerLayoutWidth,0,viewFrustum.getHeight(),0,1);
  centerLayoutManager=new LayoutManager(centerArchFrustum,pixelGLConverter);
  centerLayoutManager.setBaseElementLayout(centerRowLayout);
  centerLayoutManager.updateLayout();
}