Program: 163649
Project: 163649
Buggy source:
/** 
 * Allows to set custom blend modes for the entire scene, using openGL. Reference article about blending modes: http://www.pegtop.net/delphi/articles/blendmodes/ HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE, BURN modes cannot be implemented in fixed-function pipeline because they require conditional blending and non-linear blending equations.
 */
@Override public void blendMode(int mode){
  if (blendMode != mode) {
    flush();
    blendMode=mode;
    pgl.enable(PGL.BLEND);
    if (mode == REPLACE) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.ONE,PGL.ZERO);
    }
 else     if (mode == BLEND) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.SRC_ALPHA,PGL.ONE_MINUS_SRC_ALPHA);
    }
 else     if (mode == ADD) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.SRC_ALPHA,PGL.ONE);
    }
 else     if (mode == SUBTRACT) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR,PGL.ZERO);
    }
 else     if (mode == LIGHTEST) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_MAX);
        pgl.blendFunc(PGL.SRC_ALPHA,PGL.DST_ALPHA);
      }
 else {
        PGraphics.showWarning(BLEND_DRIVER_ERROR,"String_Node_Str");
      }
    }
 else     if (mode == DARKEST) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_MIN);
        pgl.blendFunc(PGL.SRC_ALPHA,PGL.DST_ALPHA);
      }
 else {
        PGraphics.showWarning(BLEND_DRIVER_ERROR,"String_Node_Str");
      }
    }
 else     if (mode == DIFFERENCE) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_REVERSE_SUBTRACT);
        pgl.blendFunc(PGL.ONE,PGL.ONE);
      }
 else {
        PGraphics.showWarning(BLEND_DRIVER_ERROR,"String_Node_Str");
      }
    }
 else     if (mode == EXCLUSION) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR,PGL.ONE_MINUS_SRC_COLOR);
    }
 else     if (mode == MULTIPLY) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.DST_COLOR,PGL.SRC_COLOR);
    }
 else     if (mode == SCREEN) {
      if (blendEqSupported) {
        pgl.blendEquation(PGL.FUNC_ADD);
      }
      pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR,PGL.ONE);
    }
 else     if (mode == OVERLAY) {
      PGraphics.showWarning(BLEND_RENDERER_ERROR,"String_Node_Str");
    }
 else     if (mode == HARD_LIGHT) {
      PGraphics.showWarning(BLEND_RENDERER_ERROR,"String_Node_Str");
    }
 else     if (mode == SOFT_LIGHT) {
      PGraphics.showWarning(BLEND_RENDERER_ERROR,"String_Node_Str");
    }
 else     if (mode == DODGE) {
      PGraphics.showWarning(BLEND_RENDERER_ERROR,"String_Node_Str");
    }
 else     if (mode == BURN) {
      PGraphics.showWarning(BLEND_RENDERER_ERROR,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Allows to set custom blend modes for the entire scene, using openGL. Reference article about blending modes: http://www.pegtop.net/delphi/articles/blendmodes/ HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE, BURN modes cannot be implemented in fixed-function pipeline because they require conditional blending and non-linear blending equations.
 */
@Override public void blendMode(int mode){
  if (blendMode != mode) {
    flush();
    setBlendMode(mode);
  }
}