Program: 57327
Project: 57327
Buggy source:
private void calculatePathwayScaling(final GL2 gl,final PathwayGraph pathway){
  if (hashGLcontext2TextureManager.get(gl) == null)   return;
  int pathwayPixelWidth=pathway.getWidth();
  int pathwayPixelHeight=pathway.getHeight();
  if (pathwayPixelWidth == -1 || pathwayPixelHeight == -1) {
    Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str"));
  }
  float pathwayWidth=pixelGLConverter.getGLWidthForPixelWidth(pathwayPixelWidth);
  float pathwayHeight=pixelGLConverter.getGLHeightForPixelHeight(pathwayPixelHeight);
  float viewFrustumWidth=viewFrustum.getRight() - viewFrustum.getLeft();
  float viewFrustumHeight=viewFrustum.getTop() - viewFrustum.getBottom();
  float pathwayAspectRatio=pathwayWidth / pathwayHeight;
  float viewFrustumAspectRatio=viewFrustumWidth / viewFrustumHeight;
  boolean pathwayFitsViewFrustum=true;
  if (isRenderedRemote()) {
    if (viewFrustumAspectRatio < pathwayAspectRatio && pathwayWidth > viewFrustumWidth) {
      vecScaling.setX((viewFrustum.getRight() - viewFrustum.getLeft()) / pathwayWidth);
      vecScaling.setY(vecScaling.x());
      vecTranslation.set((viewFrustum.getRight() - viewFrustum.getLeft() - pathwayWidth * vecScaling.x()) / 2.0f,(viewFrustum.getTop() - viewFrustum.getBottom() - pathwayHeight * vecScaling.y()) / 2.0f,0);
      pathwayFitsViewFrustum=false;
    }
    if (viewFrustumAspectRatio >= pathwayAspectRatio && pathwayHeight > viewFrustumHeight) {
      vecScaling.setY((viewFrustum.getTop() - viewFrustum.getBottom()) / pathwayHeight);
      vecScaling.setX(vecScaling.y());
      vecTranslation.set((viewFrustum.getRight() - viewFrustum.getLeft() - pathwayWidth * vecScaling.x()) / 2.0f,(viewFrustum.getTop() - viewFrustum.getBottom() - pathwayHeight * vecScaling.y()) / 2.0f,0);
      pathwayFitsViewFrustum=false;
    }
    if (pathwayFitsViewFrustum) {
      vecScaling.set(1,1,1f);
      vecTranslation.set((viewFrustum.getRight() - viewFrustum.getLeft()) / 2.0f - pathwayWidth / 2.0f,(viewFrustum.getTop() - viewFrustum.getBottom()) / 2.0f - pathwayHeight / 2.0f,0);
    }
  }
  if (pathwayWidth < viewFrustumWidth) {
    vecTranslation.setX((viewFrustumWidth - pathwayWidth) / 2.0f);
  }
  if (pathwayHeight < viewFrustumWidth) {
    vecTranslation.setY((viewFrustumHeight - pathwayHeight) / 2.0f);
  }
}

Fixed version (ground truth):
private void calculatePathwayScaling(final GL2 gl,final PathwayGraph pathway){
  if (hashGLcontext2TextureManager.get(gl) == null)   return;
  int pathwayPixelWidth=pathway.getWidth();
  int pathwayPixelHeight=pathway.getHeight();
  if (pathwayPixelWidth == -1 || pathwayPixelHeight == -1) {
    Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str"));
  }
  float pathwayWidth=pixelGLConverter.getGLWidthForPixelWidth(pathwayPixelWidth);
  float pathwayHeight=pixelGLConverter.getGLHeightForPixelHeight(pathwayPixelHeight);
  float viewFrustumWidth=viewFrustum.getRight() - viewFrustum.getLeft();
  float viewFrustumHeight=viewFrustum.getTop() - viewFrustum.getBottom();
  float pathwayAspectRatio=pathwayWidth / pathwayHeight;
  float viewFrustumAspectRatio=viewFrustumWidth / viewFrustumHeight;
  if (isRenderedRemote()) {
    float renderWidth;
    float renderHeight;
    if (pathwayWidth <= viewFrustumWidth && pathwayHeight <= viewFrustumHeight) {
      vecScaling.set(1,1,1f);
      renderWidth=pathwayWidth;
      renderHeight=pathwayHeight;
    }
 else {
      if (viewFrustumAspectRatio > pathwayAspectRatio) {
        renderWidth=(viewFrustumHeight / pathwayHeight) * pathwayWidth;
        renderHeight=viewFrustumHeight;
      }
 else {
        renderWidth=viewFrustumWidth;
        renderHeight=(viewFrustumWidth / pathwayWidth) * pathwayHeight;
      }
      vecScaling.set(renderWidth / pathwayWidth,renderHeight / pathwayHeight,1);
    }
    vecTranslation.set((viewFrustumWidth - renderWidth) / 2.0f,(viewFrustumHeight - renderHeight) / 2.0f,0);
    return;
  }
  if (pathwayWidth < viewFrustumWidth) {
    vecTranslation.setX((viewFrustumWidth - pathwayWidth) / 2.0f);
  }
  if (pathwayHeight < viewFrustumWidth) {
    vecTranslation.setY((viewFrustumHeight - pathwayHeight) / 2.0f);
  }
}