nus-yam/ex-repair huggingface dataset:
Program: 17437
Project: 17437
Buggy source:
/** 
 * Sets up the primary CFE Content Assistor. CFE now uses it's own series of content assist code to future proof the content assist process. This should allow developers to extend the CFE code easily and more reliably in the future resulting in fewer hacks and changes to the core code.
 */
private void setupPrimaryCFEContentAssist(){
  CFEPrimaryAssist mainCFAssistant=new CFEPrimaryAssist();
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.CF_START_TAG_BEGIN);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.CF_START_TAG_END);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.CF_TAG_ATTRIBS);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.HTM_END_TAG);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.HTM_START_TAG_BEGIN);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.HTM_START_TAG_END);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.HTM_TAG_ATTRIBS);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.UNK_TAG);
  assistant.setContentAssistProcessor(mainCFAssistant,IDocument.DEFAULT_CONTENT_TYPE);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.FORM_END_TAG);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.FORM_START_TAG_BEGIN);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.FORM_START_TAG_END);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.FORM_TAG_ATTRIBS);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.TABLE_END_TAG);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.TABLE_START_TAG_BEGIN);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.TABLE_START_TAG_END);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.FORM_TAG_ATTRIBS);
  assistant.setContentAssistProcessor(mainCFAssistant,CFPartitionScanner.J_SCRIPT);
}

Fixed version (ground truth):
/** 
 * Sets up the primary CFE Content Assistor. CFE now uses it's own series of content assist code to future proof the content assist process. This should allow developers to extend the CFE code easily and more reliably in the future resulting in fewer hacks and changes to the core code.
 */
private void setupPrimaryCFEContentAssist(){
  CFEPrimaryAssist mainCFAssistant=new CFEPrimaryAssist();
  for (int i=0; i < PartitionTypes.ALL_PARTITION_TYPES.length; i++) {
    assistant.setContentAssistProcessor(mainCFAssistant,PartitionTypes.ALL_PARTITION_TYPES[i]);
  }
}
Program: 17439
Project: 17439
Buggy source:
public ICompletionProposal[] getTagProposals(IAssistState state){
  Assert.isNotNull(state,"String_Node_Str");
  Assert.isNotNull(this.sourceDict,"String_Node_Str");
  int offset=state.getOffset();
  IDocument doc=state.getIDocument();
  char invokerChar=state.getTriggerData();
  String tagLimiting=state.getDataSoFar().substring(1).toLowerCase().trim();
  if (invokerChar == '\"') {
    try {
      if (doc.getLength() > offset && doc.getChar(offset) == '\"' && doc.getChar(offset - 2) != '=') {
        doc.replace(offset,1,"String_Node_Str");
        return new ICompletionProposal[0];
      }
    }
 catch (    BadLocationException ex) {
      ex.printStackTrace();
      return new ICompletionProposal[0];
    }
  }
  return makeSetToProposal(((SyntaxDictionaryInterface)this.sourceDict).getFilteredElements(tagLimiting),offset,CFEContentAssist.TAGTYPE,tagLimiting.length());
}

Fixed version (ground truth):
public ICompletionProposal[] getTagProposals(IAssistState state){
  Assert.isNotNull(state,"String_Node_Str");
  Assert.isNotNull(this.sourceDict,"String_Node_Str");
  int offset=state.getOffset();
  IDocument doc=state.getIDocument();
  char invokerChar=state.getTriggerData();
  boolean doubleQuoted=false;
  boolean singleQuoted=false;
  int tagStart=1;
  for (int i=state.getDataSoFar().length() - 1; i >= 0; i--) {
    char c=state.getDataSoFar().charAt(i);
    if (c == '"') {
      if (!singleQuoted) {
        doubleQuoted=!doubleQuoted;
      }
    }
    if (c == '\'') {
      if (!doubleQuoted) {
        singleQuoted=!singleQuoted;
      }
    }
    if (!doubleQuoted && !singleQuoted) {
      if (c == '<') {
        tagStart=i + 1;
        break;
      }
    }
  }
  String tagLimiting=state.getDataSoFar().substring(tagStart).toLowerCase().trim();
  if (invokerChar == '\"') {
    try {
      if (doc.getLength() > offset && doc.getChar(offset) == '\"' && doc.getChar(offset - 2) != '=') {
        doc.replace(offset,1,"String_Node_Str");
        return new ICompletionProposal[0];
      }
    }
 catch (    BadLocationException ex) {
      ex.printStackTrace();
      return new ICompletionProposal[0];
    }
  }
  return makeSetToProposal(((SyntaxDictionaryInterface)this.sourceDict).getFilteredElements(tagLimiting),offset,CFEContentAssist.TAGTYPE,tagLimiting.length());
}
Program: 17440
Project: 17440
Buggy source:
/** 
 * @param root
 * @param model
 */
