Program: 76981
Project: 76981
Buggy source:
private void initAnchorChooser(Object handle,boolean isToc){
  anchorChooser.removeAll();
  if (handle instanceof ReportDesignHandle) {
    if (isToc) {
      List chooserItems=((ReportDesignHandle)handle).getAllTocs();
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      List chooserItems=((ReportDesignHandle)handle).getAllBookmarks();
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
  }
 else   if (handle instanceof IReportDocument) {
    if (isToc) {
      String format="String_Node_Str";
      for (int i=0; i < supportedFormats.length; i++) {
        if (((Button)formatCheckBtns.get(supportedFormats[i])).getSelection()) {
          format=supportedFormats[i];
          break;
        }
      }
      ITOCTree tocTree=((IReportDocument)handle).getTOCTree(format,SessionHandleAdapter.getInstance().getSessionHandle().getULocale());
      TOCNode rootTocNode=tocTree.getRoot();
      List chooserItems=getAllTocDisplayString(rootTocNode);
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      List chooserItems=getDocumentBookmarks((IReportDocument)handle);
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
  }
  bookmarkEditor.setText("String_Node_Str");
  String bookmark=inputHandle.getTargetBookmark();
  String[] chooserValues=anchorChooser.getItems();
  if (bookmark != null && chooserValues != null) {
    for (int i=0; i < chooserValues.length; i++) {
      if (bookmark.equals(chooserValues[i])) {
        anchorChooser.select(i);
        bookmarkEditor.setText(anchorChooser.getText());
        break;
      }
    }
  }
  anchorChooser.setEnabled(anchorChooser.getItemCount() > 0);
}

Fixed version (ground truth):
private void initAnchorChooser(Object handle,boolean isToc){
  anchorChooser.removeAll();
  if (handle instanceof ReportDesignHandle) {
    if (isToc) {
      List chooserItems=((ReportDesignHandle)handle).getAllTocs();
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      List chooserItems=((ReportDesignHandle)handle).getAllBookmarks();
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
  }
 else   if (handle instanceof IReportDocument) {
    if (isToc) {
      String format="String_Node_Str";
      for (int i=0; i < supportedFormats.length; i++) {
        if (((Button)formatCheckBtns.get(supportedFormats[i])).getSelection()) {
          format=supportedFormats[i];
          break;
        }
      }
      ITOCTree tocTree=((IReportDocument)handle).getTOCTree(format,SessionHandleAdapter.getInstance().getSessionHandle().getULocale());
      TOCNode rootTocNode=tocTree.getRoot();
      List chooserItems=getAllTocDisplayString(rootTocNode);
      chooserItems.add(0,(Object)new String("String_Node_Str"));
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      anchorChooser.setItems(getDocumentBookmarks((IReportDocument)handle));
    }
  }
  bookmarkEditor.setText("String_Node_Str");
  String bookmark=inputHandle.getTargetBookmark();
  String[] chooserValues=anchorChooser.getItems();
  if (bookmark != null && chooserValues != null) {
    for (int i=0; i < chooserValues.length; i++) {
      if (bookmark.equals(chooserValues[i])) {
        anchorChooser.select(i);
        bookmarkEditor.setText(anchorChooser.getText());
        break;
      }
    }
  }
  anchorChooser.setEnabled(anchorChooser.getItemCount() > 0);
}