nus-yam/ex-repair huggingface dataset:
Program: 4417
Project: 4417
Buggy source:
private EGLContext createContext(EGLContext shared_context){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  final int[] attrib_list={EGL14.EGL_CONTEXT_CLIENT_VERSION,2,EGL14.EGL_NONE};
  final EGLContext context=EGL14.eglCreateContext(mEglDisplay,mEglConfig,shared_context,attrib_list,0);
  checkEglError("String_Node_Str");
  return context;
}

Fixed version (ground truth):
private EGLContext createContext(EGLContext shared_context){
  final int[] attrib_list={EGL14.EGL_CONTEXT_CLIENT_VERSION,2,EGL14.EGL_NONE};
  final EGLContext context=EGL14.eglCreateContext(mEglDisplay,mEglConfig,shared_context,attrib_list,0);
  checkEglError("String_Node_Str");
  return context;
}
Program: 4418
Project: 4418
Buggy source:
private EGLConfig getConfig(boolean with_depth_buffer){
  final int[] attribList={EGL14.EGL_RENDERABLE_TYPE,EGL14.EGL_OPENGL_ES2_BIT,EGL14.EGL_RED_SIZE,8,EGL14.EGL_GREEN_SIZE,8,EGL14.EGL_BLUE_SIZE,8,EGL14.EGL_ALPHA_SIZE,8,EGL_RECORDABLE_ANDROID,1,with_depth_buffer ? EGL14.EGL_DEPTH_SIZE : EGL14.EGL_NONE,with_depth_buffer ? 16 : 0,EGL14.EGL_NONE};
  final EGLConfig[] configs=new EGLConfig[1];
  final int[] numConfigs=new int[1];
  if (!EGL14.eglChooseConfig(mEglDisplay,attribList,0,configs,0,configs.length,numConfigs,0)) {
    Log.w(TAG,"String_Node_Str" + "String_Node_Str");
    return null;
  }
  return configs[0];
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private EGLConfig getConfig(boolean with_depth_buffer,boolean isRecordable){
  final int[] attribList={EGL14.EGL_RENDERABLE_TYPE,EGL14.EGL_OPENGL_ES2_BIT,EGL14.EGL_RED_SIZE,8,EGL14.EGL_GREEN_SIZE,8,EGL14.EGL_BLUE_SIZE,8,EGL14.EGL_ALPHA_SIZE,8,EGL14.EGL_NONE,EGL14.EGL_NONE,EGL14.EGL_NONE,EGL14.EGL_NONE,EGL14.EGL_NONE,EGL14.EGL_NONE,EGL14.EGL_NONE};
  int offset=10;
  if (false) {
    attribList[offset++]=EGL14.EGL_STENCIL_SIZE;
    attribList[offset++]=8;
  }
  if (with_depth_buffer) {
    attribList[offset++]=EGL14.EGL_DEPTH_SIZE;
    attribList[offset++]=16;
  }
  if (isRecordable && (Build.VERSION.SDK_INT >= 18)) {
    attribList[offset++]=EGL_RECORDABLE_ANDROID;
    attribList[offset++]=1;
  }
  for (int i=attribList.length - 1; i >= offset; i--) {
    attribList[i]=EGL14.EGL_NONE;
  }
  final EGLConfig[] configs=new EGLConfig[1];
  final int[] numConfigs=new int[1];
  if (!EGL14.eglChooseConfig(mEglDisplay,attribList,0,configs,0,configs.length,numConfigs,0)) {
    Log.w(TAG,"String_Node_Str" + "String_Node_Str");
    return null;
  }
  return configs[0];
}
Program: 4419
Project: 4419
Buggy source:
private void destroyWindowSurface(EGLSurface surface){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (surface != EGL14.EGL_NO_SURFACE) {
    EGL14.eglMakeCurrent(mEglDisplay,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_CONTEXT);
    EGL14.eglDestroySurface(mEglDisplay,surface);
  }
  surface=EGL14.EGL_NO_SURFACE;
}

Fixed version (ground truth):
private void destroyWindowSurface(EGLSurface surface){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (surface != EGL14.EGL_NO_SURFACE) {
    EGL14.eglMakeCurrent(mEglDisplay,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_CONTEXT);
    EGL14.eglDestroySurface(mEglDisplay,surface);
  }
  surface=EGL14.EGL_NO_SURFACE;
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
}
Program: 4420
Project: 4420
Buggy source:
private void destroyContext(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (!EGL14.eglDestroyContext(mEglDisplay,mEglContext)) {
    Log.e("String_Node_Str","String_Node_Str" + mEglDisplay + "String_Node_Str"+ mEglContext);
    Log.e(TAG,"String_Node_Str" + EGL14.eglGetError());
  }
  mEglContext=EGL14.EGL_NO_CONTEXT;
}

Fixed version (ground truth):
private void destroyContext(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (!EGL14.eglDestroyContext(mEglDisplay,mEglContext)) {
    Log.e("String_Node_Str","String_Node_Str" + mEglDisplay + "String_Node_Str"+ mEglContext);
    Log.e(TAG,"String_Node_Str" + EGL14.eglGetError());
  }
  mEglContext=EGL14.EGL_NO_CONTEXT;
  if (mDefaultContext != EGL14.EGL_NO_CONTEXT) {
    if (!EGL14.eglDestroyContext(mEglDisplay,mDefaultContext)) {
      Log.e("String_Node_Str","String_Node_Str" + mEglDisplay + "String_Node_Str"+ mDefaultContext);
      Log.e(TAG,"String_Node_Str" + EGL14.eglGetError());
    }
    mDefaultContext=EGL14.EGL_NO_CONTEXT;
  }
}
Program: 4421
Project: 4421
Buggy source:
EglSurface(EGLBase egl,Surface surface){
  if (DEBUG)   Log.i(TAG,"String_Node_Str");
  mEgl=egl;
  mEglSurface=mEgl.createWindowSurface(surface);
}

Fixed version (ground truth):
EglSurface(EGLBase egl,int width,int height){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mEgl=egl;
  mEglSurface=mEgl.createOffscreenSurface(width,height);
}
Program: 4422
Project: 4422
Buggy source:
public EGLBase(EGLContext shared_context,boolean with_depth_buffer){
  if (DEBUG)   Log.i(TAG,"String_Node_Str");
  init(shared_context,with_depth_buffer);
}

Fixed version (ground truth):
public EGLBase(EGLContext shared_context,boolean with_depth_buffer,boolean isRecordable){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  init(shared_context,with_depth_buffer,isRecordable);
}
Program: 4423
Project: 4423
Buggy source:
/** 
 * @see {@link Display#getRotation()}
 */
public int getScreenRotation(){
  return screenRotation;
}

Fixed version (ground truth):
/** 
 * @see Display#getRotation()
 */
public int getScreenRotation(){
  return screenRotation;
}
Program: 4424
Project: 4424
Buggy source:
@Override public ObservableList<TreeItem<JarTreeNode>> getChildren(){
  if (isFirstTimeChildren) {
    isFirstTimeChildren=false;
    System.out.println("String_Node_Str" + getValue());
    super.getChildren().setAll(buildChildren());
  }
  return super.getChildren();
}

Fixed version (ground truth):
@Override public ObservableList<TreeItem<JarTreeNode>> getChildren(){
  if (isFirstTimeChildren) {
    isFirstTimeChildren=false;
    Log.log("String_Node_Str" + getValue());
    super.getChildren().setAll(buildChildren());
  }
  return super.getChildren();
}
Program: 4425
Project: 4425
Buggy source:
public void select(FileComponent cc){
  int byteOffset=cc.getOffset();
  textArea2.positionCaret(calcBytesTextPosition(cc.getOffset()));
  textArea2.selectPositionCaret(calcBytesTextPosition(cc.getOffset() + cc.getLength()) - 1);
  textArea3.positionCaret(calcAsciiTextPosition(cc.getOffset()));
  textArea3.selectPositionCaret(calcAsciiTextPosition(cc.getOffset() + cc.getLength()));
}

Fixed version (ground truth):
public void select(FileComponent cc){
  int byteOffset=cc.getOffset();
  int rowIndex=byteOffset / BYTES_PER_ROW;
  textArea2.positionCaret(calcBytesTextPosition(cc.getOffset()));
  textArea2.selectPositionCaret(calcBytesTextPosition(cc.getOffset() + cc.getLength()) - 1);
  textArea3.positionCaret(calcAsciiTextPosition(cc.getOffset()));
  textArea3.selectPositionCaret(calcAsciiTextPosition(cc.getOffset() + cc.getLength()));
}
Program: 4426
Project: 4426
Buggy source:
private void initTextArea(){
  textArea1.setFont(FontHelper.textFont);
  textArea2.setFont(FontHelper.textFont);
  textArea3.setFont(FontHelper.textFont);
  textArea1.setPrefColumnCount(6);
  textArea2.setPrefColumnCount(45);
  textArea3.setPrefColumnCount(16);
  int rowCount=hex.rowHeaderText.length() / 7;
  textArea1.setPrefRowCount(rowCount);
  textArea2.setPrefRowCount(rowCount);
  textArea3.setPrefRowCount(rowCount);
  textArea1.setEditable(false);
  textArea2.setEditable(false);
  textArea3.setEditable(false);
  textArea1.setStyle("String_Node_Str");
}

Fixed version (ground truth):
private void initTextArea(){
  textArea1.setFont(FontHelper.textFont);
  textArea2.setFont(FontHelper.textFont);
  textArea3.setFont(FontHelper.textFont);
  textArea1.setPrefColumnCount(6);
  textArea2.setPrefColumnCount(46);
  textArea3.setPrefColumnCount(16);
  int rowCount=hex.rowHeaderText.length() / 9 + 1;
  textArea1.setPrefRowCount(rowCount);
  textArea2.setPrefRowCount(rowCount);
  textArea3.setPrefRowCount(rowCount);
  textArea1.setContextMenu(new AsciiPaneMenu(textArea1));
  textArea2.setContextMenu(new HexPaneMenu(textArea2));
  textArea3.setContextMenu(new AsciiPaneMenu(textArea3));
  textArea1.setEditable(false);
  textArea2.setEditable(false);
  textArea3.setEditable(false);
  textArea1.setStyle("String_Node_Str");
}
Program: 4427
Project: 4427
Buggy source:
private void listenTreeItemSelection(){
  tree.getSelectionModel().getSelectedItems().addListener((  ListChangeListener.Change<? extends TreeItem<FileComponent>> c) -> {
    if (c.next() && c.wasAdded()) {
      TreeItem<FileComponent> node=c.getList().get(c.getFrom());
      if (node != null && node.getParent() != null) {
        FileComponent cc=node.getValue();
        Log.log("String_Node_Str" + cc);
        statusLabel.setText("String_Node_Str" + cc.getClass().getSimpleName());
        if (cc.getLength() > 0) {
          hexPane.select(cc);
          bytesBar.select(cc);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void listenTreeItemSelection(){
  tree.getSelectionModel().getSelectedItems().addListener((  ListChangeListener.Change<? extends TreeItem<FileComponent>> c) -> {
    if (c.next() && c.wasAdded()) {
      TreeItem<FileComponent> node=c.getList().get(c.getFrom());
      if (node != null && node.getParent() != null) {
        FileComponent cc=node.getValue();
        Log.log("String_Node_Str" + cc);
        statusLabel.setText(cc.toString());
        if (cc.getLength() > 0) {
          hexPane.select(cc);
          bytesBar.select(cc);
        }
      }
    }
  }
);
}
Program: 4428
Project: 4428
Buggy source:
public ParsedViewerPane(FileComponent file,HexText hex){
  tree=buildClassTree(file);
  hexPane=new HexPane(hex);
  statusLabel=new Label("String_Node_Str");
  bytesBar=new BytesBar(file.getLength());
  bytesBar.setMaxHeight(statusLabel.getPrefHeight());
  bytesBar.setPrefWidth(100);
  super.setCenter(buildSplitPane());
  super.setBottom(buildStatusBar());
  listenTreeItemSelection();
}

Fixed version (ground truth):
public ParsedViewerPane(FileComponent file,HexText hex){
  tree=buildClassTree(file);
  hexPane=new HexPane(hex);
  statusLabel=new Label("String_Node_Str");
  bytesBar=new BytesBar(file.getLength());
  bytesBar.setMaxHeight(statusLabel.getMaxHeight());
  bytesBar.setPrefWidth(200);
  super.setCenter(buildSplitPane());
  super.setBottom(buildStatusBar());
  listenTreeItemSelection();
}
Program: 4429
Project: 4429
Buggy source:
private void saveToTmp(){
  if (!list.isEmpty() && listChanged) {
    byte[] bytes=list.stream().map(RecentFile::toString).collect(Collectors.joining("String_Node_Str")).getBytes(StandardCharsets.UTF_8);
    Path tmp=Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str");
    System.out.println("String_Node_Str" + tmp + "String_Node_Str");
    try {
      Files.write(tmp,bytes);
    }
 catch (    IOException e) {
      e.printStackTrace(System.err);
    }
  }
}

Fixed version (ground truth):
private void saveToTmp(){
  if (!list.isEmpty() && listChanged) {
    byte[] bytes=list.stream().map(RecentFile::toString).collect(Collectors.joining("String_Node_Str")).getBytes(StandardCharsets.UTF_8);
    Path tmp=Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str");
    Log.log("String_Node_Str" + tmp + "String_Node_Str");
    try {
      Files.write(tmp,bytes);
    }
 catch (    IOException e) {
      e.printStackTrace(System.err);
    }
  }
}
Program: 4430
Project: 4430
Buggy source:
private void loadFromTmp(){
  Path tmp=Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str");
  if (Files.exists(tmp)) {
    System.out.println("String_Node_Str" + tmp + "String_Node_Str");
    try {
      List<String> rfs=Files.readAllLines(tmp,StandardCharsets.UTF_8);
      for (      String rf : rfs) {
        if (rf.contains("String_Node_Str")) {
          list.addLast(new RecentFile(rf));
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace(System.err);
    }
  }
}

Fixed version (ground truth):
private void loadFromTmp(){
  Path tmp=Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str");
  if (Files.exists(tmp)) {
    Log.log("String_Node_Str" + tmp + "String_Node_Str");
    try {
      List<String> rfs=Files.readAllLines(tmp,StandardCharsets.UTF_8);
      for (      String rf : rfs) {
        if (rf.contains("String_Node_Str")) {
          list.addLast(new RecentFile(rf));
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace(System.err);
    }
  }
}
Program: 4431
Project: 4431
Buggy source:
public void select(FileComponent cc){
  int byteOffset=cc.getOffset();
  int rowIndex=byteOffset / BYTES_PER_ROW;
  int rows=textArea3.getText().length() / (BYTES_PER_ROW + 1);
  textArea2.positionCaret(calcBytesTextPosition(cc.getOffset()));
  textArea2.selectPositionCaret(calcBytesTextPosition(cc.getOffset() + cc.getLength()) - 1);
  textArea3.positionCaret(calcAsciiTextPosition(cc.getOffset()));
  textArea3.selectPositionCaret(calcAsciiTextPosition(cc.getOffset() + cc.getLength()));
  double height=getHeight();
  double textHeight=textArea2.getHeight();
  double vvalue=(((double)rowIndex) / rows * textHeight / (textHeight - height) - height / 2 / textHeight);
  if (((Double)vvalue).isInfinite() || ((Double)vvalue).isNaN()) {
  }
 else   if (vvalue < 0) {
    this.setVvalue(0);
  }
 else   if (vvalue > 1) {
    this.setVvalue(1);
  }
 else {
    this.setVvalue(vvalue);
  }
}

Fixed version (ground truth):
public void select(FileComponent cc){
  int byteOffset=cc.getOffset();
  int rowIndex=byteOffset / BYTES_PER_ROW;
  int rows=textArea3.getText().length() / (BYTES_PER_ROW + 1);
  textArea2.positionCaret(calcBytesTextPosition(cc.getOffset()));
  textArea2.selectPositionCaret(calcBytesTextPosition(cc.getOffset() + cc.getLength()) - 1);
  textArea3.positionCaret(calcAsciiTextPosition(cc.getOffset()));
  textArea3.selectPositionCaret(calcAsciiTextPosition(cc.getOffset() + cc.getLength()));
  double height=getHeight();
  double textHeight=textArea2.getHeight();
  double vvalue=(((double)rowIndex) / rows * textHeight / (textHeight - height) - height / 2 / textHeight);
  if (Double.isFinite(vvalue)) {
    if (vvalue < 0) {
      this.setVvalue(0);
    }
 else     if (vvalue > 1) {
      this.setVvalue(1);
    }
 else {
      this.setVvalue(vvalue);
    }
  }
}
Program: 4432
Project: 4432
Buggy source:
private void openClassInJar(String url){
  try {
    openFile(new URL(url));
  }
 catch (  MalformedURLException e) {
    Log.log(e);
  }
}

Fixed version (ground truth):
private void openClassInJar(String url){
  try {
    openFile(new URL(url));
  }
 catch (  MalformedURLException e) {
    e.printStackTrace(System.err);
  }
}
Program: 4433
Project: 4433
Buggy source:
@Override protected String loadDesc(ConstantPool cp){
  long high=super.getUInt("String_Node_Str");
  long low=super.getUInt("String_Node_Str");
  double d=Double.longBitsToDouble(high << 32 | low);
  return String.valueOf(d);
}

Fixed version (ground truth):
@Override protected String loadDesc(ConstantPool cp){
  long high=super.getUInt("String_Node_Str");
  long low=super.getUInt("String_Node_Str") & 0xffffffffL;
  double d=Double.longBitsToDouble(high << 32 | low);
  return String.valueOf(d);
}
Program: 4434
Project: 4434
Buggy source:
@Override protected String loadDesc(ConstantPool cp){
  long high=super.getUInt("String_Node_Str");
  long low=super.getUInt("String_Node_Str");
  long l=high << 32 | low;
  return String.valueOf(l);
}

Fixed version (ground truth):
@Override protected String loadDesc(ConstantPool cp){
  long high=super.getUInt("String_Node_Str");
  long low=super.getUInt("String_Node_Str") & 0xffffffffL;
  long l=high << 32 | low;
  return String.valueOf(l);
}
Program: 4435
Project: 4435
Buggy source:
public static URL showDialog(File jar) throws Exception {
  Stage stage=new Stage();
  stage.initModality(Modality.APPLICATION_MODAL);
  URI jarUri=new URI("String_Node_Str",jar.toPath().toUri().toString(),null);
  try (FileSystem zipFs=FileSystems.newFileSystem(jarUri,new HashMap<>())){
    AtomicBoolean openButtonClicked=new AtomicBoolean(false);
    Path rootPath=zipFs.getPath("String_Node_Str");
    TreeView<Path> jarTree=createTreeView(rootPath);
    Button openButton=new Button("String_Node_Str");
    openButton.setOnAction(e -> {
      stage.close();
      openButtonClicked.set(true);
    }
);
    Button cancelButton=new Button("String_Node_Str");
    cancelButton.setOnAction(e -> stage.close());
    BorderPane rootPane=createRootPane(jarTree,openButton,cancelButton);
    Scene scene=new Scene(rootPane,500,300);
    stage.setScene(scene);
    stage.setTitle("String_Node_Str");
    stage.showAndWait();
    if (openButtonClicked.get()) {
      TreeItem<Path> selectedItem=jarTree.getSelectionModel().getSelectedItem();
      if (selectedItem != null) {
        Path path=selectedItem.getValue();
        if (path.toString().endsWith("String_Node_Str")) {
          String classUrl=String.format("String_Node_Str",jar.getAbsolutePath(),path.toAbsolutePath());
          classUrl=classUrl.replace('\\','/');
          System.out.println(classUrl);
          return new URL(classUrl);
        }
      }
    }
    return null;
  }
 }

Fixed version (ground truth):
public static URL showDialog(File jar) throws Exception {
  Stage stage=new Stage();
  stage.initModality(Modality.APPLICATION_MODAL);
  Button openButton=new Button("String_Node_Str");
  Button cancelButton=new Button("String_Node_Str");
  AtomicBoolean openButtonClicked=new AtomicBoolean(false);
  cancelButton.setOnAction(e -> stage.close());
  openButton.setOnAction(e -> {
    openButtonClicked.set(true);
    stage.close();
  }
);
  URI jarUri=new URI("String_Node_Str",jar.toPath().toUri().toString(),null);
  try (FileSystem zipFs=FileSystems.newFileSystem(jarUri,new HashMap<>())){
    TreeView<Path> jarTree=createTreeView(zipFs.getPath("String_Node_Str"));
    BorderPane rootPane=createRootPane(jarTree,openButton,cancelButton);
    Scene scene=new Scene(rootPane,500,300);
    stage.setScene(scene);
    stage.setTitle("String_Node_Str");
    stage.showAndWait();
    if (openButtonClicked.get()) {
      TreeItem<Path> selectedItem=jarTree.getSelectionModel().getSelectedItem();
      if (selectedItem != null) {
        Path path=selectedItem.getValue();
        if (path.toString().endsWith("String_Node_Str")) {
          String classUrl=String.format("String_Node_Str",jar.getAbsolutePath(),path.toAbsolutePath());
          classUrl=classUrl.replace('\\','/');
          System.out.println(classUrl);
          return new URL(classUrl);
        }
      }
    }
    return null;
  }
 }
Program: 4436
Project: 4436
Buggy source:
private void readEncodedArrayList(DexReader reader){
  int[] offArr=classDefs.stream().mapToInt(classDef -> classDef.getStaticValuesOff().getValue()).filter(off -> off > 0).toArray();
}

Fixed version (ground truth):
private void readEncodedArrayList(DexReader reader){
  int[] offArr=classDefs.stream().mapToInt(classDef -> classDef.getStaticValuesOff().getValue()).filter(off -> off > 0).toArray();
  encodedArrayList=reader.readOffsetsKnownList(offArr,EncodedArrayItem::new);
}
Program: 4437
Project: 4437
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    FieldIdItem fieldId=dexFile.getFieldIdItem(index);
    String fieldName=fieldId.getDesc();
    String className=dexFile.getTypeIdItem(fieldId.getClassIdx()).getDesc();
    setDesc(index + "String_Node_Str" + className+ "String_Node_Str"+ fieldName);
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    FieldIdItem fieldId=dexFile.getFieldIdItem(index);
    String fieldName=fieldId.getDesc();
    String className=dexFile.getTypeIdItem(fieldId.getClassIdx()).getDesc();
    setDesc(index + "String_Node_Str" + className+ "String_Node_Str"+ fieldName);
  }
}
Program: 4438
Project: 4438
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    MethodIdItem methodId=dexFile.getMethodIdItem(index);
    String methodName=methodId.getDesc();
    String className=dexFile.getTypeIdItem(methodId.getClassIdx()).getDesc();
    setDesc(index + "String_Node_Str" + className+ "String_Node_Str"+ methodName);
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    MethodIdItem methodId=dexFile.getMethodIdItem(index);
    String methodName=methodId.getDesc();
    String className=dexFile.getTypeIdItem(methodId.getClassIdx()).getDesc();
    setDesc(index + "String_Node_Str" + className+ "String_Node_Str"+ methodName);
  }
}
Program: 4439
Project: 4439
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    setDesc(index + "String_Node_Str" + dexFile.getString(index));
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    setDesc(index + "String_Node_Str" + dexFile.getString(index));
  }
}
Program: 4440
Project: 4440
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    TypeIdItem typeId=dexFile.getTypeIdItem(index);
    String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
    setDesc(index + "String_Node_Str" + typeDesc);
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    TypeIdItem typeId=dexFile.getTypeIdItem(index);
    String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
    setDesc(index + "String_Node_Str" + typeDesc);
  }
}
Program: 4441
Project: 4441
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    ProtoIdItem protoId=dexFile.getProtoIdItem(index);
    String protoDesc=dexFile.getString(protoId.getShortyIdx());
    setDesc(index + "String_Node_Str" + protoDesc);
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    ProtoIdItem protoId=dexFile.getProtoIdItem(index);
    String protoDesc=dexFile.getString(protoId.getShortyIdx());
    setDesc(index + "String_Node_Str" + protoDesc);
  }
}
Program: 4442
Project: 4442
Buggy source:
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    TypeIdItem typeId=dexFile.getTypeIdItem(index);
    String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
    setDesc(index + "String_Node_Str" + typeDesc);
  }
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index >= 0) {
    TypeIdItem typeId=dexFile.getTypeIdItem(index);
    String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
    setDesc(index + "String_Node_Str" + typeDesc);
  }
}
Program: 4443
Project: 4443
Buggy source:
@Override protected void postRead(DexFile dexFile){
  setDesc(getValue() + "String_Node_Str" + dexFile.getString(getValue()));
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    setDesc(index + "String_Node_Str" + dexFile.getString(index));
  }
 else {
    setDesc(String.valueOf(index));
  }
}
Program: 4444
Project: 4444
Buggy source:
@Override protected void postRead(DexFile dexFile){
  TypeIdItem typeId=dexFile.getTypeIdItem(getValue());
  String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
  setDesc(getValue() + "String_Node_Str" + typeDesc);
}