private void addMarksToModel(boolean autoCollapse){
  try {
    if (model != null) {
      HashMap markerMap=new HashMap();
      scrubAnnotations();
      if (preferenceManager.foldCFMLComments()) {
        foldPartitions(markerMap,CFPartitionScanner.HTM_COMMENT,preferenceManager.collapseCFMLComments() && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
      }
      if (preferenceManager.foldHTMLComments()) {
        foldPartitions(markerMap,CFPartitionScanner.CF_COMMENT,preferenceManager.collapseHTMLComments() && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
      }
      for (int i=1; i < 9; i++) {
        if (preferenceManager.foldTag(i) && preferenceManager.foldingTagName(i).trim().length() > 0) {
          foldTags(markerMap,preferenceManager.foldingTagName(i).trim(),preferenceManager.collapseTag(i) && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
        }
      }
      Iterator x=markerMap.keySet().iterator();
      while (x.hasNext()) {
        ProjectionAnnotation p=(ProjectionAnnotation)x.next();
        boolean collapsed=((Boolean)markerMap.get(p)).booleanValue();
        if (collapsed) {
          model.collapse(p);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param root
 * @param model
 */
private void addMarksToModel(boolean autoCollapse){
  try {
    if (model != null) {
      HashMap markerMap=new HashMap();
      scrubAnnotations();
      if (preferenceManager.foldCFMLComments()) {
        foldPartitions(markerMap,CFPartitionScanner.CF_COMMENT,preferenceManager.collapseCFMLComments() && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
      }
      if (preferenceManager.foldHTMLComments()) {
        foldPartitions(markerMap,CFPartitionScanner.HTM_COMMENT,preferenceManager.collapseHTMLComments() && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
      }
      for (int i=1; i < 9; i++) {
        if (preferenceManager.foldTag(i) && preferenceManager.foldingTagName(i).trim().length() > 0) {
          foldTags(markerMap,preferenceManager.foldingTagName(i).trim(),preferenceManager.collapseTag(i) && autoCollapse,preferenceManager.minimumFoldingLines() - 1);
        }
      }
      Iterator x=markerMap.keySet().iterator();
      while (x.hasNext()) {
        ProjectionAnnotation p=(ProjectionAnnotation)x.next();
        boolean collapsed=((Boolean)markerMap.get(p)).booleanValue();
        if (collapsed) {
          model.collapse(p);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17442
Project: 17442
Buggy source:
/** 
 * Highlights the given widget region.
 * @param gc the GC to draw into
 * @param offset the offset of the widget region
 * @param length the length of the widget region
 */
private void draw(GC gc,int offset,int length){
  if (gc != null) {
    Point left=fTextWidget.getLocationAtOffset(offset);
    Point right=fTextWidget.getLocationAtOffset(offset + length);
    IPreferenceStore store=CFMLPlugin.getDefault().getPreferenceStore();
    int style=store.getInt(EditorPreferenceConstants.P_BRACKET_MATCHING_STYLE);
switch (style) {
case EditorPreferenceConstants.BRACKET_MATCHING_OUTLINE:
{
        gc.setForeground(fColor);
        gc.drawRectangle(left.x,left.y,right.x - left.x - 1,fTextWidget.getLineHeight() - 1);
        break;
      }
case EditorPreferenceConstants.BRACKET_MATCHING_BACKGROUND:
{
      gc.setBackground(fColor);
      gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
      break;
    }
case EditorPreferenceConstants.BRACKET_MATCHING_BOLD:
{
    gc.setForeground(fColor);
    gc.getFont();
    FontData[] data=gc.getFont().getFontData();
    data[0].setStyle(SWT.BOLD);
    Font font=new Font(fTextWidget.getDisplay(),data);
    gc.setFont(font);
    gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
    font.dispose();
    break;
  }
}
}
 else {
fTextWidget.redrawRange(offset,length,true);
}
}

Fixed version (ground truth):
/** 
 * Highlights the given widget region.
 * @param gc the GC to draw into
 * @param offset the offset of the widget region
 * @param length the length of the widget region
 */
private void draw(GC gc,int offset,int length){
  if (gc != null) {
    Point left=fTextWidget.getLocationAtOffset(offset);
    Point right=fTextWidget.getLocationAtOffset(offset + length);
    IPreferenceStore store=CFMLPlugin.getDefault().getPreferenceStore();
    int style=store.getInt(EditorPreferenceConstants.P_BRACKET_MATCHING_STYLE);
switch (style) {
case EditorPreferenceConstants.BRACKET_MATCHING_OUTLINE:
{
        gc.setForeground(fColor);
        gc.drawRectangle(left.x,left.y,right.x - left.x - 1,fTextWidget.getLineHeight() - 1);
        break;
      }
case EditorPreferenceConstants.BRACKET_MATCHING_BACKGROUND:
{
      gc.setBackground(fColor);
      gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
      break;
    }
case EditorPreferenceConstants.BRACKET_MATCHING_BOLD:
{
    gc.setForeground(fColor);
    Font oldFont=gc.getFont();
    FontData[] data=gc.getFont().getFontData();
    data[0].setStyle(SWT.BOLD);
    Font font=new Font(fTextWidget.getDisplay(),data);
    gc.setFont(font);
    gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
    gc.setFont(oldFont);
    font.dispose();
    break;
  }
}
}
 else {
fTextWidget.redrawRange(offset,length,true);
}
}
Program: 17446
Project: 17446
Buggy source:
/** 
 * This defines what sections (partitions) are valid for the document
 */
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer){
  return new String[]{IDocument.DEFAULT_CONTENT_TYPE,CFPartitionScanner.HTM_END_TAG,CFPartitionScanner.HTM_TAG_ATTRIBS,CFPartitionScanner.HTM_START_TAG_BEGIN,CFPartitionScanner.HTM_START_TAG_END,CFPartitionScanner.CF_COMMENT,CFPartitionScanner.HTM_COMMENT,CFPartitionScanner.DOCTYPE,CFPartitionScanner.CF_START_TAG_BEGIN,CFPartitionScanner.CF_START_TAG_END,CFPartitionScanner.CF_TAG_ATTRIBS,CFPartitionScanner.CF_END_TAG,CFPartitionScanner.CF_SCRIPT,CFPartitionScanner.J_SCRIPT,CFPartitionScanner.CSS,CFPartitionScanner.SQL,CFPartitionScanner.UNK_TAG,CFPartitionScanner.FORM_END_TAG,CFPartitionScanner.FORM_START_TAG_BEGIN,CFPartitionScanner.FORM_START_TAG_END,CFPartitionScanner.TABLE_END_TAG,CFPartitionScanner.TABLE_START_TAG_BEGIN,CFPartitionScanner.TABLE_START_TAG_END};
}

Fixed version (ground truth):
/** 
 * This defines what sections (partitions) are valid for the document
 */
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer){
  return new String[]{IDocument.DEFAULT_CONTENT_TYPE,CFPartitionScanner.HTM_END_TAG,CFPartitionScanner.HTM_TAG_ATTRIBS,CFPartitionScanner.HTM_START_TAG_BEGIN,CFPartitionScanner.HTM_START_TAG_END,CFPartitionScanner.CF_COMMENT,CFPartitionScanner.HTM_COMMENT,CFPartitionScanner.DOCTYPE,CFPartitionScanner.CF_START_TAG_BEGIN,CFPartitionScanner.CF_START_TAG_END,CFPartitionScanner.CF_TAG_ATTRIBS,CFPartitionScanner.CF_END_TAG,CFPartitionScanner.CF_SCRIPT,CFPartitionScanner.J_SCRIPT,CFPartitionScanner.CSS,CFPartitionScanner.SQL,CFPartitionScanner.UNK_TAG,CFPartitionScanner.FORM_END_TAG,CFPartitionScanner.FORM_START_TAG_BEGIN,CFPartitionScanner.FORM_TAG_ATTRIBS,CFPartitionScanner.FORM_START_TAG_END,CFPartitionScanner.TABLE_END_TAG,CFPartitionScanner.TABLE_START_TAG_BEGIN,CFPartitionScanner.TABLE_TAG_ATTRIBS,CFPartitionScanner.TABLE_START_TAG_END};
}
Program: 17454
Project: 17454
Buggy source:
/** 
 * Runs all configured rules at the current document offset and returns a token to indicate what the partition type should be at that offset. The scanner  offset is automatically updated.
 */
public IToken nextToken(){
  if (fContentType == null || fContentType == CF_SCRIPT || fContentType == J_SCRIPT || fContentType == CSS || fContentType == SQL || fRules == null) {
    IToken token;
    while (true) {
      fTokenOffset=fOffset;
      fColumn=UNDEFINED;
      if (fRules != null) {
        for (int i=0; i < fRules.length; i++) {
          token=(fRules[i].evaluate(this));
          if (!token.isUndefined()) {
            return token;
          }
        }
      }
      if (read() == EOF)       return Token.EOF;
 else {
        return fDefaultReturnToken;
      }
    }
  }
  fColumn=UNDEFINED;
  boolean resume=(fPartitionOffset > -1 && fPartitionOffset < fOffset);
  fTokenOffset=resume ? fPartitionOffset : fOffset;
  IPredicateRule rule;
  IToken token;
  for (int i=0; i < fRules.length; i++) {
    rule=(IPredicateRule)fRules[i];
    token=rule.getSuccessToken();
    if (fContentType.equals(token.getData().toString()) || fContentType.equals(token.getData().toString() + "String_Node_Str") || fContentType.equals(token.getData().toString() + "String_Node_Str")|| fContentType.equals(token.getData().toString() + "String_Node_Str")) {
      token=rule.evaluate(this,resume);
      if (!token.isUndefined()) {
        fContentType=null;
        return token;
      }
    }
  }
  fContentType=null;
  if (resume) {
    fOffset=fPartitionOffset;
  }
  return super.nextToken();
}

Fixed version (ground truth):
/** 
 * Runs all configured rules at the current document offset and returns a token to indicate what the partition type should be at that offset. The scanner  offset is automatically updated.
 */
public IToken nextToken(){
  if (fContentType == null || fRules == null) {
    IToken token;
    while (true) {
      fTokenOffset=fOffset;
      fColumn=UNDEFINED;
      if (fRules != null) {
        for (int i=0; i < fRules.length; i++) {
          token=(fRules[i].evaluate(this));
          if (!token.isUndefined()) {
            return token;
          }
        }
      }
      if (read() == EOF)       return Token.EOF;
 else {
        return fDefaultReturnToken;
      }
    }
  }
  fColumn=UNDEFINED;
  boolean resume=(fPartitionOffset > -1 && fPartitionOffset < fOffset);
  fTokenOffset=resume ? fPartitionOffset : fOffset;
  IPredicateRule rule;
  IToken token;
  for (int i=0; i < fRules.length; i++) {
    rule=(IPredicateRule)fRules[i];
    token=rule.getSuccessToken();
    if (fContentType.equals(token.getData().toString()) || fContentType.equals(token.getData().toString() + "String_Node_Str") || fContentType.equals(token.getData().toString() + "String_Node_Str")|| fContentType.equals(token.getData().toString() + "String_Node_Str")) {
      token=rule.evaluate(this,resume);
      if (!token.isUndefined()) {
        fContentType=null;
        return token;
      }
    }
  }
  fContentType=null;
  if (resume) {
    fOffset=fPartitionOffset;
  }
  return super.nextToken();
}
Program: 17455
Project: 17455
Buggy source:
/** 
 * Handles a redraw request.
 * @param gc the GC to draw into.
 */
private void handleDrawRequest(GC gc){
  if (fPairPosition.isDeleted)   return;
  int offset=fPairPosition.getOffset();
  int length=fPairPosition.getLength();
  if (length < 1)   return;
  if (fSourceViewer instanceof ITextViewerExtension5) {
    ITextViewerExtension5 extension=(ITextViewerExtension5)fSourceViewer;
    IRegion widgetRange=extension.modelRange2WidgetRange(new Region(offset,length));
    if (widgetRange == null)     return;
    try {
      IDocument doc=fSourceViewer.getDocument();
      int startLine=doc.getLineOfOffset(offset);
      int endLine=doc.getLineOfOffset(offset + length);
      if (extension.modelLine2WidgetLine(startLine) == -1 || extension.modelLine2WidgetLine(endLine) == -1)       return;
    }
 catch (    BadLocationException e) {
      return;
    }
    offset=widgetRange.getOffset();
    length=widgetRange.getLength();
  }
 else {
    IRegion region=fSourceViewer.getVisibleRegion();
    if (region.getOffset() > offset || region.getOffset() + region.getLength() < offset + length)     return;
    offset-=region.getOffset();
  }
  if (ICharacterPairMatcher.RIGHT == fAnchor) {
    int endOffset=offset + length + 1;
    draw(gc,offset,1);
    draw(gc,endOffset,1);
  }
 else {
    draw(gc,offset,1);
    draw(gc,offset + length - 1,1);
  }
}

Fixed version (ground truth):
/** 
 * Handles a redraw request.
 * @param gc the GC to draw into.
 */
private void handleDrawRequest(GC gc){
  if (fPairPosition.isDeleted)   return;
  int offset=fPairPosition.getOffset();
  int length=fPairPosition.getLength();
  if (length < 1)   return;
  if (fSourceViewer instanceof ITextViewerExtension5) {
    ITextViewerExtension5 extension=(ITextViewerExtension5)fSourceViewer;
    IRegion widgetRange=extension.modelRange2WidgetRange(new Region(offset,length));
    if (widgetRange == null)     return;
    try {
      IDocument doc=fSourceViewer.getDocument();
      int startLine=doc.getLineOfOffset(offset);
      int endLine=doc.getLineOfOffset(offset + length);
      if (extension.modelLine2WidgetLine(startLine) == -1 || extension.modelLine2WidgetLine(endLine) == -1)       return;
    }
 catch (    BadLocationException e) {
      return;
    }
    offset=widgetRange.getOffset();
    length=widgetRange.getLength();
  }
 else {
    IRegion region=fSourceViewer.getVisibleRegion();
    if (region.getOffset() > offset || region.getOffset() + region.getLength() < offset + length)     return;
    offset-=region.getOffset();
  }
  int endOffset=offset + length - 1;
  draw(gc,offset,1);
  draw(gc,endOffset,1);
}
Program: 17456
Project: 17456
Buggy source:
/** 
 * Highlights the given widget region.
 * @param gc the GC to draw into
 * @param offset the offset of the widget region
 * @param length the length of the widget region
 */
private void draw(GC gc,int offset,int length){
  if (gc != null) {
    Point left=fTextWidget.getLocationAtOffset(offset);
    Point right=fTextWidget.getLocationAtOffset(offset + length);
    gc.setBackground(fColor);
    gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
  }
 else {
    fTextWidget.redrawRange(offset,length,true);
  }
}

Fixed version (ground truth):
/** 
 * Highlights the given widget region.
 * @param gc the GC to draw into
 * @param offset the offset of the widget region
 * @param length the length of the widget region
 */
private void draw(GC gc,int offset,int length){
  if (gc != null) {
    Point left=fTextWidget.getLocationAtOffset(offset);
    Point right=fTextWidget.getLocationAtOffset(offset + length);
    IPreferenceStore store=CFMLPlugin.getDefault().getPreferenceStore();
    int style=store.getInt(EditorPreferenceConstants.P_BRACKET_MATCHING_STYLE);
switch (style) {
case EditorPreferenceConstants.BRACKET_MATCHING_OUTLINE:
{
        gc.setForeground(fColor);
        gc.drawRectangle(left.x,left.y,right.x - left.x - 1,fTextWidget.getLineHeight() - 1);
        break;
      }
case EditorPreferenceConstants.BRACKET_MATCHING_BACKGROUND:
{
      gc.setBackground(fColor);
      gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
      break;
    }
case EditorPreferenceConstants.BRACKET_MATCHING_BOLD:
{
    gc.setForeground(fColor);
    gc.getFont();
    FontData[] data=gc.getFont().getFontData();
    data[0].setStyle(SWT.BOLD);
    Font font=new Font(fTextWidget.getDisplay(),data);
    gc.setFont(font);
    gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y + 1);
    break;
  }
}
}
 else {
fTextWidget.redrawRange(offset,length,true);
}
}
Program: 17460
Project: 17460
Buggy source:
public EditorPreferencePage(){
  fCheckBoxes=new HashMap();
  fCheckBoxListener=new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent selectionevent){
    }
    public void widgetSelected(    SelectionEvent e){
      Button button=(Button)e.widget;
      fOverlayStore.setValue((String)fCheckBoxes.get(button),button.getSelection());
    }
  }
;
  fTextFields=new HashMap();
  fTextFieldListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      Text text=(Text)e.widget;
      fOverlayStore.setValue((String)fTextFields.get(text),text.getText());
    }
  }
;
  fNumberFields=new ArrayList();
  fNumberFieldListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      numberFieldChanged((Text)e.widget);
    }
  }
;
  fFieldsInitialized=false;
  fMasterSlaveListeners=new ArrayList();
  setDescription("String_Node_Str");
  setPreferenceStore(CFMLPlugin.getDefault().getPreferenceStore());
  fOverlayStore=createOverlayStore();
}

Fixed version (ground truth):
public EditorPreferencePage(){
  fCheckBoxes=new HashMap();
  fCheckBoxListener=new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent selectionevent){
    }
    public void widgetSelected(    SelectionEvent e){
      Button button=(Button)e.widget;
      fOverlayStore.setValue((String)fCheckBoxes.get(button),button.getSelection());
    }
  }
;
  fTextFields=new HashMap();
  fTextFieldListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      Text text=(Text)e.widget;
      fOverlayStore.setValue((String)fTextFields.get(text),text.getText());
    }
  }
;
  fComboBoxes=new HashMap();
  fComboBoxListener=new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      CCombo combo=(CCombo)e.widget;
      fOverlayStore.setValue((String)fComboBoxes.get(combo),combo.getSelectionIndex());
    }
    public void widgetSelected(    SelectionEvent e){
      CCombo combo=(CCombo)e.widget;
      fOverlayStore.setValue((String)fComboBoxes.get(combo),combo.getSelectionIndex());
    }
  }
;
  fNumberFields=new ArrayList();
  fNumberFieldListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      numberFieldChanged((Text)e.widget);
    }
  }
