nus-yam/ex-repair huggingface dataset:
Program: 140800
Project: 140800
Buggy source:
@Override public void run(){
  IWorkbenchWindow aww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder);
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard);
  fileWizard.setWindowTitle(getText());
  if (WizardDialog.OK == dialog.open()) {
    try {
      folder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder);
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard);
  fileWizard.setWindowTitle(getText());
  if (WizardDialog.OK == dialog.open()) {
    try {
      folder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}
Program: 140801
Project: 140801
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  System.out.println("String_Node_Str" + name + "String_Node_Str"+ expr);
  EMFUtil util=new EMFUtil();
  IPath location=folder.getLocation();
  location=location.append(name);
  location=location.addFileExtension("String_Node_Str");
  System.out.println(location);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.save();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=new EMFUtil();
  IPath location=folder.getLocation();
  location=location.append(name);
  location=location.addFileExtension(NewSourcePatternActionProvider.EXTENSION_PATTERN);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.save();
  return true;
}
Program: 140802
Project: 140802
Buggy source:
@Override public void run(){
  IFolder sourceFiles=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.SOURCE_FILES);
  for (  IFile file : folder) {
    if (MessageDialog.openConfirm(new Shell(),"String_Node_Str","String_Node_Str" + file.getName())) {
      try {
        if (file.exists()) {
          file.delete(true,null);
        }
        sourceFiles.refreshLocal(IResource.DEPTH_INFINITE,null);
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  IFolder sourceFiles=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.SOURCE_FILES);
  for (  IFile file : folder) {
    if (MessageDialog.openConfirm(new Shell(),"String_Node_Str","String_Node_Str" + file.getName())) {
      try {
        if (file.exists()) {
          file.delete(true,null);
        }
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
    }
  }
  try {
    sourceFiles.refreshLocal(IResource.DEPTH_INFINITE,null);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}
Program: 140803
Project: 140803
Buggy source:
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase("String_Node_Str")) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}
Program: 140804
Project: 140804
Buggy source:
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      selectedFolderName=((IFolder)obj).getName();
      if (selectedFolderName.equals(DQStructureManager.PATTERNS)) {
        menu.add(new CreatePatternAction((IFolder)obj));
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase("String_Node_Str")) {
        menu.add(new RenameSqlFileAction((IFile)obj));
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
    menu.add(new OpenSqlFileAction(selectedFiles));
    menu.add(new DeleteSqlFileAction(selectedFiles));
  }
}

Fixed version (ground truth):
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      selectedFolderName=((IFolder)obj).getName();
      if (selectedFolderName.equals(DQStructureManager.PATTERNS)) {
        menu.add(new CreatePatternAction((IFolder)obj));
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
    menu.add(new DeletePatternAction(selectedFiles));
  }
}
Program: 140805
Project: 140805
Buggy source:
protected void addPages(){
  masterPage=new ConnnectionInfoPage(this,"String_Node_Str","String_Node_Str");
  try {
    addPage(masterPage);
  }
 catch (  PartInitException e) {
    ExceptionHandler.process(e,Level.ERROR);
  }
}

Fixed version (ground truth):
protected void addPages(){
  masterPage=new ConnnectionInfoPage(this,"String_Node_Str","String_Node_Str");
  try {
    addPage(masterPage);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 140807
Project: 140807
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createInformationSection(form,topComp);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createInformationSection(form,topComp);
  Button checkBtn=toolkit.createButton(topComp,"String_Node_Str",SWT.NONE);
  GridData gd=new GridData();
  gd.verticalSpan=20;
  gd.horizontalAlignment=SWT.CENTER;
  checkBtn.setLayoutData(gd);
  checkBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      ReturnCode code=checkDBConnection();
      if (code.isOk()) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
      }
 else {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str" + code.getMessage());
      }
    }
  }
);
}
Program: 140809
Project: 140809
Buggy source:
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  currentindicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}