Fixed version (ground truth):
@Override protected void postRead(DexFile dexFile){
  int index=getValue();
  if (index > 0) {
    TypeIdItem typeId=dexFile.getTypeIdItem(index);
    String typeDesc=dexFile.getString(typeId.getDescriptorIdx());
    setDesc(index + "String_Node_Str" + typeDesc);
  }
 else {
    setDesc(String.valueOf(index));
  }
}
Program: 4445
Project: 4445
Buggy source:
@Override protected Object call() throws Exception {
  System.out.println("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  if (Files.size(file.toPath()) > 512 * 1024) {
  }
  String fileType=getExtension(file.getName());
  FileParser parser=FileParsers.getParser(fileType);
  byte[] bytes=Files.readAllBytes(file.toPath());
  FileComponent fc=parser.parse(bytes);
  FileHex hex=new FileHex(bytes);
  System.out.println("String_Node_Str");
  return new Object[]{fc,hex};
}

Fixed version (ground truth):
@Override protected Object call() throws Exception {
  System.out.println("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  if (Files.size(file.toPath()) > 512 * 1024) {
    throw new FileParseException("String_Node_Str");
  }
  String fileType=getExtension(file.getName());
  FileParser parser=FileParsers.getParser(fileType);
  byte[] bytes=Files.readAllBytes(file.toPath());
  FileComponent fc=parser.parse(bytes);
  FileHex hex=new FileHex(bytes);
  System.out.println("String_Node_Str");
  return new Object[]{fc,hex};
}
Program: 4446
Project: 4446
Buggy source:
private void readPadding(DexReader reader){
  if ((triesSize.getValue() > 0) && (insnsSize.getValue() % 2 == 1)) {
    padding=reader.readUShort();
  }
 else {
    padding=new UShort();
    padding.readNothing(reader);
  }
}