;
  fFieldsInitialized=false;
  fMasterSlaveListeners=new ArrayList();
  setDescription("String_Node_Str");
  setPreferenceStore(CFMLPlugin.getDefault().getPreferenceStore());
  fOverlayStore=createOverlayStore();
}
Program: 17461
Project: 17461
Buggy source:
private Control addTextField(Composite composite,String label,String key,int textLimit,int indentation,boolean isNumber){
  Label labelControl=new Label(composite,0);
  labelControl.setText(label);
  GridData gd=new GridData(32);
  gd.horizontalIndent=indentation;
  labelControl.setLayoutData(gd);
  Text textControl=new Text(composite,2052);
  gd=new GridData(32);
  gd.widthHint=convertWidthInCharsToPixels(textLimit + 1);
  textControl.setLayoutData(gd);
  textControl.setTextLimit(textLimit);
  fTextFields.put(textControl,key);
  if (isNumber) {
    fNumberFields.add(textControl);
    textControl.addModifyListener(fNumberFieldListener);
  }
 else {
    textControl.addModifyListener(fTextFieldListener);
  }
  return textControl;
}

Fixed version (ground truth):
private Control addTextField(Composite composite,String label,String key,int textLimit,int indentation,boolean isNumber){
  Label labelControl=new Label(composite,SWT.NONE);
  labelControl.setText(label);
  GridData gd=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gd.horizontalIndent=indentation;
  labelControl.setLayoutData(gd);
  Text textControl=new Text(composite,SWT.BORDER | SWT.SINGLE);
  gd=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gd.widthHint=convertWidthInCharsToPixels(textLimit + 1);
  textControl.setLayoutData(gd);
  textControl.setTextLimit(textLimit);
  fTextFields.put(textControl,key);
  if (isNumber) {
    fNumberFields.add(textControl);
    textControl.addModifyListener(fNumberFieldListener);
  }
 else {
    textControl.addModifyListener(fTextFieldListener);
  }
  return textControl;
}
Program: 17462
Project: 17462
Buggy source:
private Button addCheckBox(Composite parent,String label,String key,int indentation){
  Button checkBox=new Button(parent,32);
  checkBox.setText(label);
  GridData gd=new GridData(32);
  gd.horizontalIndent=indentation;
  gd.horizontalSpan=2;
  checkBox.setLayoutData(gd);
  checkBox.addSelectionListener(fCheckBoxListener);
  fCheckBoxes.put(checkBox,key);
  return checkBox;
}

