Program: 17548
Project: 17548
Buggy source:
private void createInsightXML(){
  CFCMethodViewItem selectedMethod;
  int i=0;
  try {
    String insight="String_Node_Str";
    String path=CFCMethodsFile.getFullPath().toString().replace('/','.');
    String[] pathArray=path.split("String_Node_Str");
    path="String_Node_Str";
    for (i=0; i < pathArray.length - 1; i++) {
      if (path.length() > 0) {
        path+="String_Node_Str";
      }
      path+=pathArray[i];
    }
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str" + path + "String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    Object[] elements=methodProvider.getElements(new Object());
    for (i=0; i < elements.length; i++) {
      if (elements[i] instanceof CFCMethodViewItem) {
        insight+=((CFCMethodViewItem)elements[i]).getInsightXML();
      }
    }
    insight+="String_Node_Str";
    IStructuredSelection selection=(IStructuredSelection)viewer.getSelection();
    selectedMethod=(CFCMethodViewItem)selection.getFirstElement();
    IEditorPart iep=this.getViewSite().getWorkbenchWindow().getActivePage().getActiveEditor();
    IDocument doc=((ITextEditor)iep).getDocumentProvider().getDocument(iep.getEditorInput());
    ITextEditor ite=(ITextEditor)iep;
    ISelection sel=ite.getSelectionProvider().getSelection();
    int cursorOffset=((ITextSelection)sel).getOffset();
    int selectionLength=((ITextSelection)sel).getLength();
    Encloser encloser=new Encloser();
    encloser.enclose(doc,(ITextSelection)sel,insight,"String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void createInsightXML(){
  CFCMethodViewItem selectedMethod;
  int i=0;
  try {
    String insight="String_Node_Str";
    String path=CFCMethodsFile.getFullPath().toString().replace('/','.');
    String[] pathArray=path.split("String_Node_Str");
    path="String_Node_Str";
    for (i=0; i < pathArray.length - 1; i++) {
      if (path.length() > 0) {
        path+="String_Node_Str";
      }
      path+=pathArray[i];
    }
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str" + path + "String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    insight+="String_Node_Str";
    Object[] elements=methodProvider.getElements(new Object());
    for (i=0; i < elements.length; i++) {
      if (elements[i] instanceof CFCMethodViewItem) {
        insight+=((CFCMethodViewItem)elements[i]).getInsightXML();
      }
    }
    insight+="String_Node_Str";
    IStructuredSelection selection=(IStructuredSelection)viewer.getSelection();
    selectedMethod=(CFCMethodViewItem)selection.getFirstElement();
    IEditorPart iep=this.getViewSite().getWorkbenchWindow().getActivePage().getActiveEditor();
    IDocument doc=((ITextEditor)iep).getDocumentProvider().getDocument(iep.getEditorInput());
    ITextEditor ite=(ITextEditor)iep;
    ISelection sel=ite.getSelectionProvider().getSelection();
    int cursorOffset=((ITextSelection)sel).getOffset();
    int selectionLength=((ITextSelection)sel).getLength();
    Encloser encloser=new Encloser();
    encloser.enclose(doc,(ITextSelection)sel,insight,"String_Node_Str");
  }
 catch (  Exception e) {
  }
}