Fixed version (ground truth):
private void readPadding(DexReader reader){
  if ((triesSize.getValue() > 0) && (insnsSize.getValue() % 2 == 1)) {
    padding=reader.readUShort();
  }
}
Program: 4447
Project: 4447
Buggy source:
private void readPadding(DexReader reader){
  if ((reader.getPosition() % 4) != 0) {
    padding=reader.readUShort();
  }
 else {
    padding=new UShort();
    padding.readNothing(reader);
  }
}

Fixed version (ground truth):
private void readPadding(DexReader reader){
  if ((triesSize.getValue() > 0) && (insnsSize.getValue() % 2 == 1)) {
    padding=reader.readUShort();
  }
 else {
    padding=new UShort();
    padding.readNothing(reader);
  }
}
Program: 4448
Project: 4448
Buggy source:
public void setName(String name){
  this.name=name;
}

Fixed version (ground truth):
public final void setName(String name){
  this.name=name;
}
Program: 4449
Project: 4449
Buggy source:
public String getName(){
  return name;
}

Fixed version (ground truth):
public final String getName(){
  return name;
}
Program: 4450
Project: 4450
Buggy source:
public int getOffset(){
  return offset;
}

Fixed version (ground truth):
public final int getOffset(){
  return offset;
}
Program: 4451
Project: 4451
Buggy source:
public int getLength(){
  return length;
}

