Program: 67457
Project: 67457
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,"String_Node_Str");
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      List chooserItems=((ReportDesignHandle)handle).getAllBookmarks();
      chooserItems.add(0,"String_Node_Str");
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
  }
 else   if (handle instanceof IReportDocument) {
    if (isToc) {
      String format="String_Node_Str";
      if (targetFormatsChooser.getSelectionIndex() != -1) {
        format=supportedFormats[targetFormatsChooser.getSelectionIndex()];
      }
      ITOCTree tocTree=((IReportDocument)handle).getTOCTree(format,SessionHandleAdapter.getInstance().getSessionHandle().getULocale());
      TOCNode rootTocNode=tocTree.getRoot();
      List chooserItems=getAllTocDisplayString(rootTocNode);
      chooserItems.add(0,"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);
}

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,"String_Node_Str");
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
 else {
      List chooserItems=((ReportDesignHandle)handle).getAllBookmarks();
      chooserItems.add(0,"String_Node_Str");
      anchorChooser.setItems((String[])chooserItems.toArray(new String[0]));
    }
  }
 else   if (handle instanceof IReportDocument) {
    if (isToc) {
      String format="String_Node_Str";
      if (targetFormatsChooser.getSelectionIndex() != -1) {
        format=supportedFormats[targetFormatsChooser.getSelectionIndex()];
      }
      ITOCTree tocTree=((IReportDocument)handle).getTOCTree(format,SessionHandleAdapter.getInstance().getSessionHandle().getULocale());
      TOCNode rootTocNode=tocTree.getRoot();
      List<String> chooserItems=getAllTocDisplayString(rootTocNode);
      chooserItems.add(0,"String_Node_Str");
      anchorChooser.setItems(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);
}