Fixed version (ground truth):
private Button addCheckBox(Composite parent,String label,String key,int indentation){
  Button checkBox=new Button(parent,SWT.CHECK);
  checkBox.setText(label);
  GridData gd=new GridData(32);
  gd.horizontalIndent=indentation;
  gd.horizontalSpan=2;
  checkBox.setLayoutData(gd);
  checkBox.addSelectionListener(fCheckBoxListener);
  fCheckBoxes.put(checkBox,key);
  return checkBox;
}
Program: 17463
Project: 17463
Buggy source:
private void initializeFields(){
  Button b;
  String key;
  for (Iterator e=fCheckBoxes.keySet().iterator(); e.hasNext(); b.setSelection(fOverlayStore.getBoolean(key))) {
    b=(Button)e.next();
    key=(String)fCheckBoxes.get(b);
  }
  Text t;
  for (Iterator e=fTextFields.keySet().iterator(); e.hasNext(); t.setText(fOverlayStore.getString(key))) {
    t=(Text)e.next();
    key=(String)fTextFields.get(t);
  }
  fFieldsInitialized=true;
  updateStatus(validatePositiveNumber("String_Node_Str"));
  SelectionListener listener;
  for (Iterator iter=fMasterSlaveListeners.iterator(); iter.hasNext(); listener.widgetSelected(null))   listener=(SelectionListener)iter.next();
}