Fixed version (ground truth):
public final int getLength(){
  return length;
}
Program: 4452
Project: 4452
Buggy source:
public String getDesc(){
  return desc;
}

Fixed version (ground truth):
public final String getDesc(){
  return desc;
}
Program: 4453
Project: 4453
Buggy source:
public void setDesc(String desc){
  this.desc=desc;
}

Fixed version (ground truth):
public final void setDesc(String desc){
  this.desc=desc;
}
Program: 4454
Project: 4454
Buggy source:
public Instruction(Opcode opcode){
  this.opcode=opcode;
}

Fixed version (ground truth):
public Instruction(Opcode opcode){
  this.opcode=opcode;
  setName(opcode.name());
}
Program: 4455
Project: 4455
Buggy source:
private int calcTextPosition(int byteOffset){
  int rowIndex=byteOffset / bytesPerRow;
  int colIndex=byteOffset % bytesPerRow;
  return (75 * rowIndex) + 10 + (colIndex * 3);
}

Fixed version (ground truth):
private int calcTextPosition(int byteOffset){
  int rowIndex=byteOffset / bytesPerRow;
  int colIndex=byteOffset % bytesPerRow;
  return (76 * rowIndex) + 10 + (colIndex * 3);
}
Program: 4456
Project: 4456
Buggy source:
public void forEach(Consumer<ConstantInfo> consumer){
  for (int i=1; i < cpCount; i++) {
    consumer.accept(constants[i]);
  }
}

