nus-yam/ex-repair huggingface dataset:
Program: 17393
Project: 17393
Buggy source:
public Object[] getChildren(Object parentElement){
  ArrayList children=new ArrayList();
  Object[] results=null;
  System.out.println("String_Node_Str" + parentElement);
  try {
    if (fileProvider == null) {
      results=new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (parentElement instanceof IFileProvider) {
      results=fileProvider.getRoots();
    }
 else     if (parentElement instanceof RemoteFile) {
      RemoteFile file=(RemoteFile)parentElement;
      String name=file.getFileItem().getName().getPath();
      results=fileProvider.getChildren(name,directoryFilter);
    }
 else     if (parentElement instanceof FileSystemRoot) {
      FileSystemRoot file=(FileSystemRoot)parentElement;
      results=fileProvider.getChildren(file.getPath(),directoryFilter);
    }
 else {
      results=fileProvider.getChildren(parentElement.toString(),directoryFilter);
    }
    for (int i=0; i < results.length; i++) {
      if (!results[i].toString().endsWith("String_Node_Str") && !results[i].toString().endsWith("String_Node_Str") && !results[i].toString().endsWith("String_Node_Str")&& !results[i].toString().endsWith("String_Node_Str")) {
        children.add(results[i]);
      }
    }
    return children.toArray();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}

Fixed version (ground truth):
public Object[] getChildren(Object parentElement){
  ArrayList children=new ArrayList();
  Object[] results=null;
  System.out.println("String_Node_Str" + parentElement);
  try {
    if (fileProvider == null) {
      results=new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (parentElement instanceof IFileProvider) {
      results=fileProvider.getRoots();
    }
 else     if (parentElement instanceof RemoteFile) {
      RemoteFile file=(RemoteFile)parentElement;
      String name=file.getFileItem().getName().getPath();
      results=fileProvider.getChildren(name,directoryFilter);
    }
 else     if (parentElement instanceof FileSystemRoot) {
      FileSystemRoot file=(FileSystemRoot)parentElement;
      if (file.getType().equalsIgnoreCase("String_Node_Str")) {
        results=fileProvider.getChildren("String_Node_Str",directoryFilter);
      }
 else {
        results=fileProvider.getChildren(file.getPath(),directoryFilter);
      }
    }
 else {
      results=fileProvider.getChildren(parentElement.toString(),directoryFilter);
    }
    for (int i=0; i < results.length; i++) {
      if (!results[i].toString().endsWith("String_Node_Str") && !results[i].toString().endsWith("String_Node_Str") && !results[i].toString().endsWith("String_Node_Str")&& !results[i].toString().endsWith("String_Node_Str")) {
        children.add(results[i]);
      }
    }
    return children.toArray();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}
Program: 17394
Project: 17394
Buggy source:
public void doubleClick(DoubleClickEvent e){
  ISelection selection=e.getSelection();
  IStructuredSelection ss=(IStructuredSelection)selection;
  Object[] element=(Object[])ss.getFirstElement();
  IEditorInput input=contentProvider.getEditorInput(element[0].toString());
  if (element[0] instanceof RemoteFile) {
    RemoteFile remFile=(RemoteFile)element[0];
    input=new RemoteFileEditorInput(remFile);
  }
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  try {
    page.openEditor(input,CFMLEditor.ID);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void doubleClick(DoubleClickEvent e){
  ISelection selection=e.getSelection();
  IStructuredSelection ss=(IStructuredSelection)selection;
  Object[] element=(Object[])ss.getFirstElement();
  IEditorInput input=contentProvider.getEditorInput(element[0].toString());
  String fileName="String_Node_Str";
  if (element[0] instanceof RemoteFile) {
    RemoteFile remFile=(RemoteFile)element[0];
    fileName=remFile.getName();
    input=new RemoteFileEditorInput(remFile);
  }
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IEditorDescriptor desc=PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(fileName);
  System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ desc);
  try {
    page.openEditor(input,CFMLEditor.ID);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 17397
Project: 17397
Buggy source:
public void update(Observable o,Object arg){
  int selection=-1;
  CFUnitTestCase tc=(CFUnitTestCase)o;
  clearDetails();
  CFUnitTestResult[] results=tc.getResults();
  String[] list=new String[results.length];
  if (results != null) {
    for (int i=0; i < results.length; i++) {
      String state;
switch (results[i].getType()) {
case CFUnitTestResult.SUCCESS:
        state="String_Node_Str";
      break;
case CFUnitTestResult.ERROR:
    state="String_Node_Str";
  if (selection == -1)   selection=i;
break;
case CFUnitTestResult.FAILURE:
state="String_Node_Str";
if (selection == -1) selection=i;
break;
case CFUnitTestResult.NWERROR:
state="String_Node_Str";
if (selection == -1) selection=i;
break;
default :
state="String_Node_Str";
if (selection == -1) selection=i;
}
list[i]=results[i].getName() + "String_Node_Str" + state;
}
}
tests.setItems(list);
tests.select(selection);
handleSelection();
}

Fixed version (ground truth):
public void update(Observable o,Object arg){
  int selection=-1;
  CFUnitTestCase tc=(CFUnitTestCase)o;
  clearDetails();
  CFUnitTestResult[] results=tc.getResults();
  String[] list=new String[results.length];
  if (results != null) {
    for (int i=0; i < results.length; i++) {
      String state;
      if (results[i] != null) {
switch (results[i].getType()) {
case CFUnitTestResult.SUCCESS:
          state="String_Node_Str";
        break;
case CFUnitTestResult.ERROR:
      state="String_Node_Str";
    if (selection == -1)     selection=i;
  break;
case CFUnitTestResult.FAILURE:
state="String_Node_Str";
if (selection == -1) selection=i;
break;
case CFUnitTestResult.NWERROR:
state="String_Node_Str";
if (selection == -1) selection=i;
break;
default :
state="String_Node_Str";
if (selection == -1) selection=i;
}
list[i]=results[i].getName() + "String_Node_Str" + state;
}
}
}
tests.setItems(list);
tests.select(selection);
handleSelection();
}
Program: 17398
Project: 17398
Buggy source:
/** 
 * Runs this test case and updates the results collection.
 * @return True is executed successfully, false otherwise.
 */
public boolean run(){
  if (!getName().trim().equals("String_Node_Str")) {
    try {
      URL url=getURL();
      if (url != null) {
        URLConnection connection=url.openConnection();
        BufferedReader in=new BufferedReader(new InputStreamReader(connection.getInputStream()));
        CFUnitTestResult test=null;
        String line=in.readLine();
        readMetadata(line);
        results=new CFUnitTestResult[readCount()];
        int i=0;
        while ((line=in.readLine()) != null) {
          if (line.charAt(0) == '[' & line.charAt(line.length() - 1) == ']') {
            test=new CFUnitTestResult(line.substring(1,line.length() - 1));
            results[i]=test;
            i++;
          }
 else {
            if (test != null) {
              test.appendDetails(line);
            }
          }
        }
        this.setRunCount(results.length);
        in.close();
      }
    }
 catch (    java.io.IOException e) {
      addCriticalErrorResult(e);
      notifyObservers();
      return false;
    }
    setChanged();
    notifyObservers();
    return true;
  }
 else {
    clear();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Runs this test case and updates the results collection.
 * @return True is executed successfully, false otherwise.
 */
public boolean run(){
  if (!getName().trim().equals("String_Node_Str")) {
    try {
      URL url=getURL();
      if (url != null) {
        URLConnection connection=url.openConnection();
        BufferedReader in=new BufferedReader(new InputStreamReader(connection.getInputStream()));
        CFUnitTestResult test=null;
        String line=in.readLine();
        readMetadata(line);
        results=new CFUnitTestResult[readCount()];
        int i=0;
        while ((line=in.readLine()) != null) {
          if (line.trim().length() > 0) {
            if (line.charAt(0) == '[' & line.charAt(line.length() - 1) == ']') {
              test=new CFUnitTestResult(line.substring(1,line.length() - 1));
              results[i]=test;
              i++;
            }
 else {
              if (test != null) {
                test.appendDetails(line);
              }
            }
          }
        }
        this.setRunCount(results.length);
        in.close();
      }
    }
 catch (    java.io.IOException e) {
      addCriticalErrorResult(e);
      notifyObservers();
      return false;
    }
    setChanged();
    notifyObservers();
    return true;
  }
 else {
    clear();
    return false;
  }
}
Program: 17399
Project: 17399
Buggy source:
public void run(){
  IEditorPart activeEditor=Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  ITextEditor thisEdit=(ITextEditor)activeEditor;
  IDocument doc=thisEdit.getDocumentProvider().getDocument(thisEdit.getEditorInput());
  ISelection sel=thisEdit.getSelectionProvider().getSelection();
  final ITextSelection textSelection=(ITextSelection)thisEdit.getSelectionProvider().getSelection();
  TagEditDialog tagview=new TagEditDialog(shell,this.tag);
  if (tagview.open() == IDialogConstants.OK_ID) {
    Properties fieldStore=tagview.getFieldStore();
    TagFormatter tf=new TagFormatter(this.tag,fieldStore);
    if (thisEdit instanceof ITextEditor) {
      Encloser enc=new Encloser();
      enc.enclose((ICFDocument)doc,textSelection,tf.getTagStart(),tf.getTagEnd());
      thisEdit.setFocus();
    }
  }
}

Fixed version (ground truth):
public void run(){
  IEditorPart activeEditor=Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  ITextEditor thisEdit=(ITextEditor)activeEditor;
  IDocument doc=thisEdit.getDocumentProvider().getDocument(thisEdit.getEditorInput());
  ISelection sel=thisEdit.getSelectionProvider().getSelection();
  final ITextSelection textSelection=(ITextSelection)thisEdit.getSelectionProvider().getSelection();
  Tag tagToOpen=null;
  if (this.tag != null) {
    tagToOpen=this.tag;
  }
 else   if (this.tagname != null) {
    tagToOpen=DictionaryManager.getDictionary("String_Node_Str").getTag(this.tagname);
  }
  TagEditDialog tagview=new TagEditDialog(shell,tagToOpen);
  if (tagview.open() == IDialogConstants.OK_ID) {
    Properties fieldStore=tagview.getFieldStore();
    TagFormatter tf=new TagFormatter(tagToOpen,fieldStore);
    if (thisEdit instanceof ITextEditor) {
      Encloser enc=new Encloser();
      enc.enclose((ICFDocument)doc,textSelection,tf.getTagStart(),tf.getTagEnd());
      thisEdit.setFocus();
    }
  }
}
Program: 17400
Project: 17400
Buggy source:
public InsertTagAction(Tag tag,Shell shell){
  this.tag=tag;
  this.shell=shell;
}

Fixed version (ground truth):
public InsertTagAction(String tagname,Shell shell){
  this.tagname=tagname;
  this.shell=shell;
}
Program: 17402
Project: 17402
Buggy source:
protected void deleteSnipFolder(){
  File selectedfile=getSelectedFile();
  if (!selectedfile.isDirectory()) {
    selectedfile=selectedfile.getParentFile();
  }
  MessageBox deleteDialog=new MessageBox(this.getViewSite().getShell(),SWT.YES | SWT.NO);
  deleteDialog.setMessage("String_Node_Str");
  if (deleteDialog.open() == SWT.YES) {
    selectedfile.delete();
    reloadSnippets();
  }
}

Fixed version (ground truth):
protected void deleteSnipFolder(){
  File selectedfile=getSelectedFile();
  if (!selectedfile.isDirectory()) {
    selectedfile=selectedfile.getParentFile();
  }
  MessageBox deleteDialog=new MessageBox(this.getViewSite().getShell(),SWT.YES | SWT.NO);
  if (selectedfile.listFiles().length > 0) {
    MessageBox warndialog=new MessageBox(this.getViewSite().getShell(),SWT.ICON_WARNING);
    warndialog.setMessage("String_Node_Str");
  }
 else {
    deleteDialog.setMessage("String_Node_Str");
    if (deleteDialog.open() == SWT.YES) {
      selectedfile.delete();
      reloadSnippets();
    }
  }
}
Program: 17404
Project: 17404
Buggy source:
/** 
 * @see org.cfeclipse.cfml.parser.docitems.DocItem#IsSane()
 */
public boolean IsSane(){
  Set attributes=syntax.getElementAttributes(this.itemName);
  Object[] params=attributes.toArray();
  for (int i=0; i < params.length; i++) {
    Parameter currParam=(Parameter)params[i];
    if (currParam.isRequired() && !itemAttributes.containsKey(currParam.getName())) {
      this.parseMessages.addMessage(new ParseError(lineNumber,startPosition,endPosition,itemData,"String_Node_Str" + currParam.getName() + "String_Node_Str"+ itemName+ "String_Node_Str"));
    }
  }
  return super.IsSane();
}

Fixed version (ground truth):
/** 
 * @see org.cfeclipse.cfml.parser.docitems.DocItem#IsSane()
 */
public boolean IsSane(){
  Set attributes=syntax.getElementAttributes(this.itemName);
  if (attributes == null) {
    return super.IsSane();
  }
  Object[] params=attributes.toArray();
  for (int i=0; i < params.length; i++) {
    Parameter currParam=(Parameter)params[i];
    System.out.println("String_Node_Str" + currParam.getName() + "String_Node_Str"+ currParam.isReqpuired(itemAttributes)+ "String_Node_Str"+ (currParam.isTriggered(itemAttributes) & Parameter.PARAM_REQUIRED));
    if (currParam.isReqpuired(itemAttributes) & !itemAttributes.containsKey(currParam.getName())) {
      this.parseMessages.addMessage(new ParseError(lineNumber,startPosition,endPosition,itemData,"String_Node_Str" + currParam.getName() + "String_Node_Str"+ itemName+ "String_Node_Str"));
    }
  }
  return super.IsSane();
}
Program: 17406
Project: 17406
Buggy source:
public ICompletionProposal[] getPageVariables(IAssistState state,ICFDocument doc){
  CFParser parser=new CFParser();
  CFDocument cfdoc=parser.parseDoc(state.getIDocument().get());
  System.out.println(cfdoc.dumpVariables());
  HashMap varMap=cfdoc.getVariableMap();
  ICompletionProposal[] proposals=new ICompletionProposal[varMap.size()];
  Iterator keyIter=varMap.keySet().iterator();
  int propIter=0;
  while (keyIter.hasNext()) {
    String key=(String)keyIter.next();
    CompletionProposal proposal=new CompletionProposal(key,state.getOffset(),0,key.toString().length());
    proposals[propIter]=proposal;
    propIter++;
  }
  return proposals;
}

Fixed version (ground truth):
public ICompletionProposal[] getPageVariables(IAssistState state,ICFDocument doc){
  CFParser parser=new CFParser();
  CFDocument cfdoc=parser.parseDoc(state.getIDocument().get());
  HashMap varMap=cfdoc.getVariableMap();
  ICompletionProposal[] proposals=new ICompletionProposal[varMap.size()];
  Iterator keyIter=varMap.keySet().iterator();
  int propIter=0;
  while (keyIter.hasNext()) {
    String key=(String)keyIter.next();
    CompletionProposal proposal=new CompletionProposal(key,state.getOffset(),0,key.toString().length());
    proposals[propIter]=proposal;
    propIter++;
  }
  return proposals;
}
Program: 17408
Project: 17408
Buggy source:
public ICompletionProposal[] getTagProposals(IAssistState state){
  ICFDocument doc=(ICFDocument)state.getIDocument();
  if (state.getTriggerData() == ' ' || state.getTriggerData() == '#' || state.getTriggerData() == '>') {
    return getPageVariables(state,doc);
  }
 else   if (state.getTriggerData() != '.') {
    return null;
  }
 else {
    String allData=state.getDataSoFar();
    if (allData.endsWith("String_Node_Str")) {
      allData=allData.substring(0,allData.length() - 1);
    }
    String VarName="String_Node_Str";
    StringBuffer buf=new StringBuffer();
    for (int i=allData.length() - 1; i >= 0; i--) {
      if (!Character.isJavaIdentifierPart(allData.charAt(i))) {
        break;
      }
      buf.insert(0,allData.charAt(i));
    }
    VarName=buf.toString();
    ICompletionProposal[] result=getArguments(VarName,state,doc);
    return result;
  }
}

Fixed version (ground truth):
public ICompletionProposal[] getTagProposals(IAssistState state){
  ICFDocument doc=(ICFDocument)state.getIDocument();
  if (state.getTriggerData() == ' ' || state.getTriggerData() == '#' || state.getTriggerData() == '>') {
    return getPageVariables(state,doc);
  }
 else   if (state.getTriggerData() != '.') {
    String paritionSection="String_Node_Str";
    try {
      ITypedRegion partition=doc.getPartition(state.getOffset());
      paritionSection=partition.getType();
    }
 catch (    BadLocationException e) {
      e.printStackTrace();
    }
    return null;
  }
 else {
    String allData=state.getDataSoFar();
    if (allData.endsWith("String_Node_Str")) {
      allData=allData.substring(0,allData.length() - 1);
    }
    System.out.println(allData);
    String VarName="String_Node_Str";
    StringBuffer buf=new StringBuffer();
    for (int i=allData.length() - 1; i >= 0; i--) {
      if (!Character.isJavaIdentifierPart(allData.charAt(i))) {
        break;
      }
      buf.insert(0,allData.charAt(i));
    }
    VarName=buf.toString();
    ICompletionProposal[] result=getArguments(VarName,state,doc);
    return result;
  }
}
Program: 17409
Project: 17409
Buggy source:
public void run(IAction action){
  if (editor != null && editor.isEditable()) {
    IDocument doc=editor.getDocumentProvider().getDocument(editor.getEditorInput());
    ISelection sel=editor.getSelectionProvider().getSelection();
    this.enclose(doc,(ITextSelection)sel,start,end);
    int offset=((ITextSelection)sel).getOffset();
    offset+=((ITextSelection)sel).getLength();
    offset+=start.length();
    editor.setHighlightRange(offset,0,true);
    CFMLPlugin.getDefault().getLastActionManager().setLastAction(editor,this);
  }
}

Fixed version (ground truth):
public void run(IAction action){
  if (editor != null && editor.isEditable()) {
    IDocument doc=editor.getDocumentProvider().getDocument(editor.getEditorInput());
    ISelection sel=editor.getSelectionProvider().getSelection();
    this.enclose(doc,(ITextSelection)sel,start,end);
    int offset=((ITextSelection)sel).getOffset();
    offset+=((ITextSelection)sel).getLength();
    offset+=start.length() + 1;
    editor.setHighlightRange(offset,0,true);
    CFMLPlugin.getDefault().getLastActionManager().setLastAction(editor,this);
  }
}
Program: 17410
Project: 17410
Buggy source:
public CFCBean(String name,String path,String extendCfc,String hint,String displayName){
  this();
  this.name=name;
  this.path=path;
  this.extendCfc=extendCfc;
  this.hint=hint;
  this.displayName=displayName;
}

Fixed version (ground truth):
public CFCBean(String name,String path,String extendCfc,String hint,String displayName,String output){
  this();
  this.name=name;
  this.path=path;
  this.extendCfc=extendCfc;
  this.hint=hint;
  this.displayName=displayName;
  this.output=output;
}
Program: 17411
Project: 17411
Buggy source:
/** 
 * creates tthe cfml code to add to the new file
 * @return
 */
private StringBuffer createStringBuffer(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(page.getCFCBean().getName() + "String_Node_Str");
  if (page.getCFCBean().getDisplayName().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getDisplayName().trim() + "String_Node_Str");
  if (page.getCFCBean().getHint().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getHint().trim() + "String_Node_Str");
  if (page.getCFCBean().getExtendCFC().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getExtendCFC().trim() + "String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (pageTwo.hasProperties()) {
    sb.append(pageTwo.getPropertiesAsTags());
    sb.append(pageTwo.getPropertyGettersAndSetters());
  }
  if (pageThree.hasFunctions())   sb.append(pageThree.getFunctionTags());
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
/** 
 * creates tthe cfml code to add to the new file
 * @return
 */
private StringBuffer createStringBuffer(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  if (page.getCFCBean().getDisplayName().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getDisplayName().trim() + "String_Node_Str");
  if (page.getCFCBean().getHint().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getHint().trim() + "String_Node_Str");
  if (page.getCFCBean().getExtendCFC().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getExtendCFC().trim() + "String_Node_Str");
  if (page.getCFCBean().getOutput().trim().length() > 0)   sb.append("String_Node_Str" + page.getCFCBean().getOutput().trim() + "String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (pageTwo.hasProperties()) {
    sb.append(pageTwo.getPropertiesAsTags());
    sb.append(pageTwo.getPropertyGettersAndSetters());
  }
  if (pageThree.hasFunctions())   sb.append(pageThree.getFunctionTags());
  sb.append("String_Node_Str");
  return sb;
}
Program: 17412
Project: 17412
Buggy source:
/** 
 * Tests if the current workbench selection is a suitable container to use.
 */
private void initialize(){
  if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
    IStructuredSelection ssel=(IStructuredSelection)selection;
    if (ssel.size() > 1)     return;
    Object obj=ssel.getFirstElement();
    if (obj instanceof IResource) {
      IContainer container;
      if (obj instanceof IContainer)       container=(IContainer)obj;
 else       container=((IResource)obj).getParent();
      this.cfcBean.setPath(container.getFullPath().toString());
      this.cfcPath.setText(this.cfcBean.getPath());
    }
  }
  this.cfcBean.setName("String_Node_Str");
  this.cfcName.setText(this.cfcBean.getName());
}

Fixed version (ground truth):
/** 
 * Tests if the current workbench selection is a suitable container to use.
 */
private void initialize(){
  if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
    IStructuredSelection ssel=(IStructuredSelection)selection;
    if (ssel.size() > 1)     return;
    Object obj=ssel.getFirstElement();
    if (obj instanceof IResource) {
      IContainer container;
      if (obj instanceof IContainer)       container=(IContainer)obj;
 else       container=((IResource)obj).getParent();
      this.cfcBean.setPath(container.getFullPath().toString());
      this.cfcPath.setText(this.cfcBean.getPath());
    }
  }
  this.cfcBean.setName("String_Node_Str");
  this.cfcName.setText(this.cfcBean.getName());
  this.cfcBean.setOutput("String_Node_Str");
  this.cfcOutput.setText(this.cfcBean.getOutput());
}
Program: 17413
Project: 17413
Buggy source:
/** 
 * Ensures that both text fields are set.
 */
private void dialogChanged(){
  String containerName=this.cfcPath.getText();
  String fileName=this.cfcName.getText();
  String extend=this.cfcExtends.getText();
  String hint=this.cfcHint.getText();
  String displayName=this.cfcDisplayName.getText();
  this.cfcBean.setDisplayName(displayName);
  this.cfcBean.setExtendCFC(extend);
  this.cfcBean.setHint(hint);
  this.cfcBean.setName(fileName);
  this.cfcBean.setPath(containerName);
  if (containerName.length() == 0) {
    updateStatus("String_Node_Str");
    return;
  }
  if (fileName.length() == 0) {
    updateStatus("String_Node_Str");
    return;
  }
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IResource resource=root.findMember(new Path(containerName));
  IContainer container=(IContainer)resource;
  IFile file=container.getFile(new Path(fileName + "String_Node_Str"));
  if (file.exists()) {
    updateStatus("String_Node_Str");
    return;
  }
  int dotLoc=fileName.lastIndexOf('.');
  if (dotLoc > 0) {
    String ext=fileName.substring(dotLoc + 1);
    if (ext.equalsIgnoreCase("String_Node_Str") == false) {
      updateStatus("String_Node_Str");
      return;
    }
  }
  updateStatus(null);
}

Fixed version (ground truth):
/** 
 * Ensures that both text fields are set.
 */
private void dialogChanged(){
  String containerName=this.cfcPath.getText();
  String fileName=this.cfcName.getText();
  String extend=this.cfcExtends.getText();
  String hint=this.cfcHint.getText();
  String displayName=this.cfcDisplayName.getText();
  String output=this.cfcOutput.getText();
  this.cfcBean.setDisplayName(displayName);
  this.cfcBean.setExtendCFC(extend);
  this.cfcBean.setHint(hint);
  this.cfcBean.setName(fileName);
  this.cfcBean.setOutput(output);
  this.cfcBean.setPath(containerName);
  if (containerName.length() == 0) {
    updateStatus("String_Node_Str");
    return;
  }
  if (fileName.length() == 0) {
    updateStatus("String_Node_Str");
    return;
  }
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IResource resource=root.findMember(new Path(containerName));
  IContainer container=(IContainer)resource;
  IFile file=container.getFile(new Path(fileName + "String_Node_Str"));
  if (file.exists()) {
    updateStatus("String_Node_Str");
    return;
  }
  int dotLoc=fileName.lastIndexOf('.');
  if (dotLoc > 0) {
    String ext=fileName.substring(dotLoc + 1);
    if (ext.equalsIgnoreCase("String_Node_Str") == false) {
      updateStatus("String_Node_Str");
      return;
    }
  }
  updateStatus(null);
}
Program: 17414
Project: 17414
Buggy source:
/** 
 * Constructor for SampleNewWizardPage.
 * @param pageName
 */
public NewCFCWizardPage(ISelection selection){
  super("String_Node_Str");
  setTitle("String_Node_Str");
  setDescription("String_Node_Str");
  this.selection=selection;
  this.cfcBean=new CFCBean("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor for SampleNewWizardPage.
 * @param pageName
 */
public NewCFCWizardPage(ISelection selection){
  super("String_Node_Str");
  setTitle("String_Node_Str");
  setDescription("String_Node_Str");
  this.selection=selection;
  this.cfcBean=new CFCBean("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 17416
Project: 17416
Buggy source:
private void setStatusLine(){
  IEditorInput input=getEditorInput();
  IFile original=(input instanceof IFileEditorInput) ? ((IFileEditorInput)input).getFile() : null;
  getEditorSite().getActionBars().getStatusLineManager().setMessage(original.getLocation().toString());
}

Fixed version (ground truth):
private void setStatusLine(){
  try {
    IEditorInput input=getEditorInput();
    IFile original=(input instanceof IFileEditorInput) ? ((IFileEditorInput)input).getFile() : null;
    getEditorSite().getActionBars().getStatusLineManager().setMessage(original.getLocation().toString());
  }
 catch (  Exception e) {
    System.err.println(e);
  }
}
Program: 17417
Project: 17417
Buggy source:
public boolean canWrite(){
  if (fPermissions == null) {
    return true;
  }
  if (fPermissions.length() >= 6 && fPermissions.charAt(5) == 'w') {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean canWrite(){
  if (fPermissions == null) {
    return true;
  }
  if (fPermissions.length() >= 6 && (fPermissions.charAt(5) == 'w' || fPermissions.charAt(2) == 'w')) {
    return true;
  }
  return false;
}
Program: 17419
Project: 17419
Buggy source:
/** 
 * 1. This is where we add the root.
 */
private void initialize(){
  invisibleRoot=new TreeParent("String_Node_Str");
  IProject[] projects=getProjects();
  for (int i=0; i < projects.length; i++) {
    invisibleRoot.addChild(new ProjectNode(projects[i]));
  }
}

Fixed version (ground truth):
/** 
 * 1. This is where we add the root.
 */
private void initialize(){
  invisibleRoot=new TreeParent("String_Node_Str");
  IProject[] projects=getProjects();
  for (int i=0; i < projects.length; i++) {
    if (projects[i].isOpen())     invisibleRoot.addChild(new ProjectNode(projects[i]));
  }
}
Program: 17420
Project: 17420
Buggy source:
public SnipKeyCombos(){
  CFMLPropertyManager propertyManager=new CFMLPropertyManager();
  try {
    IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    IProject p=((FileEditorInput)editor.getEditorInput()).getFile().getProject();
    this.snippetFilePath=propertyManager.snippetsPath(p);
    this.keyComboFilePath=this.snippetFilePath + "String_Node_Str";
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  loadKeyCombos();
}

Fixed version (ground truth):
public SnipKeyCombos(){
  CFMLPropertyManager propertyManager=new CFMLPropertyManager();
  this.snippetFilePath=new File(propertyManager.defaultSnippetsPath()).toString();
  this.keyComboFilePath=this.snippetFilePath + "String_Node_Str";
  loadKeyCombos();
}
Program: 17421
Project: 17421
Buggy source:
/** 
 * The constructor.
 */
public SnipTreeView(){
  super();
  propertyManager=new CFMLPropertyManager();
  snippetType=CFECLIPSE_SNIP_TYPE;
  CFMLPlugin.getDefault().getPropertyStore().addPropertyChangeListener(this);
  try {
    snipBase=new Path(propertyManager.defaultSnippetsPath());
  }
 catch (  Exception e) {
    e.printStackTrace(System.err);
  }
  if (tmpAction == null)   tmpAction=new GenericEncloserAction();
  if (snipReader == null)   snipReader=new SnipReader();
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public SnipTreeView(){
  super();
  propertyManager=new CFMLPropertyManager();
  snippetType=CFECLIPSE_SNIP_TYPE;
  CFMLPlugin.getDefault().getPropertyStore().addPropertyChangeListener(this);
  snipBase=new Path(propertyManager.defaultSnippetsPath());
  if (tmpAction == null)   tmpAction=new GenericEncloserAction();
  if (snipReader == null)   snipReader=new SnipReader();
}
Program: 17422
Project: 17422
Buggy source:
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().equals(CFMLPreferenceConstants.P_SNIPPETS_PATH)) {
    try {
      IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
      IProject p=((FileEditorInput)editor.getEditorInput()).getFile().getProject();
      snipBase=new Path(propertyManager.snippetsPath(p));
      treeViewer.setInput(getRootInput());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().equals(CFMLPreferenceConstants.P_SNIPPETS_PATH)) {
    CFMLPropertyManager propertyManager=new CFMLPropertyManager();
    snipBase=new Path(propertyManager.defaultSnippetsPath());
    treeViewer.setInput(getRootInput());
  }
}
Program: 17423
Project: 17423
Buggy source:
/** 
 * Constructor for NewCfmlWizard.
 */
public NewTemplateFileWizard(){
  super();
  setNeedsProgressMonitor(true);
  propertyManager=new CFMLPropertyManager();
  snipReader=new SnipReader();
  try {
    IResource resource=getContainingResource();
    snipBase=new Path(propertyManager.snippetsPath(resource.getProject()));
  }
 catch (  Exception e) {
    e.printStackTrace(System.err);
  }
}

Fixed version (ground truth):
/** 
 * Constructor for NewCfmlWizard.
 */
public NewTemplateFileWizard(){
  super();
  setNeedsProgressMonitor(true);
  propertyManager=new CFMLPropertyManager();
  snipReader=new SnipReader();
  CFMLPropertyManager propertyManager=new CFMLPropertyManager();
  snipBase=new Path(propertyManager.defaultSnippetsPath());
}
Program: 17424
Project: 17424
Buggy source:
public IEditorInput getEditorInput(String filename){
  IPath path=new Path(filename);
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IFile file=root.getFileForLocation(path);
  if (file != null) {
    return new FileEditorInput(file);
  }
  return new JavaFileEditorInput(new File(filename));
}

Fixed version (ground truth):
public IEditorInput getEditorInput(String filename){
  IPath path=new Path(filename);
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IFile file=root.getFileForLocation(path);
  if (file != null) {
    return new FileEditorInput(file);
  }
  return new JavaFileEditorInput((IFileStore)new File(filename));
}
Program: 17425
Project: 17425
Buggy source:
/** 
 * Get a dictionary from the live dictionaries
 * @param key the dictionary's key (often one of the statics above)
 * @return the dictionary
 */
public static SyntaxDictionary getDictionary(String key){
  System.out.println("String_Node_Str" + key);
  SyntaxDictionary dict=(SyntaxDictionary)dictionaries.get(key);
  System.out.println("String_Node_Str" + dict);
  return dict;
}

Fixed version (ground truth):
/** 
 * Get a dictionary from the live dictionaries
 * @param key the dictionary's key (often one of the statics above)
 * @return the dictionary
 */
public static SyntaxDictionary getDictionary(String key){
  SyntaxDictionary dict=(SyntaxDictionary)dictionaries.get(key);
  return dict;
}
Program: 17426
Project: 17426
Buggy source:
/** 
 * Opens a dropped file in the CFMLEditor
 * @param event
 */
private void handleFileDrop(DropTargetEvent event){
  Object result=fileTransfer.nativeToJava(event.currentDataType);
  String[] filenames=(String[])result;
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IFile thisFile=root.getFile(new Path(filenames[0]));
  File dropped=(File)thisFile;
  File target=null;
  try {
    ResourceUtils.getRelativePath(dropped,target);
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  for (int i=0; i < filenames.length; i++) {
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try {
      System.out.println("String_Node_Str" + filenames[1]);
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * Opens a dropped file in the CFMLEditor
 * @param event
 */
private void handleFileDrop(DropTargetEvent event){
  Object result=fileTransfer.nativeToJava(event.currentDataType);
  String[] filenames=(String[])result;
  IWorkspaceRoot root=ResourcesPlugin.getWorkspace().getRoot();
  IFile thisFile=root.getFile(new Path(filenames[0]));
  File dropped=(File)thisFile;
  String pth=((IResource)((FileEditorInput)editor.getEditorInput()).getFile()).getProject().toString();
  File target=(File)((FileEditorInput)editor.getEditorInput()).getFile();
  try {
    System.out.println(ResourceUtils.getRelativePath(dropped,target).toString());
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  for (int i=0; i < filenames.length; i++) {
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try {
      System.out.println("String_Node_Str" + filenames[1]);
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
  }
  return;
}
Program: 17428
Project: 17428
Buggy source:
/** 
 * Performs the required operations to provide indenting when the user presses enter inside a tag.
 * @param docCommand - the document command to work up.
 */
private void handleEnterInTag(IDocument doc,DocumentCommand docCommand){
  try {
    int currLine=doc.getLineOfOffset(docCommand.offset);
    String lineDelim=doc.getLineDelimiter(currLine);
    if (lineDelim == null)     lineDelim="String_Node_Str";
    int posForIndent=findEndOfTag(doc,docCommand.offset);
    int numIndents=0;
    int indentWidth=0;
    int spaceRemainder=0;
    String prefix=getPrevLineWhiteSpace(doc,docCommand.offset);
    String newPrefix="String_Node_Str";
    if (this.getIndentString().compareTo("String_Node_Str") == 0) {
      indentWidth=Integer.parseInt(CFMLPlugin.getDefault().getPreferenceStore().getString(EditorPreferenceConstants.P_TAB_WIDTH));
      newPrefix=prefix.replaceAll("String_Node_Str","String_Node_Str");
    }
 else {
      indentWidth=this.getIndentString().length();
      newPrefix=prefix.replaceAll("String_Node_Str","String_Node_Str");
    }
    docCommand.text+=newPrefix;
    int indentChars=posForIndent - doc.getLineOffset(currLine) - newPrefix.length() + 1;
    numIndents=indentChars / indentWidth;
    spaceRemainder=indentChars - (indentWidth * numIndents);
    for (int i=0; i < numIndents; i++) {
      docCommand.text+=this.getIndentString();
    }
    for (int i=0; i < spaceRemainder; i++) {
      docCommand.text+="String_Node_Str";
    }
  }
 catch (  BadLocationException ex) {
    ex.printStackTrace();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    return;
  }
}

Fixed version (ground truth):
/** 
 * Performs the required operations to provide indenting when the user presses enter inside a tag.
 * @param docCommand - the document command to work up.
 */
private void handleEnterInTag(IDocument doc,DocumentCommand docCommand){
  try {
    int currLine=doc.getLineOfOffset(docCommand.offset);
    String lineDelim=doc.getLineDelimiter(currLine);
    if (lineDelim == null)     lineDelim="String_Node_Str";
    String prefix=getPrevLineWhiteSpace(doc,docCommand.offset);
    docCommand.text+=guessNewIndentWhitespace(prefix);
  }
 catch (  BadLocationException ex) {
    ex.printStackTrace();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    return;
  }
}
Program: 17430
Project: 17430
Buggy source:
/** 
 * Handles the insertion of quotes by the user. If the user has opened quotes then it inserts a closing quote after the opened quote and does not move the caret. If the user is closing some quotes it steps through the existing quote.
 * @param doc -The document that the command is being performed in
 * @param docCommand -the command to modify
 * @param quoteChar -the quote character that triggered this. This allows us to handle " and ' quotes.
 * @throws BadLocationException -ack.
 */
private void handleQuotes(IDocument doc,DocumentCommand docCommand,char quoteChar) throws BadLocationException {
  char nextChar=(char)0;
  char prevChar=(char)0;
  try {
    nextChar=doc.getChar(docCommand.offset);
    prevChar=doc.getChar(docCommand.offset - 1);
  }
 catch (  BadLocationException bex) {
  }
  if (prevChar == quoteChar || nextChar == '#' || prevChar == '#') {
    return;
  }
  if (quoteChar == '\'') {
    if (prevChar == '"' || nextChar == '"') {
      return;
    }
  }
  if (quoteChar == '"') {
    if (prevChar == '\'' || nextChar == '\'') {
      return;
    }
  }
  if (nextChar == quoteChar) {
    docCommand.text="String_Node_Str";
    docCommand.shiftsCaret=false;
    docCommand.caretOffset=docCommand.offset + 1;
    return;
  }
  docCommand.text+=quoteChar;
  docCommand.caretOffset=docCommand.offset + 1;
  docCommand.shiftsCaret=false;
  return;
}

Fixed version (ground truth):
/** 
 * Handles the insertion of quotes by the user. If the user has opened quotes then it inserts a closing quote after the opened quote and does not move the caret. If the user is closing some quotes it steps through the existing quote.
 * @param doc -The document that the command is being performed in
 * @param docCommand -the command to modify
 * @param quoteChar -the quote character that triggered this. This allows us to handle " and ' quotes.
 * @throws BadLocationException -ack.
 */
private void handleQuotes(IDocument doc,DocumentCommand docCommand,char quoteChar) throws BadLocationException {
  char nextChar=(char)0;
  char prevChar=(char)0;
  try {
    nextChar=doc.getChar(docCommand.offset);
    prevChar=doc.getChar(docCommand.offset - 1);
  }
 catch (  BadLocationException bex) {
  }
  if (nextChar == prevChar) {
    stepThrough(docCommand);
    return;
  }
  if (prevChar == quoteChar || nextChar == '#' || prevChar == '#') {
    return;
  }
  if (quoteChar == '\'') {
    if (prevChar == '"' || nextChar == '"') {
      return;
    }
  }
  if (quoteChar == '"') {
    if (prevChar == '\'' || nextChar == '\'') {
      return;
    }
  }
  if (nextChar == quoteChar) {
    return;
  }
  docCommand.text+=quoteChar;
  docCommand.caretOffset=docCommand.offset + 1;
  docCommand.shiftsCaret=false;
  return;
}
Program: 17431
Project: 17431
Buggy source:
/** 
 * Looks back in the document trying to find the matching tag for the given partition. Returns the start_tag_end partition if one is found, null otherwise.
 * @param closer
 * @return
 */
public CFEPartition getOpener(CFEPartition closer){
  if (!closer.getType().endsWith("String_Node_Str")) {
    return null;
  }
  try {
    Position[] category=fDocument.getPositions(fPositionCategory);
    int i=fDocument.computeIndexInCategory(fPositionCategory,closer.offset);
    i--;
    while (i >= 0) {
      CFEPartition p=(CFEPartition)category[i];
      if (p.getTagName() == null) {
        i--;
        continue;
      }
      if (p.getTagName().compareTo(closer.getTagName()) == 0) {
        if (p.getType().endsWith("String_Node_Str")) {
          return p;
        }
        return null;
      }
      i--;
    }
    return null;
  }
 catch (  BadLocationException e) {
    return null;
  }
catch (  BadPositionCategoryException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Looks back in the document trying to find the matching tag for the given partition. Returns the start_tag_end partition if one is found, null otherwise.
 * @param closer
 * @return
 */
public CFEPartition getOpener(CFEPartition closer){
  if (!closer.getType().endsWith("String_Node_Str")) {
    return null;
  }
  try {
    Position[] category=fDocument.getPositions(fPositionCategory);
    int i=fDocument.computeIndexInCategory(fPositionCategory,closer.offset);
    int nestingLevel=0;
    i--;
    while (i >= 0) {
      CFEPartition p=(CFEPartition)category[i];
      if (p.getTagName() == null) {
        i--;
        continue;
      }
      if (p.getTagName().compareTo(closer.getTagName()) == 0) {
        if (p.getType().endsWith("String_Node_Str")) {
          if (nestingLevel == 0) {
            return p;
          }
 else {
            nestingLevel--;
          }
        }
 else         if (p.getType().endsWith("String_Node_Str")) {
          nestingLevel++;
        }
      }
      i--;
    }
    return null;
  }
 catch (  BadLocationException e) {
    return null;
  }
catch (  BadPositionCategoryException e) {
    return null;
  }
}
Program: 17433
Project: 17433
Buggy source:
/** 
 * Has the user pressed enter from within a tag (i.e. they were editing the attributes)?
 * @param doc - Document that we're operating on
 * @param command - the command
 * @return - True: yes, enter pressed in a tag. False: Nope, outside of a tag.
 */
private boolean isEnterInTag(IDocument doc,DocumentCommand command){
  int position=command.offset - 1;
  String docData=doc.get();
  boolean openerFound=false;
  int i=position;
  try {
    for (; i > 0; i--) {
      if (docData.charAt(i) == '>')       return false;
      if (docData.charAt(i) == '<') {
        openerFound=true;
        break;
      }
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str");
    e.printStackTrace();
    return false;
  }
  return openerFound;
}

Fixed version (ground truth):
/** 
 * Has the user pressed enter from within a tag (i.e. they were editing the attributes)?
 * @param doc - Document that we're operating on
 * @param command - the command
 * @return - True: yes, enter pressed in a tag. False: Nope, outside of a tag.
 */
private boolean isEnterInTag(IDocument doc,DocumentCommand command){
  int position=command.offset - 1;
  String docData=doc.get();
  boolean openerFound=false;
  int i=position;
  try {
    for (; i > 0; i--) {
      if (docData.charAt(i) == '>')       return false;
      if (docData.charAt(i) == '<' && Character.isLetter(docData.charAt(i + 1))) {
        openerFound=true;
        break;
      }
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str");
    e.printStackTrace();
    return false;
  }
  return openerFound;
}
Program: 17435
Project: 17435
Buggy source:
/** 
 * Handles the insertion of quotes by the user. If the user has opened quotes then it inserts a closing quote after the opened quote and does not move the caret. If the user is closing some quotes it steps through the existing quote.
 * @param doc - The document that the command is being performed in
 * @param docCommand - the command to modify
 * @param quoteChar - the quote character that triggered this. This allows us to handle " and ' quotes.
 * @throws BadLocationException - ack.
 */
private void handleQuotes(IDocument doc,DocumentCommand docCommand,char quoteChar) throws BadLocationException {
  char nextChar=(char)0;
  try {
    nextChar=doc.getChar(docCommand.offset);
  }
 catch (  BadLocationException bex) {
  }
  if (nextChar == quoteChar) {
    docCommand.text="String_Node_Str";
    docCommand.shiftsCaret=false;
    docCommand.caretOffset=docCommand.offset + 1;
    return;
  }
  docCommand.text+=quoteChar;
  docCommand.caretOffset=docCommand.offset + 1;
  docCommand.shiftsCaret=false;
  return;
}

Fixed version (ground truth):
/** 
 * Handles the insertion of quotes by the user. If the user has opened quotes then it inserts a closing quote after the opened quote and does not move the caret. If the user is closing some quotes it steps through the existing quote.
 * @param doc - The document that the command is being performed in
 * @param docCommand - the command to modify
 * @param quoteChar - the quote character that triggered this. This allows us to handle " and ' quotes.
 * @throws BadLocationException - ack.
 */
private void handleQuotes(IDocument doc,DocumentCommand docCommand,char quoteChar) throws BadLocationException {
  char nextChar=(char)0;
  char prevChar=(char)0;
  try {
    nextChar=doc.getChar(docCommand.offset);
    prevChar=doc.getChar(docCommand.offset - 1);
  }
 catch (  BadLocationException bex) {
  }
  if (prevChar == quoteChar) {
    return;
  }
  if (prevChar == '#') {
    return;
  }
  if (nextChar == '#') {
    return;
  }
  if (nextChar == quoteChar) {
    docCommand.text="String_Node_Str";
    docCommand.shiftsCaret=false;
    docCommand.caretOffset=docCommand.offset + 1;
    return;
  }
  docCommand.text+=quoteChar;
  docCommand.caretOffset=docCommand.offset + 1;
  docCommand.shiftsCaret=false;
  return;
}