Program: 21349
Project: 21349
Buggy source:
/** 
 * Erstellt einen neuen Dialog.
 * @param owner Das übergeordnete Fenster
 * @param plugin Das Plugin, das dieses Captcha auslesen möchte (name des Hosts wird von JAC benötigt)
 * @param file Pfad des Bildes, das angezeigt werden soll
 */
public CaptchaDialog(final Frame owner,final Plugin plugin,final File file,final String def){
  super(owner);
  JDSounds.PT("String_Node_Str");
  setModal(true);
  addWindowListener(new WindowListener(){
    public void windowActivated(    WindowEvent e){
    }
    public void windowClosed(    WindowEvent e){
    }
    public void windowClosing(    WindowEvent e){
      dispose();
      CaptchaDialog cd=new CaptchaDialog(owner,plugin,file,def);
      cd.countdown=countdown;
      cd.setVisible(true);
      captchaText=cd.getCaptchaText();
    }
    public void windowDeactivated(    WindowEvent e){
    }
    public void windowDeiconified(    WindowEvent e){
    }
    public void windowIconified(    WindowEvent e){
    }
    public void windowOpened(    WindowEvent e){
    }
  }
);
  setLayout(new GridBagLayout());
  ImageIcon imageIcon=null;
  String code="String_Node_Str";
  final Configuration configuration=JDUtilities.getConfiguration();
  imageIcon=new ImageIcon(file.getAbsolutePath());
  if (plugin != null && plugin.getCaptchaDetectionID() != Plugin.CAPTCHA_USER_INPUT && !configuration.getBooleanProperty(Configuration.PARAM_CAPTCHA_JAC_DISABLE,false) && JAntiCaptcha.hasMethod(JDUtilities.getJACMethodsDirectory(),plugin.getHost())) {
    setTitle(JDLocale.L("String_Node_Str","String_Node_Str"));
    final String host=plugin.getHost();
    this.jacThread=new Thread("String_Node_Str"){
      public void run(){
        String code=JDUtilities.getCaptcha(plugin,host,file,true);
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
        if (textField.getText().length() == 0 || code.toLowerCase().startsWith(textField.getText().toLowerCase())) {
          textField.setText(code);
          if (isVisible() && textField.getText().equalsIgnoreCase(code) && textField.getText().length() > 0) {
            captchaText=textField.getText();
            dispose();
          }
        }
 else {
          textField.setText(JDLocale.L("String_Node_Str","String_Node_Str"));
          setTitle(JDLocale.L("String_Node_Str","String_Node_Str"));
        }
      }
    }
;
    this.jacThread.start();
  }
 else {
    this.countdownThread=new Thread(){
      public void run(){
        int c=countdown * 1000;
        long t=System.currentTimeMillis();
        while (c >= 0) {
          if (!isVisible())           return;
          t=System.currentTimeMillis();
          setTitle("String_Node_Str" + JDUtilities.formatSeconds(c / 1000));
          if (c < 3000)           JDSounds.P("String_Node_Str");
          long dif=System.currentTimeMillis() - t;
          c-=dif;
          try {
            if (dif < 1000)             Thread.sleep(1000 - dif);
            c-=(1000 - dif);
          }
 catch (          InterruptedException e) {
          }
        }
        captchaText=textField.getText();
        dispose();
      }
    }
;
    this.countdownThread.start();
  }
  JLabel label=new JLabel(imageIcon);
  textField=new JTextField(10);
  if (def != null)   code=def;
  btnOK=new JButton(JDLocale.L("String_Node_Str","String_Node_Str"));
  btnBAD=new JButton(JDLocale.L("String_Node_Str","String_Node_Str"));
  textField.setText(code);
  textField.selectAll();
  btnOK.addActionListener(this);
  btnBAD.addActionListener(this);
  getRootPane().setDefaultButton(btnOK);
  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
  JDUtilities.addToGridBag(this,label,0,0,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
  JDUtilities.addToGridBag(this,textField,0,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.EAST);
  JDUtilities.addToGridBag(this,btnOK,1,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.WEST);
  JDUtilities.addToGridBag(this,btnBAD,2,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.WEST);
  if (plugin != null && plugin.getLastCaptcha() != null && plugin.getLastCaptcha().getLetterComperators() != null) {
    JPanel p=new JPanel();
    p.add(new JLabel("String_Node_Str"));
    JDUtilities.addToGridBag(this,p,0,2,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
    if (JDUtilities.getSubConfig("String_Node_Str").getBooleanProperty("String_Node_Str",true)) {
      JPanel p2=new JPanel();
      p2.add(new JLabel("String_Node_Str"));
      JPanel p3=new JPanel();
      p3.add(new JLabel("String_Node_Str"));
      LetterComperator[] lcs=plugin.getLastCaptcha().getLetterComperators();
      for (int i=0; i < lcs.length; i++) {
        Letter a=lcs[i].getA();
        Letter b=lcs[i].getB();
        if (a != null)         p.add(new JLabel(new ImageIcon(a.getImage(2))));
        if (b != null)         p2.add(new JLabel(new ImageIcon(b.getImage(2))));
        p3.add(new JLabel("String_Node_Str" + Math.round(lcs[i].getValityPercent())));
      }
      JDUtilities.addToGridBag(this,p2,0,3,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
      JDUtilities.addToGridBag(this,p3,0,4,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
    }
  }
  pack();
  setLocation(JDUtilities.getCenterOfComponent(null,this));
  textField.requestFocusInWindow();
}

Fixed version (ground truth):
/** 
 * Erstellt einen neuen Dialog.
 * @param owner Das übergeordnete Fenster
 * @param plugin Das Plugin, das dieses Captcha auslesen möchte (name des Hosts wird von JAC benötigt)
 * @param file Pfad des Bildes, das angezeigt werden soll
 */
public CaptchaDialog(final Frame owner,final Plugin plugin,final File file,final String def){
  super(owner);
  JDSounds.PT("String_Node_Str");
  setModal(true);
  addWindowListener(new WindowListener(){
    public void windowActivated(    WindowEvent e){
    }
    public void windowClosed(    WindowEvent e){
    }
    public void windowClosing(    WindowEvent e){
      dispose();
      CaptchaDialog cd=new CaptchaDialog(owner,plugin,file,def);
      cd.countdown=countdown;
      cd.setVisible(true);
      captchaText=cd.getCaptchaText();
    }
    public void windowDeactivated(    WindowEvent e){
    }
    public void windowDeiconified(    WindowEvent e){
    }
    public void windowIconified(    WindowEvent e){
    }
    public void windowOpened(    WindowEvent e){
    }
  }
);
  setLayout(new GridBagLayout());
  ImageIcon imageIcon=null;
  String code="String_Node_Str";
  final Configuration configuration=JDUtilities.getConfiguration();
  imageIcon=new ImageIcon(file.getAbsolutePath());
  if (plugin != null && plugin.getCaptchaDetectionID() != Plugin.CAPTCHA_USER_INPUT && !configuration.getBooleanProperty(Configuration.PARAM_CAPTCHA_JAC_DISABLE,false) && JAntiCaptcha.hasMethod(JDUtilities.getJACMethodsDirectory(),plugin.getHost())) {
    setTitle(JDLocale.L("String_Node_Str","String_Node_Str"));
    final String host=plugin.getHost();
    this.jacThread=new Thread("String_Node_Str"){
      public void run(){
        String code=JDUtilities.getCaptcha(plugin,host,file,true);
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
        if (textField.getText().length() == 0 || code.toLowerCase().startsWith(textField.getText().toLowerCase())) {
          textField.setText(code);
          if (isVisible() && textField.getText().equalsIgnoreCase(code) && textField.getText().length() > 0) {
            captchaText=textField.getText();
            dispose();
          }
        }
 else {
          textField.setText(JDLocale.L("String_Node_Str","String_Node_Str"));
          setTitle(JDLocale.L("String_Node_Str","String_Node_Str"));
        }
      }
    }
;
    this.jacThread.start();
  }
 else {
    this.countdownThread=new Thread(){
      public void run(){
        int c=countdown * 1000;
        long t=System.currentTimeMillis();
        while (c >= 0) {
          if (!isVisible())           return;
          t=System.currentTimeMillis();
          setTitle("String_Node_Str" + JDUtilities.formatSeconds(c / 1000));
          if (c < 3000)           JDSounds.P("String_Node_Str");
          long dif=System.currentTimeMillis() - t;
          c-=dif;
          try {
            if (dif < 1000)             Thread.sleep(1000 - dif);
            c-=(1000 - dif);
          }
 catch (          InterruptedException e) {
          }
          if (!isVisible())           return;
        }
        captchaText=textField.getText();
        dispose();
      }
    }
;
    this.countdownThread.start();
  }
  JLabel label=new JLabel(imageIcon);
  textField=new JTextField(10);
  if (def != null)   code=def;
  btnOK=new JButton(JDLocale.L("String_Node_Str","String_Node_Str"));
  btnBAD=new JButton(JDLocale.L("String_Node_Str","String_Node_Str"));
  textField.setText(code);
  textField.selectAll();
  btnOK.addActionListener(this);
  btnBAD.addActionListener(this);
  getRootPane().setDefaultButton(btnOK);
  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
  JDUtilities.addToGridBag(this,label,0,0,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
  JDUtilities.addToGridBag(this,textField,0,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.EAST);
  JDUtilities.addToGridBag(this,btnOK,1,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.WEST);
  JDUtilities.addToGridBag(this,btnBAD,2,1,1,1,1,1,null,GridBagConstraints.NONE,GridBagConstraints.WEST);
  if (plugin != null && plugin.getLastCaptcha() != null && plugin.getLastCaptcha().getLetterComperators() != null) {
    JPanel p=new JPanel();
    p.add(new JLabel("String_Node_Str"));
    JDUtilities.addToGridBag(this,p,0,2,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
    if (JDUtilities.getSubConfig("String_Node_Str").getBooleanProperty("String_Node_Str",true)) {
      JPanel p2=new JPanel();
      p2.add(new JLabel("String_Node_Str"));
      JPanel p3=new JPanel();
      p3.add(new JLabel("String_Node_Str"));
      LetterComperator[] lcs=plugin.getLastCaptcha().getLetterComperators();
      for (int i=0; i < lcs.length; i++) {
        Letter a=lcs[i].getA();
        Letter b=lcs[i].getB();
        if (a != null)         p.add(new JLabel(new ImageIcon(a.getImage(2))));
        if (b != null)         p2.add(new JLabel(new ImageIcon(b.getImage(2))));
        p3.add(new JLabel("String_Node_Str" + Math.round(lcs[i].getValityPercent())));
      }
      JDUtilities.addToGridBag(this,p2,0,3,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
      JDUtilities.addToGridBag(this,p3,0,4,2,1,0,0,null,GridBagConstraints.NONE,GridBagConstraints.CENTER);
    }
  }
  pack();
  setLocation(JDUtilities.getCenterOfComponent(null,this));
  textField.requestFocusInWindow();
}