Fixed version (ground truth):
public void forEach(Consumer<ConstantInfo> consumer){
  for (  ConstantInfo c : constants) {
    if (c != null) {
      consumer.accept(c);
    }
  }
}
Program: 4457
Project: 4457
Buggy source:
@Override protected void readContent(ClassReader reader){
  for (int i=1; i < cpCount; i++) {
    constants[i]=reader.readConstantInfo();
    setConstantName(constants[i],i);
  }
}

Fixed version (ground truth):
@Override protected void readContent(ClassReader reader){
  for (int i=1; i < cpCount; i++) {
    ConstantInfo c=reader.readConstantInfo();
    setConstantName(c,i);
    constants[i]=c;
    if (c instanceof ConstantLongInfo || c instanceof ConstantDoubleInfo) {
      i++;
    }
  }
}
Program: 4458
Project: 4458
Buggy source:
@Test public void read() throws Exception {
  String classFileName=TestClass.class.getName().replace('.','/') + "String_Node_Str";
  Path classFilePath=Paths.get(TestClass.class.getClassLoader().getResource(classFileName).toURI());
  byte[] classBytes=Files.readAllBytes(classFilePath);
  ClassFile cf=ClassFile.parse(classBytes);
  assertEquals(0,cf.getMinorVersion().getValue());
  assertEquals(52,cf.getMajorVersion().getValue());
  assertEquals(110,cf.getConstantPoolCount().getValue());
  assertEquals(2,cf.getInterfacesCount().getValue());
  assertEquals(6,cf.getFieldsCount().getValue());
}