Fixed version (ground truth):
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  List<IndicatorEnum> currentCountsChildren=new ArrayList<IndicatorEnum>();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (countsEnumChildren.contains(indEnum)) {
      currentCountsChildren.add(indEnum);
      continue;
    }
    if ((indEnum != IndicatorEnum.CountsIndicatorEnum) && indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  if (currentCountsChildren.size() == countsEnumChildren.size()) {
    categoryEnumList.removeAll(currentCountsChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
  }
  currentindicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}
Program: 140810
Project: 140810
Buggy source:
/** 
 * Get an appropriate ImageRepresentationHandler for the specified image segment.
 * @param segment the image segment specifying the image characteristics tobe read.
 * @return a handler for the segment, or null if an appropriate handlercould not be found.
 */
public static ImageRepresentationHandler forImageSegment(final ImageSegment segment){
switch (segment.getImageRepresentation()) {
case NOTFORDISPLAY:
    return new NoDisplayImageRepresentationHandler();
case MONOCHROME:
  return getMonoImageRepresentationHandler(segment,0);
case RGBTRUECOLOUR:
return getRgbImageRepresentationHandler(segment);
case MULTIBAND:
return getHandlerForMultiband(segment);
case RGBLUT:
return getRgbLUTImageRepresentationHandler(segment,0);
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Get an appropriate ImageRepresentationHandler for the specified image segment.
 * @param segment the image segment specifying the image characteristics tobe read.
 * @return a handler for the segment, or a "no render" handler if anappropriate handler could not be found.
 */
public static ImageRepresentationHandler forImageSegment(final ImageSegment segment){
switch (segment.getImageRepresentation()) {
case MONOCHROME:
    return getMonoImageRepresentationHandler(segment,0);
case RGBTRUECOLOUR:
  return getRgbImageRepresentationHandler(segment);
case MULTIBAND:
return getHandlerForMultiband(segment);
case RGBLUT:
return getRgbLUTImageRepresentationHandler(segment,0);
case NOTFORDISPLAY:
default :
return new NoDisplayImageRepresentationHandler();
}
}
Program: 140811
Project: 140811
Buggy source:
@Override public BufferedImage createBufferedImage(int width,int height){
  return new BufferedImage(width,height,BufferedImage.TYPE_BYTE_GRAY);
}

Fixed version (ground truth):
@Override public final BufferedImage createBufferedImage(final int width,final int height){
  return new BufferedImage(width,height,BufferedImage.TYPE_BYTE_GRAY);
}
Program: 140812
Project: 140812
Buggy source:
@Override public void renderPadPixel(ImageMask imageMask,DataBuffer data,int pixelIndex){
  return;
}

Fixed version (ground truth):
@Override public final void renderPadPixel(final ImageMask imageMask,final DataBuffer data,final int pixelIndex){
  return;
}
Program: 140813
Project: 140813
Buggy source:
@Override public void renderPixelBand(DataBuffer dataBuffer,int pixelIndex,ImageInputStream imageInputStream,int bandIndex) throws IOException {
  return;
}

Fixed version (ground truth):
@Override public void renderPixelBand(final DataBuffer dataBuffer,final int pixelIndex,final ImageInputStream imageInputStream,final int bandIndex) throws IOException {
}
Program: 140814
Project: 140814
Buggy source:
private void readBaseHeaderDataExtensionSegmentParts() throws ParseException {
  readNUMDES();
  for (int i=0; i < numberDataExtensionSegments; ++i) {
    readLDSH();
    readLD();
  }
}

Fixed version (ground truth):
private void readBaseHeaderDataExtensionSegmentParts() throws ParseException {
  readNUMDES();
  for (int i=0; i < numberDataExtensionSegments; ++i) {
    readLDSH(i);
    readLD(i);
  }
}
Program: 140815
Project: 140815
Buggy source:
private void readLDSH() throws ParseException {
  nitf.getDataExtensionSegmentSubHeaderLengths().add(reader.readBytesAsInteger(NitfConstants.LDSH_LENGTH));
}

Fixed version (ground truth):
private void readLDSH(final int i) throws ParseException {
  if (i < nitf.getDataExtensionSegmentDataLengths().size()) {
    nitf.getDataExtensionSegmentSubHeaderLengths().set(i,reader.readBytesAsInteger(NitfConstants.LDSH_LENGTH));
  }
 else {
    nitf.getDataExtensionSegmentSubHeaderLengths().add(reader.readBytesAsInteger(NitfConstants.LDSH_LENGTH));
  }
}
Program: 140816
Project: 140816
Buggy source:
private void readLD() throws ParseException {
  nitf.getDataExtensionSegmentDataLengths().add(reader.readBytesAsInteger(NitfConstants.LD_LENGTH));
}

Fixed version (ground truth):
private void readLD(final int i) throws ParseException {
  if (i < nitf.getDataExtensionSegmentDataLengths().size()) {
    nitf.getDataExtensionSegmentDataLengths().set(i,reader.readBytesAsInteger(NitfConstants.LD_LENGTH));
  }
 else {
    nitf.getDataExtensionSegmentDataLengths().add(reader.readBytesAsInteger(NitfConstants.LD_LENGTH));
  }
}
Program: 140817
Project: 140817
Buggy source:
/** 
 * Read the data extension segment data. The reader is assumed to be positioned at the end of the segment header before this call, and will be positioned at the start of the next header after this call.
 * @param dataExtensionSegmentHeader the header for the data extension segment that is to be read
 * @param reader the reader to use to read the data.
 * @throws ParseException on failure.
 */
protected final void readDataExtensionSegmentData(final NitfDataExtensionSegmentHeader dataExtensionSegmentHeader,final NitfReader reader) throws ParseException {
  if (dataExtensionSegmentHeader.getDataExtensionSegmentDataLength() > 0) {
    if (dataExtensionSegmentHeader.isTreOverflow(reader.getFileType())) {
      TreCollectionParser treCollectionParser=new TreCollectionParser();
      TreCollection overflowTres=treCollectionParser.parse(reader,dataExtensionSegmentHeader.getDataExtensionSegmentDataLength());
      dataExtensionSegmentHeader.mergeTREs(overflowTres);
    }
 else {
      dataExtensionSegmentData.add(reader.readBytesRaw(dataExtensionSegmentHeader.getDataExtensionSegmentDataLength()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Read the data extension segment data. The reader is assumed to be positioned at the end of the segment header before this call, and will be positioned at the start of the next header after this call.
 * @param dataExtensionSegmentHeader the header for the data extension segment that is to be read
 * @param reader the reader to use to read the data.
 * @throws ParseException on failure.
 */
protected final void readDataExtensionSegmentData(final NitfDataExtensionSegmentHeader dataExtensionSegmentHeader,final NitfReader reader) throws ParseException {
  if (dataExtensionSegmentHeader.getDataExtensionSegmentDataLength() > 0) {
    if (dataExtensionSegmentHeader.isTreOverflow(reader.getFileType())) {
      TreCollectionParser treCollectionParser=new TreCollectionParser();
      TreCollection overflowTres=treCollectionParser.parse(reader,dataExtensionSegmentHeader.getDataExtensionSegmentDataLength());
      dataExtensionSegmentHeader.mergeTREs(overflowTres);
    }
 else     if (!"String_Node_Str".equals(dataExtensionSegmentHeader.getIdentifier().trim())) {
      dataExtensionSegmentData.add(reader.readBytesRaw(dataExtensionSegmentHeader.getDataExtensionSegmentDataLength()));
    }
  }
}
Program: 140818
Project: 140818
Buggy source:
public NitfDataExtensionSegmentNode(final ChildSegmentKey key) throws ParseException {
  super(Children.LEAF);
  childKey=key;
  DeferredSegmentParseStrategy parseStrategy=childKey.getParseStrategy();
  header=parseStrategy.getDataExtensionSegmentHeader(childKey.getIndex());
  setDisplayName("String_Node_Str" + header.getIdentifier());
}

Fixed version (ground truth):
public NitfDataExtensionSegmentNode(final ChildSegmentKey key) throws ParseException {
  super(Children.LEAF);
  childKey=key;
  DeferredSegmentParseStrategy parseStrategy=childKey.getParseStrategy();
  header=parseStrategy.getDataExtensionSegmentHeader(childKey.getIndex());
  setDisplayName("String_Node_Str" + getFriendlyName());
}
Program: 140819
Project: 140819
Buggy source:
private boolean shouldOutputTREs(){
  if (shouldOutputFileTREs() || shouldOutputImageTREs() || shouldOutputDESTREs()) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean shouldOutputTREs(){
  return shouldOutputFileTREs() || shouldOutputImageTREs() || shouldOutputDESTREs();
}
Program: 140820
Project: 140820
Buggy source:
static private String cleanupNumberString(double fieldVal){
  if (fieldVal == (int)fieldVal) {
    return String.format("String_Node_Str",(int)fieldVal);
  }
  String naiveString=String.format("String_Node_Str",fieldVal);
  if (naiveString.contains("String_Node_Str")) {
    return naiveString.replaceAll("String_Node_Str","String_Node_Str");
  }
 else   if (naiveString.contains("String_Node_Str")) {
    return naiveString.replaceAll("String_Node_Str","String_Node_Str");
  }
  return naiveString;
}

Fixed version (ground truth):
private static String cleanupNumberString(double fieldVal){
  if (fieldVal == (int)fieldVal) {
    return String.format("String_Node_Str",(int)fieldVal);
  }
  String naiveString=String.format("String_Node_Str",fieldVal);
  if (naiveString.contains("String_Node_Str")) {
    return naiveString.replaceAll("String_Node_Str","String_Node_Str");
  }
 else   if (naiveString.contains("String_Node_Str")) {
    return naiveString.replaceAll("String_Node_Str","String_Node_Str");
  }
  return naiveString;
}
Program: 140822
Project: 140822
Buggy source:
private int getParameterListLength(int commandHeader) throws IOException {
  int parameterListLength=(commandHeader & 0x001F);
  if (parameterListLength == 31) {
    int longFormWord2=dataReader.readUnsignedShort();
    if ((longFormWord2 & 0x8000) == 0x8000) {
      System.out.println("String_Node_Str");
    }
    parameterListLength=longFormWord2 & 0x7FFF;
  }
  return parameterListLength;
}

Fixed version (ground truth):
private int getParameterListLength(int commandHeader) throws IOException {
  int parameterListLength=commandHeader & 0x001F;
  if (parameterListLength == 31) {
    int longFormWord2=dataReader.readUnsignedShort();
    if ((longFormWord2 & 0x8000) == 0x8000) {
      System.out.println("String_Node_Str");
    }
    parameterListLength=longFormWord2 & 0x7FFF;
  }
  return parameterListLength;
}
Program: 140823
Project: 140823
Buggy source:
@Override public boolean matches(final CgmIdentifier cgmIdentifier){
  return ((cgmIdentifier.getClassIdentifier() == cgmIdent.getClassIdentifier()) && (cgmIdentifier.getElementIdentifier() == cgmIdent.getElementIdentifier()));
}

Fixed version (ground truth):
@Override public boolean matches(final CgmIdentifier cgmIdentifier){
  return (cgmIdentifier.getClassIdentifier() == cgmIdent.getClassIdentifier()) && (cgmIdentifier.getElementIdentifier() == cgmIdent.getElementIdentifier());
}
Program: 140824
Project: 140824
Buggy source:
public final byte[] getLabelData(){
  return data;
}

Fixed version (ground truth):
public final String getLabelData(){
  return data;
}
Program: 140825
Project: 140825
Buggy source:
public final void setLabelData(final byte[] labelData){
  data=labelData;
}

Fixed version (ground truth):
public final void setLabelData(final String labelData){
  data=labelData;
}
Program: 140826
Project: 140826
Buggy source:
private void readLabelData() throws ParseException {
  if (lengthOfLabel == 0) {
    return;
  }
  if (shouldParseLabelData) {
    segment.setLabelData(reader.readBytesRaw(lengthOfLabel));
  }
 else {
    reader.skip(lengthOfLabel);
  }
}

Fixed version (ground truth):
private void readLabelData() throws ParseException {
  if (lengthOfLabel == 0) {
    return;
  }
  if (shouldParseLabelData) {
    segment.setLabelData(reader.readBytes(lengthOfLabel));
  }
 else {
    reader.skip(lengthOfLabel);
  }
}
Program: 140827
Project: 140827
Buggy source:
public RGBColour(final byte[] rgb){
  red=rgb[0];
  green=rgb[1];
  blue=rgb[2];
}

Fixed version (ground truth):
public RGBColour(final byte r,final byte g,final byte b){
  red=r;
  green=g;
  blue=b;
}
Program: 140829
Project: 140829
Buggy source:
private void readCLEVEL() throws ParseException {
  nitfComplexityLevel=reader.readBytesAsInteger(CLEVEL_LENGTH);
  if ((nitfComplexityLevel < MIN_COMPLEXITY_LEVEL) || (nitfComplexityLevel > MAX_COMPLEXITY_LEVEL)) {
    throw new ParseException(String.format("String_Node_Str",nitfComplexityLevel),reader.numBytesRead);
  }
}

Fixed version (ground truth):
private void readCLEVEL() throws ParseException {
  nitfComplexityLevel=reader.readBytesAsInteger(CLEVEL_LENGTH);
  if ((nitfComplexityLevel < MIN_COMPLEXITY_LEVEL) || (nitfComplexityLevel > MAX_COMPLEXITY_LEVEL)) {
    throw new ParseException(String.format("String_Node_Str",nitfComplexityLevel),reader.getNumBytesRead());
  }
}
Program: 140830
Project: 140830
Buggy source:
/** 
 * Set latitude and longitude from Degrees/Minutes/Seconds string /param dms string representation in MIL-STD-2500C ddmmssXdddmmssY form
 */
public void setFromDMS(String dms) throws ParseException {
  if (dms.length() != "String_Node_Str".length()) {
    throw new ParseException("String_Node_Str",0);
  }
  String latDegrees=dms.substring(0,2);
  String latMinutes=dms.substring(2,4);
  String latSeconds=dms.substring(4,6);
  String latNS=dms.substring(6,7);
  String lonDegrees=dms.substring(7,10);
  String lonMinutes=dms.substring(10,12);
  String lonSeconds=dms.substring(12,14);
  String lonEW=dms.substring(14,15);
  if ((!latNS.equals("String_Node_Str")) && (!latNS.equals("String_Node_Str"))) {
    throw new ParseException(String.format("String_Node_Str",latNS,dms),6);
  }
  if ((!lonEW.equals("String_Node_Str")) && (!lonEW.equals("String_Node_Str"))) {
    throw new ParseException(String.format("String_Node_Str",lonEW,dms),14);
  }
  try {
    lat=buildDecimalDegrees(latDegrees,latMinutes,latSeconds);
    if (latNS == "String_Node_Str") {
      lat=-1 * lat;
    }
    lon=buildDecimalDegrees(lonDegrees,lonMinutes,lonSeconds);
    if (lonEW == "String_Node_Str") {
      lon=-1 * lon;
    }
  }
 catch (  NumberFormatException ex) {
    throw new ParseException(String.format("String_Node_Str",dms),0);
  }
}

Fixed version (ground truth):
/** 
 * Set latitude and longitude from Degrees/Minutes/Seconds string /param dms string representation in MIL-STD-2500C ddmmssXdddmmssY form
 */
public void setFromDMS(String dms) throws ParseException {
  if (dms.length() != "String_Node_Str".length()) {
    throw new ParseException("String_Node_Str",0);
  }
  String latDegrees=dms.substring(0,2);
  String latMinutes=dms.substring(2,4);
  String latSeconds=dms.substring(4,6);
  String latNS=dms.substring(6,7);
  String lonDegrees=dms.substring(7,10);
  String lonMinutes=dms.substring(10,12);
  String lonSeconds=dms.substring(12,14);
  String lonEW=dms.substring(14,15);
  if ((!latNS.equals("String_Node_Str")) && (!latNS.equals("String_Node_Str"))) {
    throw new ParseException(String.format("String_Node_Str",latNS,dms),6);
  }
  if ((!lonEW.equals("String_Node_Str")) && (!lonEW.equals("String_Node_Str"))) {
    throw new ParseException(String.format("String_Node_Str",lonEW,dms),14);
  }
  try {
    lat=buildDecimalDegrees(latDegrees,latMinutes,latSeconds);
    if (latNS.equals("String_Node_Str")) {
      lat=-1.0 * lat;
    }
    lon=buildDecimalDegrees(lonDegrees,lonMinutes,lonSeconds);
    if (lonEW.equals("String_Node_Str")) {
      lon=-1.0 * lon;
    }
  }
 catch (  NumberFormatException ex) {
    throw new ParseException(String.format("String_Node_Str",dms),0);
  }
}
Program: 140831
Project: 140831
Buggy source:
public List<Change> getDiffedChanges() throws VcsException {
  final List<Change> result=new ArrayList<Change>();
  for (  Map.Entry<String,StringBuilder> e : myPatches.entrySet()) {
    final File file=new File(myBase,e.getKey().trim());
    final ContentRevision after=createAfter(file,FileStatus.MODIFIED);
    final String newContent=new DiffUtil().execute(after.getContent(),e.getValue().toString(),file.getName());
    final ContentRevision before=new SimpleContentRevision(newContent,new FilePathImpl(file,false),"String_Node_Str");
    result.add(new Change(before,after));
  }
  return result;
}

Fixed version (ground truth):
public List<Change> getDiffedChanges() throws VcsException {
  File wcRoot=RootUtil.getWcRoot(myBase);
  wcRoot=wcRoot == null ? myBase : wcRoot;
  final List<Change> result=new ArrayList<Change>();
  for (  Map.Entry<String,StringBuilder> e : myPatches.entrySet()) {
    final File file=new File(wcRoot,e.getKey().trim());
    final ContentRevision after=createAfter(file,FileStatus.MODIFIED);
    final String newContent=new DiffUtil().execute(after.getContent(),e.getValue().toString(),file.getName());
    final ContentRevision before=new SimpleContentRevision(newContent,new FilePathImpl(file,false),"String_Node_Str");
    result.add(new Change(before,after));
  }
  return result;
}
Program: 140832
Project: 140832
Buggy source:
@DELETE @Path("String_Node_Str") @Consumes("String_Node_Str") @RolesAllowed("String_Node_Str") public Comment deleteComment(@PathParam("String_Node_Str") int id){
  Comment ret=phoneCatalog.incLike(id);
  return ret;
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") @Consumes("String_Node_Str") @RolesAllowed("String_Node_Str") public Comment deleteComment(@PathParam("String_Node_Str") int id){
  Comment ret=phoneCatalog.deleteComment(id);
  return ret;
}
Program: 140836
Project: 140836
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.fragment_main);
  Logger.d(TAG,"String_Node_Str");
  mTextView=(TextView)findViewById(R.id.textViewReportScanResults);
  if (savedInstanceState != null) {
    mTextViewContents=savedInstanceState.getCharSequence(CustomConstants.Payloads.PAYLOAD_1.toString());
    isScanRunning=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_2.toString(),false);
    mButtonState=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_3.toString(),true);
  }
  mButton=(Button)findViewById(R.id.buttonStartScanningMain);
  mButton.setEnabled(false);
  mBluetoothUtils=new BluetoothUtils(this);
  registerMonitorTask();
  registerResponseReceiver();
  SuperActivityToast.cancelAllSuperActivityToasts();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.fragment_main);
  Logger.d(TAG,"String_Node_Str");
  mTextView=(TextView)findViewById(R.id.textViewReportScanResults);
  if (savedInstanceState != null) {
    mTextViewContents=savedInstanceState.getCharSequence(CustomConstants.Payloads.PAYLOAD_1.toString());
    isScanRunning=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_2.toString(),false);
    mButtonState=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_3.toString(),true);
    isToastScanningNowShown=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_4.toString(),false);
    isToastStoppingScanShown=savedInstanceState.getBoolean(CustomConstants.Payloads.PAYLOAD_5.toString(),false);
  }
  mButton=(Button)findViewById(R.id.buttonStartScanningMain);
  mButton.setEnabled(false);
  mBluetoothUtils=new BluetoothUtils(this);
  registerMonitorTask();
  registerResponseReceiver();
  SuperActivityToast.cancelAllSuperActivityToasts();
}
Program: 140837
Project: 140837
Buggy source:
@Override protected void onPause(){
  SuperActivityToast.cancelAllSuperActivityToasts();
  new ScanProcess().cancelServiceAlarm(this);
  Logger.d(TAG,"String_Node_Str");
  super.onPause();
}

Fixed version (ground truth):
@Override protected void onPause(){
  SuperActivityToast.cancelAllSuperActivityToasts();
  new ScanProcess().cancelService(this);
  Logger.d(TAG,"String_Node_Str");
  super.onPause();
}
Program: 140838
Project: 140838
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Logger.d(TAG,"String_Node_Str");
  if (intent.getAction().equalsIgnoreCase(CustomConstants.Broadcasts.BROADCAST_1.getString())) {
    Logger.i(TAG,"String_Node_Str");
    SuperActivityToast.cancelAllSuperActivityToasts();
    isScanRunning=true;
    mSuperActivityToast=ToastUtils.makeProgressToast(MainActivity.this,mSuperActivityToast,mToastString1);
    mButton.setText(getResources().getString(R.string.label_stop_scanning));
  }
 else   if (intent.getAction().equalsIgnoreCase(CustomConstants.Broadcasts.BROADCAST_2.getString())) {
    Logger.i(TAG,"String_Node_Str");
    SuperActivityToast.cancelAllSuperActivityToasts();
    ToastUtils.makeInfoToast(MainActivity.this,mToastString2);
    mButton.setEnabled(true);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Logger.d(TAG,"String_Node_Str");
  if (intent.getAction().equalsIgnoreCase(CustomConstants.Broadcasts.BROADCAST_1.getString())) {
    Logger.i(TAG,"String_Node_Str");
    SuperActivityToast.cancelAllSuperActivityToasts();
    isScanRunning=true;
    isToastScanningNowShown=true;
    mSuperActivityToast=ToastUtils.makeProgressToast(MainActivity.this,mSuperActivityToast,mToastStringScanningNow);
    mButton.setText(getResources().getString(R.string.label_stop_scanning));
  }
 else   if (intent.getAction().equalsIgnoreCase(CustomConstants.Broadcasts.BROADCAST_2.getString())) {
    Logger.i(TAG,"String_Node_Str");
    SuperActivityToast.cancelAllSuperActivityToasts();
    isToastScanningNowShown=false;
    ToastUtils.makeInfoToast(MainActivity.this,mToastStringScanFinished);
    mButton.setEnabled(true);
  }
}
Program: 140839
Project: 140839
Buggy source:
@Override protected void onResume(){
  super.onResume();
  SuperActivityToast.cancelAllSuperActivityToasts();
  if (!mBluetoothUtils.isBluetoothLeSupported()) {
    mSuperActivityToast=ToastUtils.makeWarningToast(this,mToastString4);
  }
 else {
    if (!mBluetoothUtils.isBluetoothOn()) {
      new ScanProcess().cancelServiceAlarm(this);
      mBluetoothUtils.askUserToEnableBluetoothIfNeeded();
    }
    if (mBluetoothUtils.isBluetoothOn() && mBluetoothUtils.isBluetoothLeSupported()) {
      Logger.i(TAG,"String_Node_Str");
      mButton.setEnabled(mButtonState);
      if (!mButtonState) {
        mButton.setText(getResources().getString(R.string.label_stop_scanning));
      }
      if (isScanRunning && mButtonState) {
        Logger.d(TAG,"String_Node_Str");
        new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
      }
 else       if (!isScanRunning && !mButtonState) {
        mSuperActivityToast=ToastUtils.makeProgressToast(this,mSuperActivityToast,mToastString5);
      }
      if (mTextViewContents != null && !mTextViewContents.equals("String_Node_Str")) {
        mTextView.setText(mTextViewContents);
      }
    }
 else {
      mSuperActivityToast=ToastUtils.makeProgressToast(this,mSuperActivityToast,mToastString3);
    }
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  SuperActivityToast.cancelAllSuperActivityToasts();
  if (!mBluetoothUtils.isBluetoothLeSupported()) {
    mSuperActivityToast=ToastUtils.makeWarningToast(this,mToastStringNoLE);
  }
 else {
    if (!mBluetoothUtils.isBluetoothOn()) {
      new ScanProcess().cancelService(this);
      mBluetoothUtils.askUserToEnableBluetoothIfNeeded();
    }
    if (mBluetoothUtils.isBluetoothOn() && mBluetoothUtils.isBluetoothLeSupported()) {
      Logger.i(TAG,"String_Node_Str");
      mButton.setEnabled(mButtonState);
      if (isScanRunning && mButtonState) {
        Logger.d(TAG,"String_Node_Str");
        new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
      }
      if (isToastScanningNowShown) {
        mSuperActivityToast=ToastUtils.makeProgressToast(this,mSuperActivityToast,mToastStringScanningNow);
      }
      if (mTextViewContents != null && !mTextViewContents.equals("String_Node_Str")) {
        mTextView.setText(mTextViewContents);
      }
    }
 else {
      mSuperActivityToast=ToastUtils.makeProgressToast(this,mSuperActivityToast,mToastStringEnableLE);
    }
  }
}
Program: 140840
Project: 140840
Buggy source:
public void onClickStartScanning(View view){
  Logger.d(TAG,"String_Node_Str");
  SuperActivityToast.cancelAllSuperActivityToasts();
  if (isScanRunning) {
    mButton.setEnabled(false);
    new ScanProcess().cancelServiceAlarm(this);
    mSuperActivityToast=ToastUtils.makeProgressToast(this,mSuperActivityToast,mToastString5);
    mButton.setText(getResources().getString(R.string.label_start_scanning));
    isScanRunning=false;
  }
 else {
    new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
  }
}

Fixed version (ground truth):
public void onClickStartScanning(View view){
  Logger.d(TAG,"String_Node_Str");
  SuperActivityToast.cancelAllSuperActivityToasts();
  if (isScanRunning) {
    new ScanProcess().cancelService(this);
    isToastScanningNowShown=false;
    mSuperActivityToast=ToastUtils.makeInfoToast(this,mToastStringScanInterrupted);
    mButton.setText(getResources().getString(R.string.label_start_scanning));
    isScanRunning=false;
  }
 else {
    new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
  }
}
Program: 140841
Project: 140841
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  outState.putCharSequence(CustomConstants.Payloads.PAYLOAD_1.toString(),mTextViewContents);
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_2.toString(),isScanRunning);
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_3.toString(),mButton.isEnabled());
  super.onSaveInstanceState(outState);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  outState.putCharSequence(CustomConstants.Payloads.PAYLOAD_1.toString(),mTextViewContents);
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_2.toString(),isScanRunning);
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_3.toString(),mButton.isEnabled());
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_4.toString(),isToastScanningNowShown);
  outState.putBoolean(CustomConstants.Payloads.PAYLOAD_5.toString(),isToastStoppingScanShown);
  super.onSaveInstanceState(outState);
}
Program: 140842
Project: 140842
Buggy source:
/** 
 * / Takes 2 time variables and starts a Scan Service 
 * @param context Context calling this method
 * @param scanDurationTime Scan duration in milliseconds
 * @param scanGapTime Time between consecutive scans in milliseconds
 */