Fixed version (ground truth):
private void initializeFields(){
  Button b;
  String key;
  for (Iterator e=fCheckBoxes.keySet().iterator(); e.hasNext(); b.setSelection(fOverlayStore.getBoolean(key))) {
    b=(Button)e.next();
    key=(String)fCheckBoxes.get(b);
  }
  Text t;
  for (Iterator e=fTextFields.keySet().iterator(); e.hasNext(); t.setText(fOverlayStore.getString(key))) {
    t=(Text)e.next();
    key=(String)fTextFields.get(t);
  }
  CCombo c;
  for (Iterator e=fComboBoxes.keySet().iterator(); e.hasNext(); c.select(fOverlayStore.getInt(key))) {
    c=(CCombo)e.next();
    key=(String)fComboBoxes.get(c);
  }
  fFieldsInitialized=true;
  updateStatus(validatePositiveNumber("String_Node_Str"));
  SelectionListener listener;
  for (Iterator iter=fMasterSlaveListeners.iterator(); iter.hasNext(); listener.widgetSelected(null))   listener=(SelectionListener)iter.next();
}
Program: 17465
Project: 17465
Buggy source:
protected boolean setDocumentContent(IDocument document,IEditorInput editorInput,String encoding) throws CoreException {
  if (editorInput instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)editorInput;
    FileInputStream contentStream=null;
    try {
      contentStream=new FileInputStream(input.getPath(editorInput).toFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
    setDocumentContent(document,contentStream,encoding);
  }
  if (editorInput instanceof FtpFileEditorInput) {
    FtpFileEditorInput input=(FtpFileEditorInput)editorInput;
    FtpConnection connection=FtpConnection.getInstance();
    BufferedInputStream contentStream=null;
    contentStream=connection.getInputStream(input.getPath(editorInput).toString());
    setDocumentContent(document,contentStream,encoding);
  }
  return super.setDocumentContent(document,editorInput,encoding);
}

Fixed version (ground truth):
protected boolean setDocumentContent(IDocument document,IEditorInput editorInput,String encoding) throws CoreException {
  if (editorInput instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)editorInput;
    FileInputStream contentStream=null;
    try {
      contentStream=new FileInputStream(input.getPath(editorInput).toFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
    setDocumentContent(document,contentStream,encoding);
  }
  if (editorInput instanceof RemoteFileEditorInput) {
    RemoteFileEditorInput input=(RemoteFileEditorInput)editorInput;
    FTPConnection connection=new FTPConnection();
    BufferedInputStream contentStream=null;
    contentStream=connection.getInputStream(input.getPath(editorInput).toString());
    setDocumentContent(document,contentStream,encoding);
  }
  return super.setDocumentContent(document,editorInput,encoding);
}
Program: 17466
Project: 17466
Buggy source:
public boolean isReadOnly(Object element){
  if (element instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)element;
    return !input.getPath(input).toFile().canWrite();
  }
  if (element instanceof FtpFileEditorInput) {
    FtpFileEditorInput input=(FtpFileEditorInput)element;
    return !input.canWrite();
  }
  return super.isReadOnly(element);
}

Fixed version (ground truth):
public boolean isReadOnly(Object element){
  if (element instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)element;
    return !input.getPath(input).toFile().canWrite();
  }
  if (element instanceof RemoteFileEditorInput) {
    RemoteFileEditorInput input=(RemoteFileEditorInput)element;
    return !input.canWrite();
  }
  return super.isReadOnly(element);
}
Program: 17467
Project: 17467
Buggy source:
protected void doSaveDocument(IProgressMonitor monitor,Object element,IDocument document,boolean overwrite) throws CoreException {
  if (document instanceof ICFDocument) {
    ((ICFDocument)document).clearAllMarkers();
    ((ICFDocument)document).parseDocument();
  }
  if (element instanceof JavaFileEditorInput) {
    try {
      saveExternalFile((JavaFileEditorInput)element,document);
    }
 catch (    IOException e) {
      Status status=new Status(IStatus.ERROR,"String_Node_Str",IStatus.OK,e.getMessage(),e);
      throw new CoreException(status);
    }
  }
  if (element instanceof FtpFileEditorInput) {
    try {
      saveExternalFile((FtpFileEditorInput)element,document);
    }
 catch (    IOException e) {
      Status status=new Status(IStatus.ERROR,"String_Node_Str",IStatus.OK,e.getMessage(),e);
      throw new CoreException(status);
    }
  }
  super.doSaveDocument(monitor,element,document,overwrite);
}