Fixed version (ground truth):
@Test public void read() throws Exception {
  String classFileName=TestClass.class.getName().replace('.','/') + "String_Node_Str";
  Path classFilePath=Paths.get(TestClass.class.getClassLoader().getResource(classFileName).toURI());
  byte[] classBytes=Files.readAllBytes(classFilePath);
  ClassFile cf=ClassFile.parse(classBytes);
  assertEquals(0,cf.getMinorVersion().getValue());
  assertEquals(52,cf.getMajorVersion().getValue());
  assertEquals(114,cf.getConstantPoolCount().getValue());
  assertEquals(2,cf.getInterfacesCount().getValue());
  assertEquals(7,cf.getFieldsCount().getValue());
}
Program: 4459
Project: 4459
Buggy source:
@Override public ShimDataResponse getData(ShimDataRequest shimDataRequest) throws ShimException {
  AccessParameters accessParameters=shimDataRequest.getAccessParameters();
  String accessToken=accessParameters.getAccessToken();
  String tokenSecret=accessParameters.getTokenSecret();
  FitbitDataType fitbitDataType;
  try {
    fitbitDataType=FitbitDataType.valueOf(shimDataRequest.getDataTypeKey().trim().toUpperCase());
  }
 catch (  NullPointerException|IllegalArgumentException e) {
    throw new ShimException("String_Node_Str" + shimDataRequest.getDataTypeKey() + "String_Node_Str");
  }
  DateTime today=dayFormatter.parseDateTime(new DateTime().toString(dayFormatter));
  DateTime startDate=shimDataRequest.getStartDate() == null ? today.minusDays(1) : shimDataRequest.getStartDate();
  DateTime endDate=shimDataRequest.getEndDate() == null ? today.plusDays(1) : shimDataRequest.getEndDate();
  DateTime currentDate=startDate;
  List<ShimDataResponse> dayResponses=new ArrayList<>();
  while (currentDate.toDate().before(endDate.toDate()) || currentDate.toDate().equals(endDate.toDate())) {
    dayResponses.add(getDaysData(currentDate,fitbitDataType,shimDataRequest.getNormalize(),accessToken,tokenSecret));
    currentDate=currentDate.plusDays(1);
  }
  return shimDataRequest.getNormalize() ? aggregateNormalized(dayResponses) : aggregateIntoList(dayResponses);
}

Fixed version (ground truth):
@Override public ShimDataResponse getData(ShimDataRequest shimDataRequest) throws ShimException {
  AccessParameters accessParameters=shimDataRequest.getAccessParameters();
  String accessToken=accessParameters.getAccessToken();
  String tokenSecret=accessParameters.getTokenSecret();
  FitbitDataType fitbitDataType;
  try {
    fitbitDataType=FitbitDataType.valueOf(shimDataRequest.getDataTypeKey().trim().toUpperCase());
  }
 catch (  NullPointerException|IllegalArgumentException e) {
    throw new ShimException("String_Node_Str" + shimDataRequest.getDataTypeKey() + "String_Node_Str");
  }
  DateTime today=dayFormatter.parseDateTime(new DateTime().toString(dayFormatter));
  DateTime startDate=shimDataRequest.getStartDate() == null ? today.minusDays(1) : shimDataRequest.getStartDate();
  DateTime endDate=shimDataRequest.getEndDate() == null ? today.plusDays(1) : shimDataRequest.getEndDate();
  DateTime currentDate=startDate;
  if (fitbitDataType.equals(FitbitDataType.WEIGHT)) {
    return getRangeData(startDate,endDate,fitbitDataType,shimDataRequest.getNormalize(),accessToken,tokenSecret);
  }
 else {
    List<ShimDataResponse> dayResponses=new ArrayList<>();
    while (currentDate.toDate().before(endDate.toDate()) || currentDate.toDate().equals(endDate.toDate())) {
      dayResponses.add(getDaysData(currentDate,fitbitDataType,shimDataRequest.getNormalize(),accessToken,tokenSecret));
      currentDate=currentDate.plusDays(1);
    }
    return shimDataRequest.getNormalize() ? aggregateNormalized(dayResponses) : aggregateIntoList(dayResponses);
  }
}
Program: 4460
Project: 4460
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testActivityNormalize() throws IOException {
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testActivityNormalize() throws IOException, ProcessingException {
}
Program: 4461
Project: 4461
Buggy source:
public AnomalyLikelihood(boolean useMovingAvg,int windowSize,boolean isWeighted,int claLearningPeriod,int estimationSamples){
  super(useMovingAvg,windowSize);
  this.isWeighted=isWeighted;
  this.claLearningPeriod=claLearningPeriod == VALUE_NONE ? this.claLearningPeriod : claLearningPeriod;
  this.estimationSamples=estimationSamples == VALUE_NONE ? this.estimationSamples : estimationSamples;
  this.probationaryPeriod=claLearningPeriod + estimationSamples;
  this.reestimationPeriod=100;
}

Fixed version (ground truth):
public AnomalyLikelihood(boolean useMovingAvg,int windowSize,boolean isWeighted,int claLearningPeriod,int estimationSamples){
  super(useMovingAvg,windowSize);
  this.isWeighted=isWeighted;
  this.claLearningPeriod=claLearningPeriod == VALUE_NONE ? this.claLearningPeriod : claLearningPeriod;
  this.estimationSamples=estimationSamples == VALUE_NONE ? this.estimationSamples : estimationSamples;
  this.probationaryPeriod=this.claLearningPeriod + this.estimationSamples;
  this.reestimationPeriod=100;
}
Program: 4463
Project: 4463
Buggy source:
/** 
 * Returns a   {@link Tuple} containing the current key in thezero'th slot, and a list objects which are members of the group specified by that key. {@inheritDoc}
 */
@SuppressWarnings("String_Node_Str") @Override public Tuple next(){
  Object[] objs=IntStream.range(0,numEntries + 1).mapToObj(i -> i == 0 ? minKeyVal : new ArrayList<R>()).toArray();
  Tuple retVal=new Tuple((Object[])objs);
  for (int i=0; i < numEntries; i++) {
    if (isEligibleList(i,minKeyVal)) {
      ((List<Object>)retVal.get(i + 1)).add(nextList[i].get().getKey());
      drainKey(retVal,i,minKeyVal);
      advanceList[i]=true;
    }
 else {
      advanceList[i]=false;
      ((List<Object>)retVal.get(i + 1)).add(Slot.empty());
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Returns a   {@link Tuple} containing the current key in thezero'th slot, and a list objects which are members of the group specified by that key. {@inheritDoc}
 */
@SuppressWarnings("String_Node_Str") @Override public Tuple next(){
  Object[] objs=IntStream.range(0,numEntries + 1).mapToObj(i -> i == 0 ? minKeyVal : new ArrayList<R>()).toArray();
  Tuple retVal=new Tuple((Object[])objs);
  for (int i=0; i < numEntries; i++) {
    if (isEligibleList(i,minKeyVal)) {
      ((List<Object>)retVal.get(i + 1)).add(nextList[i].get().getFirst());
      drainKey(retVal,i,minKeyVal);
      advanceList[i]=true;
    }
 else {
      advanceList[i]=false;
      ((List<Object>)retVal.get(i + 1)).add(Slot.empty());
    }
  }
  return retVal;
}
Program: 4464
Project: 4464
Buggy source:
/** 
 * Returns a flag indicating whether the list currently pointed to by the specified index contains a key which matches the specified "targetKey".
 * @param listIdx       the index pointing to the {@link GroupBy} beingprocessed.
 * @param targetKey     the specified key to match.
 * @return  true if so, false if not
 */
private boolean isEligibleList(int listIdx,Object targetKey){
  return nextList[listIdx].isPresent() && nextList[listIdx].get().getValue().equals(targetKey);
}

Fixed version (ground truth):
/** 
 * Returns a flag indicating whether the list currently pointed to by the specified index contains a key which matches the specified "targetKey".
 * @param listIdx       the index pointing to the {@link GroupBy} beingprocessed.
 * @param targetKey     the specified key to match.
 * @return  true if so, false if not
 */
private boolean isEligibleList(int listIdx,Object targetKey){
  return nextList[listIdx].isPresent() && nextList[listIdx].get().getSecond().equals(targetKey);
}
Program: 4465
Project: 4465
Buggy source:
/** 
 * Returns the next smallest generated key.
 * @return  the next smallest generated key.
 */
private boolean nextMinKey(){
  return Arrays.stream(nextList).filter(opt -> opt.isPresent()).map(opt -> opt.get().getValue()).min((k,k2) -> k.compareTo(k2)).map(k -> {
    minKeyVal=k;
    return k;
  }
).isPresent();
}

Fixed version (ground truth):
/** 
 * Returns the next smallest generated key.
 * @return  the next smallest generated key.
 */
private boolean nextMinKey(){
  return Arrays.stream(nextList).filter(opt -> opt.isPresent()).map(opt -> opt.get().getSecond()).min((k,k2) -> k.compareTo(k2)).map(k -> {
    minKeyVal=k;
    return k;
  }
).isPresent();
}
Program: 4466
Project: 4466
Buggy source:
/** 
 * (Re)initializes the internal   {@link Generator}(s). This method may be used to "restart" the internal   {@link Iterator}s and reuse this object.
 */
@SuppressWarnings("String_Node_Str") public void reset(){
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getKey(),entries[i].getValue()));
  }
  numEntries=generatorList.size();
  advanceList=new boolean[numEntries];
  Arrays.fill(advanceList,true);
  nextList=new Slot[numEntries];
  Arrays.fill(nextList,Slot.NONE);
}

Fixed version (ground truth):
/** 
 * (Re)initializes the internal   {@link Generator}(s). This method may be used to "restart" the internal   {@link Iterator}s and reuse this object.
 */
@SuppressWarnings("String_Node_Str") public void reset(){
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getFirst(),entries[i].getSecond()));
  }
  numEntries=generatorList.size();
  advanceList=new boolean[numEntries];
  Arrays.fill(advanceList,true);
  nextList=new Slot[numEntries];
  Arrays.fill(nextList,Slot.NONE);
}
Program: 4467
Project: 4467
Buggy source:
/** 
 * Each input grouper may generate multiple members which match the specified "targetVal". This method guarantees that all members  are added to the list residing at the specified Tuple index.
 * @param retVal        the Tuple being added to
 * @param listIdx       the index specifying the list within the tuple which will have members added to it
 * @param targetVal     the value to match in order to be an added member
 */