public void scanForIBeacons(Context context,int scanDurationTime,int scanGapTime){
  Logger.d(TAG,"String_Node_Str");
  Logger.d(TAG,"String_Node_Str" + scanDurationTime);
  Logger.d(TAG,"String_Node_Str" + scanGapTime);
  this.cancelServiceAlarm(context);
  Singleton.getInstance().setNumberOfScans(0);
  Intent serviceIntent=new Intent(context,ScanService.class);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_1.getString(),scanDurationTime);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_2.getString(),scanGapTime);
  Logger.d(TAG,"String_Node_Str");
  context.startService(serviceIntent);
}

Fixed version (ground truth):
/** 
 * / Takes 2 time variables and starts a Scan Service 
 * @param context Context calling this method
 * @param scanDurationTime Scan duration in milliseconds
 * @param scanGapTime Time between consecutive scans in milliseconds
 */
public void scanForIBeacons(Context context,int scanDurationTime,int scanGapTime){
  if (!isAlarmUp(context)) {
    Logger.d(TAG,"String_Node_Str");
    Logger.d(TAG,"String_Node_Str" + scanDurationTime);
    Logger.d(TAG,"String_Node_Str" + scanGapTime);
    this.cancelService(context);
    Singleton.getInstance().setNumberOfScans(0);
    Intent serviceIntent=new Intent(context,ScanService.class);
    serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_1.getString(),scanDurationTime);
    serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_2.getString(),scanGapTime);
    Logger.d(TAG,"String_Node_Str");
    context.startService(serviceIntent);
  }
 else {
    Logger.e(TAG,"String_Node_Str");
  }
}
Program: 140843
Project: 140843
Buggy source:
public void onClickStartScanning(View view){
  Logger.d(TAG,"String_Node_Str");
  new ScanProcess().cancelServiceAlarm(this);
  Logger.d(TAG,"String_Node_Str");
  IntentFilter mIntentFilter=new IntentFilter(CustomConstants.Broadcasts.BROADCAST_1.getString());
  mScanReceiver=new ResponseReceiver();
  Logger.d(TAG,"String_Node_Str");
  LocalBroadcastManager.getInstance(this).registerReceiver(mScanReceiver,mIntentFilter);
  new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
}