Fixed version (ground truth):
protected void doSaveDocument(IProgressMonitor monitor,Object element,IDocument document,boolean overwrite) throws CoreException {
  if (document instanceof ICFDocument) {
    ((ICFDocument)document).clearAllMarkers();
    ((ICFDocument)document).parseDocument();
  }
  if (element instanceof JavaFileEditorInput) {
    try {
      saveExternalFile((JavaFileEditorInput)element,document);
    }
 catch (    IOException e) {
      Status status=new Status(IStatus.ERROR,"String_Node_Str",IStatus.OK,e.getMessage(),e);
      throw new CoreException(status);
    }
  }
  if (element instanceof RemoteFileEditorInput) {
    try {
      saveExternalFile((RemoteFileEditorInput)element,document);
    }
 catch (    IOException e) {
      Status status=new Status(IStatus.ERROR,"String_Node_Str",IStatus.OK,e.getMessage(),e);
      throw new CoreException(status);
    }
  }
  super.doSaveDocument(monitor,element,document,overwrite);
}
Program: 17468
Project: 17468
Buggy source:
private void saveExternalFile(FtpFileEditorInput input,IDocument doc) throws IOException {
  BufferedOutputStream contentStream=null;
  FtpConnection connection=FtpConnection.getInstance();
  connection.saveFile(doc.get().getBytes(),input.getPath(input).toString());
}

Fixed version (ground truth):
private void saveExternalFile(RemoteFileEditorInput input,IDocument doc) throws IOException {
  BufferedOutputStream contentStream=null;
  FTPConnection connection=new FTPConnection();
  connection.saveFile(doc.get().getBytes(),input.getPath(input).toString());
}
Program: 17470
Project: 17470
Buggy source:
public boolean isModifiable(Object element){
  if (!isStateValidated(element)) {
    if (element instanceof IFileEditorInput) {
      return true;
    }
  }
  if (element instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)element;
    return input.getPath(input).toFile().canWrite();
  }
  if (element instanceof FtpFileEditorInput) {
    FtpFileEditorInput input=(FtpFileEditorInput)element;
    return input.canWrite();
  }
  return super.isModifiable(element);
}

Fixed version (ground truth):
public boolean isModifiable(Object element){
  if (!isStateValidated(element)) {
    if (element instanceof IFileEditorInput) {
      return true;
    }
  }
  if (element instanceof JavaFileEditorInput) {
    JavaFileEditorInput input=(JavaFileEditorInput)element;
    return input.getPath(input).toFile().canWrite();
  }
  if (element instanceof RemoteFileEditorInput) {
    RemoteFileEditorInput input=(RemoteFileEditorInput)element;
    return input.canWrite();
  }
  return super.isModifiable(element);
}
Program: 17471
Project: 17471
Buggy source:
/** 
 * Handles a redraw request.
 * @param gc the GC to draw into.
 */
private void handleDrawRequest(GC gc){
  if (fPairPosition.isDeleted)   return;
  int offset=fPairPosition.getOffset();
  int length=fPairPosition.getLength();
  if (length < 1)   return;
  if (fSourceViewer instanceof ITextViewerExtension5) {
    ITextViewerExtension5 extension=(ITextViewerExtension5)fSourceViewer;
    IRegion widgetRange=extension.modelRange2WidgetRange(new Region(offset,length));
    if (widgetRange == null)     return;
    try {
      IDocument doc=fSourceViewer.getDocument();
      int startLine=doc.getLineOfOffset(offset);
      int endLine=doc.getLineOfOffset(offset + length);
      if (extension.modelLine2WidgetLine(startLine) == -1 || extension.modelLine2WidgetLine(endLine) == -1)       return;
    }
 catch (    BadLocationException e) {
      return;
    }
    offset=widgetRange.getOffset();
    length=widgetRange.getLength();
  }
 else {
    IRegion region=fSourceViewer.getVisibleRegion();
    if (region.getOffset() > offset || region.getOffset() + region.getLength() < offset + length)     return;
    offset-=region.getOffset();
  }
  if (ICharacterPairMatcher.RIGHT == fAnchor) {
    int endOffset=offset + length;
    if (length > 1) {
      endOffset+=1;
    }
    draw(gc,offset,1);
    draw(gc,endOffset,1);
  }
 else {
    draw(gc,offset,1);
    draw(gc,offset + length - 1,1);
  }
}

Fixed version (ground truth):
/** 
 * Handles a redraw request.
 * @param gc the GC to draw into.
 */