@SuppressWarnings("String_Node_Str") private void drainKey(Tuple retVal,int listIdx,R targetVal){
  while (generatorList.get(listIdx).hasNext()) {
    if (generatorList.get(listIdx).peek().getValue().equals(targetVal)) {
      nextList[listIdx]=Slot.of(generatorList.get(listIdx).next());
      ((List<Object>)retVal.get(listIdx + 1)).add(nextList[listIdx].get().getKey());
    }
 else {
      nextList[listIdx]=Slot.empty();
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Each input grouper may generate multiple members which match the specified "targetVal". This method guarantees that all members  are added to the list residing at the specified Tuple index.
 * @param retVal        the Tuple being added to
 * @param listIdx       the index specifying the list within the tuple which will have members added to it
 * @param targetVal     the value to match in order to be an added member
 */
@SuppressWarnings("String_Node_Str") private void drainKey(Tuple retVal,int listIdx,R targetVal){
  while (generatorList.get(listIdx).hasNext()) {
    if (generatorList.get(listIdx).peek().getSecond().equals(targetVal)) {
      nextList[listIdx]=Slot.of(generatorList.get(listIdx).next());
      ((List<Object>)retVal.get(listIdx + 1)).add(nextList[listIdx].get().getFirst());
    }
 else {
      nextList[listIdx]=Slot.empty();
      break;
    }
  }
}
Program: 4468
Project: 4468
Buggy source:
/** 
 * Used internally to find the synapse with the smallest permanence on the given segment.
 * @param dd    Segment object to search for synapses on
 * @return  Synapse object on the segment with the minimal permanence
 */
private Synapse minPermanenceSynapse(DistalDendrite dd){
  List<Synapse> synapses=getSynapses(dd);
  Synapse min=null;
  double minPermanence=Double.MAX_VALUE;
  for (  Synapse synapse : synapses) {
    if (!synapse.destroyed() && synapse.getPermanence() < minPermanence - EPSILON) {
      min=synapse;
      minPermanence=synapse.getPermanence();
    }
  }
  return min;
}

Fixed version (ground truth):
/** 
 * Used internally to find the synapse with the smallest permanence on the given segment.
 * @param dd    Segment object to search for synapses on
 * @return  Synapse object on the segment with the minimal permanence
 */
private Synapse minPermanenceSynapse(DistalDendrite dd){
  List<Synapse> synapses=unDestroyedSynapsesForSegment(dd);
  Synapse min=null;
  double minPermanence=Double.MAX_VALUE;
  for (  Synapse synapse : synapses) {
    if (!synapse.destroyed() && synapse.getPermanence() < minPermanence - EPSILON) {
      min=synapse;
      minPermanence=synapse.getPermanence();
    }
  }
  return min;
}
Program: 4469
Project: 4469
Buggy source:
/** 
 * Creates a new synapse on a segment.
 * @param segment               the {@link DistalDendrite} segment to which a {@link Synapse} is being created
 * @param presynapticCell       the source {@link Cell}
 * @param permanence            the initial permanence
 * @return  the created {@link Synapse}
 */
public Synapse createSynapse(DistalDendrite segment,Cell presynapticCell,double permanence){
  while (numSynapses(segment) >= maxSynapsesPerSegment) {
    destroySynapse(minPermanenceSynapse(segment));
  }
  Synapse synapse=null;
  boolean found=false;
  if (segment.getNumDestroyedSynapses() > 0) {
    for (    Synapse s : getSynapses(segment)) {
      if (s.destroyed()) {
        synapse=s;
        found=true;
        break;
      }
    }
    if (!found) {
      throw new IllegalStateException("String_Node_Str");
    }
    synapse.setDestroyed(false);
    segment.decDestroyedSynapses();
    incrementDistalSynapses();
  }
 else {
    getSynapses(segment).add(synapse=new Synapse(this,presynapticCell,segment,null,incrementDistalSynapses(),presynapticCell.getIndex()));
  }
  getReceptorSynapses(presynapticCell,true).add(synapse);
  synapse.setPermanence(this,permanence);
  return synapse;
}

Fixed version (ground truth):
/** 
 * Creates a new synapse on a segment.
 * @param segment               the {@link DistalDendrite} segment to which a {@link Synapse} is being created
 * @param presynapticCell       the source {@link Cell}
 * @param permanence            the initial permanence
 * @return  the created {@link Synapse}
 */
public Synapse createSynapse(DistalDendrite segment,Cell presynapticCell,double permanence){
  while (numSynapses(segment) >= maxSynapsesPerSegment) {
    destroySynapse(minPermanenceSynapse(segment));
  }
  Synapse synapse=null;
  boolean found=false;
  if (segment.getNumDestroyedSynapses() > 0) {
    for (    Synapse s : getSynapses(segment)) {
      if (s.destroyed()) {
        synapse=s;
        found=true;
        break;
      }
    }
    if (!found) {
      throw new IllegalStateException("String_Node_Str");
    }
    synapse.setDestroyed(false);
    segment.decDestroyedSynapses();
    incrementDistalSynapses();
    synapse.setPresynapticCell(presynapticCell);
  }
 else {
    getSynapses(segment).add(synapse=new Synapse(this,presynapticCell,segment,null,incrementDistalSynapses(),presynapticCell.getIndex()));
  }
  getReceptorSynapses(presynapticCell,true).add(synapse);
  synapse.setPermanence(this,permanence);
  return synapse;
}
Program: 4471
Project: 4471
Buggy source:
/** 
 * Returns a   {@link Tuple} containing the current key in thezero'th slot, and a list objects which are members of the group specified by that key. {@inheritDoc}
 */
@SuppressWarnings("String_Node_Str") @Override public Tuple next(){
  advanceSequences();
  R minKeyVal=nextMinKey();
  Object[] objs=IntStream.range(0,numEntries + 1).mapToObj(i -> i == 0 ? minKeyVal : new ArrayList<R>()).toArray();
  Tuple retVal=new Tuple((Object[])objs);
  for (int i=0; i < numEntries; i++) {
    if (isEligibleList(i,minKeyVal)) {
      ((List<Object>)retVal.get(i + 1)).add(nextList[i].get().getKey());
      drainKey(retVal,i,minKeyVal);
      advanceList[i]=true;
    }
 else {
      advanceList[i]=false;
      ((List<Object>)retVal.get(i + 1)).add(NONE);
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Returns a   {@link Tuple} containing the current key in thezero'th slot, and a list objects which are members of the group specified by that key. {@inheritDoc}
 */
@SuppressWarnings("String_Node_Str") @Override public Tuple next(){
  Object[] objs=IntStream.range(0,numEntries + 1).mapToObj(i -> i == 0 ? minKeyVal : new ArrayList<R>()).toArray();
  Tuple retVal=new Tuple((Object[])objs);
  for (int i=0; i < numEntries; i++) {
    if (isEligibleList(i,minKeyVal)) {
      ((List<Object>)retVal.get(i + 1)).add(nextList[i].get().getKey());
      drainKey(retVal,i,minKeyVal);
      advanceList[i]=true;
    }
 else {
      advanceList[i]=false;
      ((List<Object>)retVal.get(i + 1)).add(NONE);
    }
  }
  return retVal;
}
Program: 4472
Project: 4472
Buggy source:
/** 
 * (Re)initializes the internal   {@link Generator}(s). This method may be used to "restart" the internal   {@link Iterator}s and reuse this object.
 */
@SuppressWarnings("String_Node_Str") public void reset(){
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getKey(),entries[i].getValue()));
  }
  numEntries=generatorList.size();
  for (int i=0; i < numEntries; i++) {
    for (    Pair<Object,R> p : generatorList.get(i)) {
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ p.getValue()+ "String_Node_Str"+ p.getKey());
    }
    System.out.println("String_Node_Str");
  }
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getKey(),entries[i].getValue()));
  }
  advanceList=new boolean[numEntries];
  Arrays.fill(advanceList,true);
  nextList=new Optional[numEntries];
  Arrays.fill(nextList,NONE);
}

Fixed version (ground truth):
/** 
 * (Re)initializes the internal   {@link Generator}(s). This method may be used to "restart" the internal   {@link Iterator}s and reuse this object.
 */
@SuppressWarnings("String_Node_Str") public void reset(){
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getKey(),entries[i].getValue()));
  }
  numEntries=generatorList.size();
  for (int i=0; i < numEntries; i++) {
    for (    Pair<Object,R> p : generatorList.get(i)) {
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ p.getKey()+ "String_Node_Str"+ p.getValue());
    }
    System.out.println("String_Node_Str");
  }
  generatorList=new ArrayList<>();
  for (int i=0; i < entries.length; i++) {
    generatorList.add(GroupBy.of(entries[i].getKey(),entries[i].getValue()));
  }
  advanceList=new boolean[numEntries];
  Arrays.fill(advanceList,true);
  nextList=new Optional[numEntries];
  Arrays.fill(nextList,NONE);
}