Fixed version (ground truth):
public void onClickStartScanning(View view){
  Logger.d(TAG,"String_Node_Str");
  Logger.d(TAG,"String_Node_Str");
  IntentFilter mIntentFilter=new IntentFilter(CustomConstants.Broadcasts.BROADCAST_1.getString());
  mScanReceiver=new ResponseReceiver();
  Logger.d(TAG,"String_Node_Str");
  LocalBroadcastManager.getInstance(this).registerReceiver(mScanReceiver,mIntentFilter);
  new ScanProcess().scanForIBeacons(MainActivity.this,mScanTime,mGapTime);
}
Program: 140844
Project: 140844
Buggy source:
/** 
 * / Takes 2 time variables and starts a Scan Service 
 * @param context Context calling this method
 * @param scanDurationTime Scan duration in milliseconds
 * @param scanGapTime Time between consecutive scans in milliseconds
 */
public void scanForIBeacons(Context context,int scanDurationTime,int scanGapTime){
  Logger.d(TAG,"String_Node_Str");
  Logger.d(TAG,"String_Node_Str" + scanDurationTime);
  Logger.d(TAG,"String_Node_Str" + scanGapTime);
  Singleton.getInstance().setNumberOfScans(0);
  Intent serviceIntent=new Intent(context,ScanService.class);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_1.getString(),scanDurationTime);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_2.getString(),scanGapTime);
  Logger.d(TAG,"String_Node_Str");
  context.startService(serviceIntent);
}

