Program: 21361
Project: 21361
Buggy source:
/** 
 * Diese Methode erstellt einen neuen Captchadialog und liefert den eingegebenen Text zurück.
 * @param controller Der Controller
 * @param plugin Das Plugin, das dieses Captcha fordert
 * @param host der Host von dem die Methode verwendet werden soll
 * @param file
 * @return Der vom Benutzer eingegebene Text
 */
public static String getCaptcha(Plugin plugin,String method,File file,boolean forceJAC){
  String host;
  if (method == null) {
    host=plugin.getHost();
  }
 else {
    host=method;
  }
  logger.info("String_Node_Str" + host + "String_Node_Str"+ JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host));
  if (forceJAC || (JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host) && JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_JAC_METHODS + "String_Node_Str" + host,true) && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_CAPTCHA_INPUT_SHOWTIME,0) <= 0 && !configuration.getBooleanProperty(Configuration.PARAM_CAPTCHA_JAC_DISABLE,false))) {
    if (!JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host) || !JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_JAC_METHODS + "String_Node_Str" + host,true)) {
      return null;
    }
    JFrame jf=new JFrame();
    Image captchaImage=new JFrame().getToolkit().getImage(file.getAbsolutePath());
    MediaTracker mediaTracker=new MediaTracker(jf);
    mediaTracker.addImage(captchaImage,0);
    try {
      mediaTracker.waitForID(0);
    }
 catch (    InterruptedException e) {
      return null;
    }
    mediaTracker.removeImage(captchaImage);
    JAntiCaptcha jac=new JAntiCaptcha(getJACMethodsDirectory(),host);
    Captcha captcha=jac.createCaptcha(captchaImage);
    String captchaCode=jac.checkCaptcha(captcha);
    logger.info("String_Node_Str" + captchaCode);
    logger.info("String_Node_Str" + captcha.getValityPercent());
    plugin.setLastCaptcha(captcha);
    String code=null;
    plugin.setCaptchaDetectID(Plugin.CAPTCHA_JAC);
    LetterComperator[] lcs=captcha.getLetterComperators();
    double vp=0.0;
    for (int i=0; i < lcs.length; i++) {
      vp=Math.max(vp,lcs[i].getValityPercent());
    }
    logger.info("String_Node_Str" + vp);
    if (vp > 14.0) {
      plugin.setCaptchaDetectID(Plugin.CAPTCHA_USER_INPUT);
      code=getController().getCaptchaCodeFromUser(plugin,file,captchaCode);
    }
 else {
      return captchaCode;
    }
    if (code.equals(captchaCode))     return captchaCode;
    return code;
  }
 else {
    return getController().getCaptchaCodeFromUser(plugin,file,null);
  }
}

Fixed version (ground truth):
/** 
 * Diese Methode erstellt einen neuen Captchadialog und liefert den eingegebenen Text zurück.
 * @param controller Der Controller
 * @param plugin Das Plugin, das dieses Captcha fordert
 * @param host der Host von dem die Methode verwendet werden soll
 * @param file
 * @return Der vom Benutzer eingegebene Text
 */
public static String getCaptcha(Plugin plugin,String method,File file,boolean forceJAC){
  String host;
  if (method == null) {
    host=plugin.getHost();
  }
 else {
    host=method;
  }
  logger.info("String_Node_Str" + host + "String_Node_Str"+ JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host));
  if (forceJAC || (JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host) && JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_JAC_METHODS + "String_Node_Str" + host,true) && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_CAPTCHA_INPUT_SHOWTIME,0) <= 0 && !configuration.getBooleanProperty(Configuration.PARAM_CAPTCHA_JAC_DISABLE,false))) {
    if (!JAntiCaptcha.hasMethod(getJACMethodsDirectory(),host) || !JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_JAC_METHODS + "String_Node_Str" + host,true)) {
      return null;
    }
    JFrame jf=new JFrame();
    Image captchaImage=new JFrame().getToolkit().getImage(file.getAbsolutePath());
    MediaTracker mediaTracker=new MediaTracker(jf);
    mediaTracker.addImage(captchaImage,0);
    try {
      mediaTracker.waitForID(0);
    }
 catch (    InterruptedException e) {
      return null;
    }
    mediaTracker.removeImage(captchaImage);
    JAntiCaptcha jac=new JAntiCaptcha(getJACMethodsDirectory(),host);
    Captcha captcha=jac.createCaptcha(captchaImage);
    String captchaCode=jac.checkCaptcha(captcha);
    logger.info("String_Node_Str" + captchaCode);
    logger.info("String_Node_Str" + captcha.getValityPercent());
    plugin.setLastCaptcha(captcha);
    String code=null;
    plugin.setCaptchaDetectID(Plugin.CAPTCHA_JAC);
    LetterComperator[] lcs=captcha.getLetterComperators();
    if (lcs == null)     return null;
    double vp=0.0;
    for (int i=0; i < lcs.length; i++) {
      vp=Math.max(vp,lcs[i].getValityPercent());
    }
    logger.info("String_Node_Str" + vp);
    if (vp > 14.0) {
      plugin.setCaptchaDetectID(Plugin.CAPTCHA_USER_INPUT);
      code=getController().getCaptchaCodeFromUser(plugin,file,captchaCode);
    }
 else {
      return captchaCode;
    }
    if (code.equals(captchaCode))     return captchaCode;
    return code;
  }
 else {
    return getController().getCaptchaCodeFromUser(plugin,file,null);
  }
}