private void handleDrawRequest(GC gc){
  if (fPairPosition.isDeleted)   return;
  int offset=fPairPosition.getOffset();
  int length=fPairPosition.getLength();
  if (length < 1)   return;
  if (fSourceViewer instanceof ITextViewerExtension5) {
    ITextViewerExtension5 extension=(ITextViewerExtension5)fSourceViewer;
    IRegion widgetRange=extension.modelRange2WidgetRange(new Region(offset,length));
    if (widgetRange == null)     return;
    try {
      IDocument doc=fSourceViewer.getDocument();
      int startLine=doc.getLineOfOffset(offset);
      int endLine=doc.getLineOfOffset(offset + length);
      if (extension.modelLine2WidgetLine(startLine) == -1 || extension.modelLine2WidgetLine(endLine) == -1)       return;
    }
 catch (    BadLocationException e) {
      return;
    }
    offset=widgetRange.getOffset();
    length=widgetRange.getLength();
  }
 else {
    IRegion region=fSourceViewer.getVisibleRegion();
    if (region.getOffset() > offset || region.getOffset() + region.getLength() < offset + length)     return;
    offset-=region.getOffset();
  }
  if (ICharacterPairMatcher.RIGHT == fAnchor) {
    int endOffset=offset + length + 1;
    draw(gc,offset,1);
    draw(gc,endOffset,1);
  }
 else {
    draw(gc,offset,1);
    draw(gc,offset + length - 1,1);
  }
}
Program: 17472
Project: 17472
Buggy source:
public Object[] getElements(Object inputElement){
  String[] connections=FtpConnectionProperties.getConnectionIds();
  ArrayList items=new ArrayList();
  items.add(new LocalFileSystem());
  for (int i=0; i < connections.length; i++) {
    FtpConnectionProperties connectionProperties=new FtpConnectionProperties(connections[i]);
    items.add(connectionProperties);
  }
  return items.toArray();
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  String[] connections=FTPConnectionProperties.getConnectionIds();
  ArrayList items=new ArrayList();
  items.add(new LocalFileSystem());
  for (int i=0; i < connections.length; i++) {
    FTPConnectionProperties connectionProperties=new FTPConnectionProperties(connections[i]);
    FTPConnection connection=new FTPConnection();
    connection.setConnectionProperties(connectionProperties);
    items.add(connection);
  }
  return items.toArray();
}
Program: 17473
Project: 17473
Buggy source:
public Object[] getChildren(Object parentElement){
  try {
    if (fileProvider == null) {
      return new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (parentElement instanceof LocalFileSystem || parentElement instanceof FtpConnectionProperties) {
      return fileProvider.getRoots();
    }
 else     if (parentElement instanceof RemoteFile) {
      RemoteFile file=(RemoteFile)parentElement;
      return fileProvider.getChildren(((RemoteFile)parentElement).getAbsolutePath(),directoryFilter);
    }
 else {
      return fileProvider.getChildren(parentElement.toString(),directoryFilter);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}

Fixed version (ground truth):
public Object[] getChildren(Object parentElement){
  try {
    if (fileProvider == null) {
      return new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (parentElement instanceof IFileProvider) {
      return fileProvider.getRoots();
    }
 else     if (parentElement instanceof RemoteFile) {
      RemoteFile file=(RemoteFile)parentElement;
      return fileProvider.getChildren(((RemoteFile)parentElement).getAbsolutePath(),directoryFilter);
    }
 else {
      return fileProvider.getChildren(parentElement.toString(),directoryFilter);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}
Program: 17474
Project: 17474
Buggy source:
public boolean hasChildren(Object element){
  try {
    if (element instanceof RemoteFile) {
      return ((RemoteFile)element).isDirectory() & ((RemoteFile)element).canRead();
    }
 else     if (element instanceof File) {
      return ((File)element).isDirectory();
    }
 else     if (element instanceof String && element.toString().equals(FtpConnection.CONNECT_FAILED)) {
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean hasChildren(Object element){
  try {
    if (element instanceof RemoteFile) {
      return ((RemoteFile)element).isDirectory() & ((RemoteFile)element).canRead();
    }
 else     if (element instanceof File) {
      return ((File)element).isDirectory();
    }
 else     if (element instanceof String && element.toString().equals(FTPConnection.CONNECT_FAILED)) {
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 17475
Project: 17475
Buggy source:
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  this.viewer=viewer;
  try {
    if (fileProvider != null) {
      fileProvider.dispose();
    }
    if (newInput instanceof IFileProvider) {
      AlertUtils.showStatusErrorMessage(null,viewpart);
      AlertUtils.showStatusMessage("String_Node_Str",viewpart);
      fileProvider=(IFileProvider)newInput;
    }
 else     if (newInput instanceof FtpConnectionProperties) {
      fileProvider=FtpConnection.getInstance();
      ((FtpConnection)fileProvider).connect((FtpConnectionProperties)newInput);
    }
 else {
      fileProvider=null;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  this.viewer=viewer;
  try {
    if (fileProvider != null) {
      fileProvider.dispose();
    }
    if (newInput instanceof IFileProvider) {
      AlertUtils.showStatusErrorMessage(null,viewpart);
      fileProvider=(IFileProvider)newInput;
      fileProvider.setViewPart(this.viewpart);
      fileProvider.connect();
    }
 else {
      fileProvider=null;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17476
Project: 17476
Buggy source:
public Object[] getElements(Object inputElement){
  try {
    if (fileProvider == null) {
      return new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (inputElement != null) {
      if (inputElement instanceof LocalFileSystem || inputElement instanceof FtpConnectionProperties) {
        return new String[0];
      }
      String directoryName=inputElement.toString();
      if (directoryName.indexOf("String_Node_Str") == 0) {
        directoryName=directoryName.substring(1,directoryName.length() - 1);
      }
      Object[] files=fileProvider.getChildren(directoryName,fileFilter);
      return files;
    }
 else {
      return new String[]{"String_Node_Str"};
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  try {
    if (fileProvider == null) {
      return new Object[]{IFileProvider.INVALID_FILESYSTEM};
    }
    if (inputElement != null) {
      if (inputElement instanceof LocalFileSystem || inputElement instanceof FTPConnectionProperties) {
        return new String[0];
      }
      String directoryName=inputElement.toString();
      if (directoryName.indexOf("String_Node_Str") == 0) {
        directoryName=directoryName.substring(1,directoryName.length() - 1);
      }
      Object[] files=fileProvider.getChildren(directoryName,fileFilter);
      return files;
    }
 else {
      return new String[]{"String_Node_Str"};
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new Object[]{"String_Node_Str" + e.getMessage()};
  }
}
Program: 17477
Project: 17477
Buggy source:
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  try {
    if (newInput instanceof IFileProvider) {
      fileProvider=(IFileProvider)newInput;
    }
 else     if (newInput instanceof FtpConnectionProperties) {
      fileProvider=FtpConnection.getInstance();
      FtpConnection ftpClient=(FtpConnection)fileProvider;
      if (!ftpClient.connectFailed()) {
        ftpClient.connect();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  try {
    if (newInput instanceof IFileProvider) {
      fileProvider=(IFileProvider)newInput;
      fileProvider.connect();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17478
Project: 17478
Buggy source:
public void handleEvent(Event e){
  try {
    FtpConnection.getInstance().connect();
    disconnectItem.setEnabled(true);
    connectItem.setEnabled(false);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void handleEvent(Event e){
  try {
    fileProvider.connect();
    disconnectItem.setEnabled(true);
    connectItem.setEnabled(false);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 17481
Project: 17481
Buggy source:
/** 
 * Set the background color of the editor window based on the user's preferences
 */
private void setBackgroundColor(){
  if (this.getSourceViewer() != null) {
    CFMLPreferenceManager manager=new CFMLPreferenceManager();
    this.getSourceViewer().getTextWidget().setBackground(new org.eclipse.swt.graphics.Color(this.getSourceViewer().getTextWidget().getDisplay(),manager.getColor(EditorPreferenceConstants.P_COLOR_BACKGROUND)));
  }
}

Fixed version (ground truth):
/** 
 * Set the background color of the editor window based on the user's preferences
 */
private void setBackgroundColor(){
  if (this.getSourceViewer() != null && this.getSourceViewer().getTextWidget() != null) {
    CFMLPreferenceManager manager=new CFMLPreferenceManager();
    this.getSourceViewer().getTextWidget().setBackground(new org.eclipse.swt.graphics.Color(Display.getCurrent(),manager.getColor(EditorPreferenceConstants.P_COLOR_BACKGROUND)));
  }
}
Program: 17482
Project: 17482
Buggy source:
public void createPartControl(Composite parent){
  super.createPartControl(parent);
  this.setBackgroundColor();
  fSourceViewerDecorationSupport.install(getPreferenceStore());
  ProjectionViewer projectionViewer=(ProjectionViewer)getSourceViewer();
  fProjectionSupport=new ProjectionSupport(projectionViewer,getAnnotationAccess(),getSharedColors());
  fProjectionSupport.addSummarizableAnnotationType("String_Node_Str");
  fProjectionSupport.addSummarizableAnnotationType("String_Node_Str");
  fProjectionSupport.setHoverControlCreator(new IInformationControlCreator(){
    public IInformationControl createInformationControl(    Shell shell){
      return new DefaultInformationControl(shell);
    }
  }
);
  fProjectionSupport.install();
  projectionViewer.doOperation(ProjectionViewer.TOGGLE);
  foldingSetter=new CodeFoldingSetter(this);
  foldingSetter.docChanged(true);
  createDragAndDrop(projectionViewer);
  if (isEditorInputReadOnly()) {
    MessageBox msg=new MessageBox(this.getEditorSite().getShell());
    msg.setText("String_Node_Str");
    msg.setMessage("String_Node_Str");
    msg.open();
  }
}

Fixed version (ground truth):
public void createPartControl(Composite parent){
  super.createPartControl(parent);
  this.setBackgroundColor();
  fSourceViewerDecorationSupport.install(getPreferenceStore());
  ProjectionViewer projectionViewer=(ProjectionViewer)getSourceViewer();
  fProjectionSupport=new ProjectionSupport(projectionViewer,getAnnotationAccess(),getSharedColors());
  fProjectionSupport.addSummarizableAnnotationType("String_Node_Str");
  fProjectionSupport.addSummarizableAnnotationType("String_Node_Str");
  fProjectionSupport.setHoverControlCreator(new IInformationControlCreator(){
    public IInformationControl createInformationControl(    Shell shell){
      return new DefaultInformationControl(shell);
    }
  }
);
  fProjectionSupport.install();
  projectionViewer.doOperation(ProjectionViewer.TOGGLE);
  foldingSetter=new CodeFoldingSetter(this);
  foldingSetter.docChanged(true);
  createDragAndDrop(projectionViewer);
  try {
    if (isEditorInputReadOnly() && getPreferenceStore().getBoolean(EditorPreferenceConstants.P_WARN_READ_ONLY_FILES)) {
      String[] labels=new String[1];
      labels[0]="String_Node_Str";
      MessageDialogWithToggle msg=new MessageDialogWithToggle(this.getEditorSite().getShell(),"String_Node_Str",null,"String_Node_Str",MessageDialog.WARNING,labels,0,"String_Node_Str",false);
      if (msg.open() == 0) {
        if (msg.getToggleState()) {
          getPreferenceStore().setValue(EditorPreferenceConstants.P_WARN_READ_ONLY_FILES,false);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17483
Project: 17483
Buggy source:
/** 
 * Returns the global Content Assist Manager.
 * @see com.rohanclan.cfml.editors.contentassist.CFEContentAssistManager
 * @return The CAM instance
 */
public CFEContentAssistManager getGlobalCAM(){
  Assert.isNotNull(this.camInstance);
  return this.camInstance;
}

Fixed version (ground truth):
/** 
 * Returns the global Content Assist Manager.
 * @see com.rohanclan.cfml.editors.contentassist.CFEContentAssistManager
 * @return The CAM instance
 */
public CFEContentAssistManager getGlobalCAM(){
  Assert.isNotNull(this.camInstance,"String_Node_Str");
  return this.camInstance;
}