Fixed version (ground truth):
/** 
 * / Takes 2 time variables and starts a Scan Service 
 * @param context Context calling this method
 * @param scanDurationTime Scan duration in milliseconds
 * @param scanGapTime Time between consecutive scans in milliseconds
 */
public void scanForIBeacons(Context context,int scanDurationTime,int scanGapTime){
  Logger.d(TAG,"String_Node_Str");
  Logger.d(TAG,"String_Node_Str" + scanDurationTime);
  Logger.d(TAG,"String_Node_Str" + scanGapTime);
  this.cancelServiceAlarm(context);
  Singleton.getInstance().setNumberOfScans(0);
  Intent serviceIntent=new Intent(context,ScanService.class);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_1.getString(),scanDurationTime);
  serviceIntent.putExtra(CustomConstants.Payloads.PAYLOAD_2.getString(),scanGapTime);
  Logger.d(TAG,"String_Node_Str");
  context.startService(serviceIntent);
}
Program: 140845
Project: 140845
Buggy source:
@Override public Object[] getConstructorArgs(){
  Object[][] workerConfiguration=new Object[sparqls + updates][];
  int i=0;
  for (  SPARQLWorkerConfig config : sparqlWorkers) {
    workerConfiguration[i++]=config.asConstructorArgs();
  }
  for (  UPDATEWorkerConfig config : updateWorkers) {
    workerConfiguration[i++]=config.asConstructorArgs();
  }
  constructorArgs=new Object[7];
  constructorArgs[0]=type ? typeValue : null;
  constructorArgs[1]=!type ? typeValue : null;
  constructorArgs[2]=workerConfiguration;
  List<String> qhConstructorTmp=new LinkedList<String>();
  qhConstructorTmp.add(0,qhClassName);
  if (qhConstructor != null)   qhConstructorTmp.addAll(qhConstructor);
  constructorArgs[3]=qhConstructorTmp.toArray(new String[]{});
  constructorArgs[4]=warmupTime;
  constructorArgs[5]=warmupQueries;
  constructorArgs[6]=warmupUpdates;
  return constructorArgs;
}

Fixed version (ground truth):
@Override public Object[] getConstructorArgs(){
  Object[][] workerConfiguration=new Object[sparqls + updates][];
  int i=0;
  for (  SPARQLWorkerConfig config : sparqlWorkers) {
    workerConfiguration[i++]=config.asConstructorArgs();
  }
  for (  UPDATEWorkerConfig config : updateWorkers) {
    workerConfiguration[i++]=config.asConstructorArgs();
  }
  constructorArgs=new Object[7];
  constructorArgs[0]=type ? typeValue : null;
  constructorArgs[1]=!type ? typeValue : null;
  constructorArgs[2]=workerConfiguration;
  constructorArgs[3]=getQHConstructor();
  constructorArgs[4]=warmupTime;
  constructorArgs[5]=warmupQueries;
  constructorArgs[6]=warmupUpdates;
  return constructorArgs;
}
Program: 140848
Project: 140848
Buggy source:
private void setCredentials(UpdateProcessor exec){
  if (exec instanceof UpdateProcessRemote) {
    if (user != null && !user.isEmpty() && password != null && !password.isEmpty()) {
      CredentialsProvider provider=new BasicCredentialsProvider();
      provider.setCredentials(new AuthScope(AuthScope.ANY_HOST,AuthScope.ANY_PORT),new UsernamePasswordCredentials(user,password));
      HttpContext httpContext=new BasicHttpContext();
      httpContext.setAttribute(HttpClientContext.CREDS_PROVIDER,provider);
      ((UpdateProcessRemote)exec).setHttpContext(httpContext);
      HttpClient test=((UpdateProcessRemote)exec).getClient();
      System.out.println(test);
    }
  }
}

Fixed version (ground truth):
private void setCredentials(UpdateProcessor exec){
  if (exec instanceof UpdateProcessRemote && user != null && !user.isEmpty() && password != null && !password.isEmpty()) {
    CredentialsProvider provider=new BasicCredentialsProvider();
    provider.setCredentials(new AuthScope(AuthScope.ANY_HOST,AuthScope.ANY_PORT),new UsernamePasswordCredentials(user,password));
    HttpContext httpContext=new BasicHttpContext();
    httpContext.setAttribute(HttpClientContext.CREDS_PROVIDER,provider);
    ((UpdateProcessRemote)exec).setHttpContext(httpContext);
    HttpClient test=((UpdateProcessRemote)exec).getClient();
    System.out.println(test);
  }
}
Program: 140850
Project: 140850
Buggy source:
private String[] getQHConstructor(){
  List<String> qhConstructorTmp=new LinkedList<String>();
  qhConstructorTmp.add(0,qhClassName);
  if (qhConstructorTmp != null)   qhConstructorTmp.addAll(qhConstructor);
  return qhConstructorTmp.toArray(new String[]{});
}

Fixed version (ground truth):
private String[] getQHConstructor(){
  List<String> qhConstructorTmp=new LinkedList<String>();
  qhConstructorTmp.add(0,qhClassName);
  if (qhConstructor != null) {
    for (    String str : qhConstructor) {
      if (str != null)       qhConstructorTmp.add(str);
    }
  }
  return qhConstructorTmp.toArray(new String[]{});
}
Program: 140851
Project: 140851
Buggy source:
private void cachedFile(Integer index,String connID,File f,Integer extraLength,Triple[] data){
  List<String> header;
  try (BufferedReader reader=new BufferedReader(new FileReader(f))){
    String[] headerArr=reader.readLine().split(SEPERATOR);
    header=Arrays.asList(headerArr);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + f.getName(),e);
    return;
  }
  StringBuilder dataString=new StringBuilder();
  dataString.append(connID).append(SEPERATOR);
  String[] ordered=new String[data.length - extraLength];
  for (index=extraLength; index < data.length; index++) {
    Triple triple=data[index];
    String key=triple.getPredicate();
    int j=header.indexOf(key) - 1;
    ordered[j]=triple.getObject().toString();
  }
  for (index=0; index < ordered.length - 1; index++) {
    dataString.append(ordered[index]).append(SEPERATOR);
  }
  if (ordered.length != 0)   dataString.append(ordered[index]);
  try (PrintWriter pw=new PrintWriter(new FileOutputStream(f,true))){
    pw.println(dataString.toString());
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + f.getAbsolutePath(),e);
    return;
  }
}

Fixed version (ground truth):
private void cachedFile(String connID,File f,Integer extraLength,Triple[] data){
  Integer index=0;
  List<String> header;
  try (BufferedReader reader=new BufferedReader(new FileReader(f))){
    String[] headerArr=reader.readLine().split(SEPERATOR);
    header=Arrays.asList(headerArr);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + f.getName(),e);
    return;
  }
  StringBuilder dataString=new StringBuilder();
  dataString.append(connID).append(SEPERATOR);
  String[] ordered=new String[data.length - extraLength];
  for (index=extraLength; index < data.length; index++) {
    Triple triple=data[index];
    String key=triple.getPredicate();
    int j=header.indexOf(key) - 1;
    ordered[j]=triple.getObject().toString();
  }
  for (index=0; index < ordered.length - 1; index++) {
    dataString.append(ordered[index]).append(SEPERATOR);
  }
  if (ordered.length != 0)   dataString.append(ordered[index]);
  try (PrintWriter pw=new PrintWriter(new FileOutputStream(f,true))){
    pw.println(dataString.toString());
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + f.getAbsolutePath(),e);
    return;
  }
}