nus-yam/ex-repair huggingface dataset:
Program: 39028
Project: 39028
Buggy source:
public VBoxProvisioner(Map<String,String> attributes){
  this.username=attributes.get("String_Node_Str");
  this.password=attributes.get("String_Node_Str");
  this.pub_key_file=attributes.get("String_Node_Str");
  this.hostonlyif_name=attributes.get("String_Node_Str");
  this.bridgedif_name=attributes.get("String_Node_Str");
  if (!attributes.containsKey("String_Node_Str")) {
    this.port_start=VBoxProvisioner.DEFAULT_PORT;
  }
 else {
    this.port_start=Integer.parseInt(attributes.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
public VBoxProvisioner(Map<String,String> attributes) throws UnableToProvisionServerException {
  this.username=attributes.get("String_Node_Str");
  this.password=attributes.get("String_Node_Str");
  this.hostonlyif_name=attributes.get("String_Node_Str");
  this.bridgedif_name=attributes.get("String_Node_Str");
  if (!attributes.containsKey("String_Node_Str")) {
    this.port_start=VBoxProvisioner.DEFAULT_PORT;
  }
 else {
    this.port_start=Integer.parseInt(attributes.get("String_Node_Str"));
  }
  String pub_key_file=attributes.get("String_Node_Str");
  try {
    FileReader input=null;
    input=new FileReader(pub_key_file);
    BufferedReader bufRead=new BufferedReader(input);
    String line;
    StringBuilder sb=new StringBuilder();
    String newLine="String_Node_Str";
    while ((line=bufRead.readLine()) != null) {
      sb.append(line).append(newLine);
    }
    public_key=sb.toString();
    logger.info("String_Node_Str");
    logger.trace("String_Node_Str",public_key);
  }
 catch (  Exception e) {
    throw new UnableToProvisionServerException("String_Node_Str" + pub_key_file);
  }
  DoRuntime.exec("String_Node_Str","String_Node_Str","String_Node_Str",this.hostonlyif_name,"String_Node_Str","String_Node_Str");
  DoRuntime.exec("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.hostonlyif_name,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 39029
Project: 39029
Buggy source:
private void requestReplace(final ReceiveCommand cmd,final Change change,final RevCommit newCommit){
  if (change.getStatus().isClosed()) {
    reject(cmd,"String_Node_Str" + change.getId() + "String_Node_Str");
    return;
  }
  final ReplaceRequest req=new ReplaceRequest(change.getId(),newCommit,cmd);
  if (replaceByChange.containsKey(req.ontoChange)) {
    reject(cmd,"String_Node_Str");
    return;
  }
  if (replaceByCommit.containsKey(req.newCommit)) {
    reject(cmd,"String_Node_Str");
    return;
  }
  replaceByChange.put(req.ontoChange,req);
  replaceByCommit.put(req.newCommit,req);
}

Fixed version (ground truth):
private boolean requestReplace(final ReceiveCommand cmd,final Change change,final RevCommit newCommit){
  if (change.getStatus().isClosed()) {
    reject(cmd,"String_Node_Str" + change.getId() + "String_Node_Str");
    return false;
  }
  final ReplaceRequest req=new ReplaceRequest(change.getId(),newCommit,cmd);
  if (replaceByChange.containsKey(req.ontoChange)) {
    reject(cmd,"String_Node_Str");
    return false;
  }
  if (replaceByCommit.containsKey(req.newCommit)) {
    reject(cmd,"String_Node_Str");
    return false;
  }
  replaceByChange.put(req.ontoChange,req);
  replaceByCommit.put(req.newCommit,req);
  return true;
}
Program: 39031
Project: 39031
Buggy source:
private void requestReplace(final ReceiveCommand cmd,final Change change,final RevCommit newCommit){
  if (change.getStatus().isClosed()) {
    reject(cmd,"String_Node_Str" + change.getId() + "String_Node_Str");
    return;
  }
  final ReplaceRequest req=new ReplaceRequest(change.getId(),newCommit,cmd);
  if (replaceByChange.containsKey(req.ontoChange)) {
    reject(cmd,"String_Node_Str");
    return;
  }
  if (replaceByCommit.containsKey(req.newCommit)) {
    reject(cmd,"String_Node_Str");
    return;
  }
  replaceByChange.put(req.ontoChange,req);
  replaceByCommit.put(req.newCommit,req);
}

Fixed version (ground truth):
private boolean requestReplace(final ReceiveCommand cmd,final Change change,final RevCommit newCommit){
  if (change.getStatus().isClosed()) {
    reject(cmd,"String_Node_Str" + change.getId() + "String_Node_Str");
    return false;
  }
  final ReplaceRequest req=new ReplaceRequest(change.getId(),newCommit,cmd);
  if (replaceByChange.containsKey(req.ontoChange)) {
    reject(cmd,"String_Node_Str");
    return false;
  }
  if (replaceByCommit.containsKey(req.newCommit)) {
    reject(cmd,"String_Node_Str");
    return false;
  }
  replaceByChange.put(req.ontoChange,req);
  replaceByCommit.put(req.newCommit,req);
  return true;
}
Program: 39033
Project: 39033
Buggy source:
SearchPanel(){
  final FlowPanel body=new FlowPanel();
  initWidget(body);
  setStyleName(Gerrit.RESOURCES.css().searchPanel());
  searchBox=new HintTextBox();
  searchBox.setVisibleLength(70);
  searchBox.setHintText(Gerrit.C.searchHint());
  searchBox.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    final KeyPressEvent event){
switch (event.getCharCode()) {
case KeyCodes.KEY_ENTER:
        doSearch();
      break;
case KeyCodes.KEY_ESCAPE:
    searchBox.setText("String_Node_Str");
  searchBox.setFocus(false);
break;
}
}
}
);
final Button searchButton=new Button(Gerrit.C.searchButton());
searchButton.addClickHandler(new ClickHandler(){
@Override public void onClick(ClickEvent event){
doSearch();
}
}
);
body.add(searchBox);
body.add(searchButton);
}

Fixed version (ground truth):
SearchPanel(){
  final FlowPanel body=new FlowPanel();
  initWidget(body);
  setStyleName(Gerrit.RESOURCES.css().searchPanel());
  searchBox=new HintTextBox();
  searchBox.setVisibleLength(70);
  searchBox.setHintText(Gerrit.C.searchHint());
  searchBox.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    final KeyPressEvent event){
      if (event.getCharCode() == KeyCodes.KEY_ENTER) {
        doSearch();
      }
    }
  }
);
  final Button searchButton=new Button(Gerrit.C.searchButton());
  searchButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      doSearch();
    }
  }
);
  body.add(searchBox);
  body.add(searchButton);
}
Program: 39034
Project: 39034
Buggy source:
@Override public void onBlur(BlurEvent event){
  setFocus(false);
}

Fixed version (ground truth):
@Override public void onBlur(BlurEvent event){
  blurHint();
  isFocused=false;
}
Program: 39035
Project: 39035
Buggy source:
public void setFocus(boolean focus){
  if (focus) {
    bugStopping=true;
    super.setFocus(!focus);
    bugStopping=false;
  }
  super.setFocus(focus);
  if (focus) {
    focusHint();
  }
 else   if (!bugStopping) {
    blurHint();
  }
  isFocused=focus;
}

Fixed version (ground truth):
public void setFocus(boolean focus){
  super.setFocus(focus);
  if (focus != isFocused) {
    if (focus) {
      focusHint();
    }
 else {
      blurHint();
    }
  }
  isFocused=focus;
}
Program: 39036
Project: 39036
Buggy source:
public void setHintText(String text){
  if (text == null) {
    if (hintText == null) {
      return;
    }
    hintFocusHandler.removeHandler();
    hintFocusHandler=null;
    hintBlurHandler.removeHandler();
    hintBlurHandler=null;
    hintText=null;
    focusHint();
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        setFocus(true);
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        setFocus(false);
      }
    }
);
  }
 else {
    focusHint();
    hintText=text;
  }
  if (!isFocused) {
    blurHint();
  }
}

Fixed version (ground truth):
public void setHintText(String text){
  if (text == null) {
    if (hintText == null) {
      return;
    }
    hintFocusHandler.removeHandler();
    hintFocusHandler=null;
    hintBlurHandler.removeHandler();
    hintBlurHandler=null;
    keyDownHandler.removeHandler();
    keyDownHandler=null;
    hintText=null;
    focusHint();
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        focusHint();
        prevText=getText();
        isFocused=true;
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        blurHint();
        isFocused=false;
      }
    }
);
    keyDownHandler=addKeyDownHandler(new KeyDownHandler(){
      @Override public void onKeyDown(      final KeyDownEvent event){
        onKey(event.getNativeKeyCode());
      }
    }
);
  }
 else {
    focusHint();
    hintText=text;
  }
  if (!isFocused) {
    blurHint();
  }
}
Program: 39037
Project: 39037
Buggy source:
@Override public void onFocus(FocusEvent event){
  setFocus(true);
}

Fixed version (ground truth):
@Override public void onFocus(FocusEvent event){
  focusHint();
  prevText=getText();
  isFocused=true;
}
Program: 39038
Project: 39038
Buggy source:
public void setText(String text){
  focusHint();
  super.setText(text);
  if (!isFocused) {
    blurHint();
  }
}

Fixed version (ground truth):
public void setText(String text){
  focusHint();
  super.setText(text);
  prevText=text;
  if (!isFocused) {
    blurHint();
  }
}
Program: 39039
Project: 39039
Buggy source:
@Override public void onBlur(BlurEvent event){
  blurHint();
}

Fixed version (ground truth):
@Override public void onBlur(BlurEvent event){
  setFocus(false);
}
Program: 39040
Project: 39040
Buggy source:
protected void focusHint(){
  if (hintOn) {
    super.setText("String_Node_Str");
    hintOn=false;
    if (getHintStyleName() != null) {
      removeStyleName(getHintStyleName());
    }
  }
}

Fixed version (ground truth):
protected void focusHint(){
  if (hintOn) {
    super.setText("String_Node_Str");
    if (getHintStyleName() != null) {
      removeStyleName(getHintStyleName());
    }
    hintOn=false;
  }
}
Program: 39041
Project: 39041
Buggy source:
public void setHintText(String text){
  if (text == null) {
    if (hintText != null) {
      hintFocusHandler.removeHandler();
      hintFocusHandler=null;
      hintBlurHandler.removeHandler();
      hintBlurHandler=null;
      hintText=null;
      focusHint();
    }
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        focusHint();
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        blurHint();
      }
    }
);
    blurHint();
    return;
  }
  hintText=text;
  if (hintOn) {
    super.setText(text);
  }
}

Fixed version (ground truth):
public void setHintText(String text){
  if (text == null) {
    if (hintText == null) {
      return;
    }
    hintFocusHandler.removeHandler();
    hintFocusHandler=null;
    hintBlurHandler.removeHandler();
    hintBlurHandler=null;
    hintText=null;
    focusHint();
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        setFocus(true);
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        setFocus(false);
      }
    }
);
  }
 else {
    focusHint();
    hintText=text;
  }
  if (!isFocused) {
    blurHint();
  }
}
Program: 39042
Project: 39042
Buggy source:
protected void blurHint(){
  if (!hintOn && getHintText() != null && "String_Node_Str".equals(super.getText())) {
    super.setText(getHintText());
    hintOn=true;
    if (getHintStyleName() != null) {
      addStyleName(getHintStyleName());
    }
  }
}

Fixed version (ground truth):
protected void blurHint(){
  if (!hintOn && getHintText() != null && "String_Node_Str".equals(super.getText())) {
    hintOn=true;
    super.setText(getHintText());
    if (getHintStyleName() != null) {
      addStyleName(getHintStyleName());
    }
  }
}
Program: 39043
Project: 39043
Buggy source:
@Override public void onFocus(FocusEvent event){
  focusHint();
}

Fixed version (ground truth):
@Override public void onFocus(FocusEvent event){
  setFocus(true);
}
Program: 39044
Project: 39044
Buggy source:
public void setText(String text){
  focusHint();
  super.setText(text);
  blurHint();
}

Fixed version (ground truth):
public void setText(String text){
  focusHint();
  super.setText(text);
  if (!isFocused) {
    blurHint();
  }
}
Program: 39045
Project: 39045
Buggy source:
@Override public void onBlur(BlurEvent event){
  blurHint();
}

Fixed version (ground truth):
@Override public void onBlur(BlurEvent event){
  setFocus(false);
}
Program: 39046
Project: 39046
Buggy source:
protected void focusHint(){
  if (hintOn) {
    super.setText("String_Node_Str");
    hintOn=false;
    if (getHintStyleName() != null) {
      removeStyleName(getHintStyleName());
    }
  }
}

Fixed version (ground truth):
protected void focusHint(){
  if (hintOn) {
    super.setText("String_Node_Str");
    if (getHintStyleName() != null) {
      removeStyleName(getHintStyleName());
    }
    hintOn=false;
  }
}
Program: 39047
Project: 39047
Buggy source:
public void setHintText(String text){
  if (text == null) {
    if (hintText != null) {
      hintFocusHandler.removeHandler();
      hintFocusHandler=null;
      hintBlurHandler.removeHandler();
      hintBlurHandler=null;
      hintText=null;
      focusHint();
    }
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        focusHint();
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        blurHint();
      }
    }
);
    blurHint();
    return;
  }
  hintText=text;
  if (hintOn) {
    super.setText(text);
  }
}

Fixed version (ground truth):
public void setHintText(String text){
  if (text == null) {
    if (hintText == null) {
      return;
    }
    hintFocusHandler.removeHandler();
    hintFocusHandler=null;
    hintBlurHandler.removeHandler();
    hintBlurHandler=null;
    hintText=null;
    focusHint();
    return;
  }
  if (hintText == null) {
    hintText=text;
    hintFocusHandler=addFocusHandler(new FocusHandler(){
      @Override public void onFocus(      FocusEvent event){
        setFocus(true);
      }
    }
);
    hintBlurHandler=addBlurHandler(new BlurHandler(){
      @Override public void onBlur(      BlurEvent event){
        setFocus(false);
      }
    }
);
  }
 else {
    focusHint();
    hintText=text;
  }
  if (!isFocused) {
    blurHint();
  }
}
Program: 39048
Project: 39048
Buggy source:
protected void blurHint(){
  if (!hintOn && getHintText() != null && "String_Node_Str".equals(super.getText())) {
    super.setText(getHintText());
    hintOn=true;
    if (getHintStyleName() != null) {
      addStyleName(getHintStyleName());
    }
  }
}

Fixed version (ground truth):
protected void blurHint(){
  if (!hintOn && getHintText() != null && "String_Node_Str".equals(super.getText())) {
    hintOn=true;
    super.setText(getHintText());
    if (getHintStyleName() != null) {
      addStyleName(getHintStyleName());
    }
  }
}
Program: 39049
Project: 39049
Buggy source:
@Override public void onFocus(FocusEvent event){
  focusHint();
}

Fixed version (ground truth):
@Override public void onFocus(FocusEvent event){
  setFocus(true);
}
Program: 39050
Project: 39050
Buggy source:
public void setText(String text){
  focusHint();
  super.setText(text);
  blurHint();
}

Fixed version (ground truth):
public void setText(String text){
  focusHint();
  super.setText(text);
  if (!isFocused) {
    blurHint();
  }
}
Program: 39051
Project: 39051
Buggy source:
TaskThunk(final Continuation cont,final HttpServletRequest req){
  this.cont=cont;
  this.name=generateName(req);
}

Fixed version (ground truth):
TaskThunk(final WorkQueue.Executor executor,final Continuation cont,final HttpServletRequest req){
  this.executor=executor;
  this.cont=cont;
  this.name=generateName(req);
}
Program: 39052
Project: 39052
Buggy source:
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  final HttpServletRequest req=(HttpServletRequest)request;
  final HttpServletResponse rsp=(HttpServletResponse)response;
  final Continuation cont=ContinuationSupport.getContinuation(req);
  WorkQueue.Executor executor=getExecutor();
  if (cont.isInitial()) {
    TaskThunk task=new TaskThunk(cont,req);
    if (maxWait > 0) {
      cont.setTimeout(maxWait);
    }
    cont.suspend(rsp);
    cont.addContinuationListener(task);
    cont.setAttribute(TASK,task);
    executor.submit(task);
  }
 else   if (cont.isExpired()) {
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
 else   if (cont.isResumed() && cont.getAttribute(CANCEL) == Boolean.TRUE) {
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
 else   if (cont.isResumed()) {
    TaskThunk task=(TaskThunk)cont.getAttribute(TASK);
    try {
      task.begin(Thread.currentThread());
      chain.doFilter(req,rsp);
    }
  finally {
      task.end();
      Thread.interrupted();
    }
  }
 else {
    context.log("String_Node_Str");
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  final HttpServletRequest req=(HttpServletRequest)request;
  final HttpServletResponse rsp=(HttpServletResponse)response;
  final Continuation cont=ContinuationSupport.getContinuation(req);
  WorkQueue.Executor executor=getExecutor();
  if (cont.isInitial()) {
    TaskThunk task=new TaskThunk(executor,cont,req);
    if (maxWait > 0) {
      cont.setTimeout(maxWait);
    }
    cont.suspend(rsp);
    cont.addContinuationListener(task);
    cont.setAttribute(TASK,task);
    executor.submit(task);
  }
 else   if (cont.isExpired()) {
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
 else   if (cont.isResumed() && cont.getAttribute(CANCEL) == Boolean.TRUE) {
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
 else   if (cont.isResumed()) {
    TaskThunk task=(TaskThunk)cont.getAttribute(TASK);
    try {
      task.begin(Thread.currentThread());
      chain.doFilter(req,rsp);
    }
  finally {
      task.end();
      Thread.interrupted();
    }
  }
 else {
    context.log("String_Node_Str");
    rsp.sendError(SC_SERVICE_UNAVAILABLE);
  }
}
Program: 39053
Project: 39053
Buggy source:
@Override public void onTimeout(Continuation self){
  WorkQueue.Executor executor=getExecutor();
  executor.remove(this);
}

Fixed version (ground truth):
@Override public void onTimeout(Continuation self){
  executor.remove(this);
}
Program: 39054
Project: 39054
Buggy source:
@Override public IncludedInDetail call() throws OrmException, NoSuchChangeException, NoSuchEntityException, IOException, InvalidRevisionException {
  control=changeControlFactory.validateFor(changeId);
  final PatchSet patch=db.patchSets().get(control.getChange().currentPatchSetId());
  final Repository repo=repoManager.openRepository(control.getProject().getName());
  final Map<String,Ref> refsHeads=repo.getRefDatabase().getRefs(Constants.R_HEADS);
  final Map<String,Ref> refsTags=repo.getRefDatabase().getRefs(Constants.R_TAGS);
  RevWalk rw=new RevWalk(repo);
  try {
    final RevCommit rev=rw.parseCommit(ObjectId.fromString(patch.getRevision().get()));
    final List<String> branches=new ArrayList<String>();
    for (    final String branch : refsHeads.keySet()) {
      if (rw.isMergedInto(rev,rw.parseCommit(refsHeads.get(branch).getObjectId()))) {
        branches.add(branch);
      }
    }
    final List<String> tags=new ArrayList<String>();
    for (    final String tag : refsTags.keySet()) {
      if (rw.isMergedInto(rev,rw.parseCommit(refsTags.get(tag).getObjectId()))) {
        tags.add(tag);
      }
    }
    detail=new IncludedInDetail();
    detail.setBranches(branches);
    detail.setTags(tags);
    return detail;
  }
 catch (  IncorrectObjectTypeException err) {
    throw new InvalidRevisionException();
  }
catch (  MissingObjectException err) {
    throw new InvalidRevisionException();
  }
}

Fixed version (ground truth):
@Override public IncludedInDetail call() throws OrmException, NoSuchChangeException, IOException, InvalidRevisionException {
  control=changeControlFactory.validateFor(changeId);
  final PatchSet patch=db.patchSets().get(control.getChange().currentPatchSetId());
  final Repository repo=repoManager.openRepository(control.getProject().getName());
  try {
    final RevWalk rw=new RevWalk(repo);
    final RevCommit rev;
    try {
      rev=rw.parseCommit(ObjectId.fromString(patch.getRevision().get()));
    }
 catch (    IncorrectObjectTypeException err) {
      throw new InvalidRevisionException();
    }
catch (    MissingObjectException err) {
      throw new InvalidRevisionException();
    }
    detail=new IncludedInDetail();
    detail.setBranches(includedIn(repo,rw,rev,Constants.R_HEADS));
    detail.setTags(includedIn(repo,rw,rev,Constants.R_TAGS));
    return detail;
  }
  finally {
    repo.close();
  }
}
Program: 39056
Project: 39056
Buggy source:
private SafeHtml showTabAfterSpace(SafeHtml src){
  src=src.replaceFirst("String_Node_Str","String_Node_Str");
  src=src.replaceAll("String_Node_Str","String_Node_Str");
  return src;
}

Fixed version (ground truth):
private SafeHtml showTabAfterSpace(SafeHtml src){
  final String m="String_Node_Str";
  final String r="String_Node_Str";
  src=src.replaceFirst("String_Node_Str" + m,r);
  src=src.replaceAll("String_Node_Str" + m,"String_Node_Str" + r);
  return src;
}
Program: 39057
Project: 39057
Buggy source:
public void start(final Environment env) throws IOException {
  err.write(Constants.encodeASCII("String_Node_Str"));
  in.close();
  out.close();
  err.close();
  exit.onExit(127);
}

Fixed version (ground truth):
public void start(final Environment env) throws IOException {
  err.write(Constants.encodeASCII("String_Node_Str"));
  err.flush();
  in.close();
  out.close();
  err.close();
  exit.onExit(127);
}
Program: 39058
Project: 39058
Buggy source:
public Command create(){
  return new Command(){
    private InputStream in;
    private OutputStream out;
    private OutputStream err;
    private ExitCallback exit;
    public void setInputStream(    final InputStream in){
      this.in=in;
    }
    public void setOutputStream(    final OutputStream out){
      this.out=out;
    }
    public void setErrorStream(    final OutputStream err){
      this.err=err;
    }
    public void setExitCallback(    final ExitCallback callback){
      this.exit=callback;
    }
    public void start(    final Environment env) throws IOException {
      err.write(Constants.encodeASCII("String_Node_Str"));
      in.close();
      out.close();
      err.close();
      exit.onExit(127);
    }
    public void destroy(){
    }
  }
;
}

Fixed version (ground truth):
public Command create(){
  return new Command(){
    private InputStream in;
    private OutputStream out;
    private OutputStream err;
    private ExitCallback exit;
    public void setInputStream(    final InputStream in){
      this.in=in;
    }
    public void setOutputStream(    final OutputStream out){
      this.out=out;
    }
    public void setErrorStream(    final OutputStream err){
      this.err=err;
    }
    public void setExitCallback(    final ExitCallback callback){
      this.exit=callback;
    }
    public void start(    final Environment env) throws IOException {
      err.write(Constants.encodeASCII("String_Node_Str"));
      err.flush();
      in.close();
      out.close();
      err.close();
      exit.onExit(127);
    }
    public void destroy(){
    }
  }
;
}
Program: 39059
Project: 39059
Buggy source:
public void testGetCauses_CreateSchema() throws OrmException {
  try {
    getSchemaVersion();
    fail("String_Node_Str");
  }
 catch (  OrmException e) {
    final Throwable cause=e.getCause();
    assertTrue(cause instanceof SQLException);
    final String msg=cause.getMessage();
    assertEquals("String_Node_Str",msg.split("String_Node_Str")[0]);
  }
  db.create();
  final SystemConfig config=getSystemConfig();
  final SchemaVersion version=getSchemaVersion();
  assertNotNull(version);
  assertEquals(ReviewDb.VERSION,version.versionNbr);
  assertNotNull(config);
  assertNotNull(config.adminGroupId);
  assertNotNull(config.anonymousGroupId);
  assertNotNull(config.registeredGroupId);
  File sitePath=new File("String_Node_Str").getAbsoluteFile();
  if (sitePath.getName().equals("String_Node_Str")) {
    sitePath=sitePath.getParentFile();
  }
  assertEquals(sitePath.getAbsolutePath(),config.sitePath);
  assertNotNull(config.registerEmailPrivateKey);
  assertTrue(20 < config.registerEmailPrivateKey.length());
}

Fixed version (ground truth):
public void testGetCauses_CreateSchema() throws OrmException, SQLException {
{
    final JdbcSchema d=(JdbcSchema)db.open();
    try {
      final String[] types={"String_Node_Str","String_Node_Str"};
      final ResultSet rs=d.getConnection().getMetaData().getTables(null,null,null,types);
      try {
        assertFalse(rs.next());
      }
  finally {
        rs.close();
      }
    }
  finally {
      d.close();
    }
  }
  db.create();
  final SystemConfig config=getSystemConfig();
  final SchemaVersion version=getSchemaVersion();
  assertNotNull(version);
  assertEquals(ReviewDb.VERSION,version.versionNbr);
  assertNotNull(config);
  assertNotNull(config.adminGroupId);
  assertNotNull(config.anonymousGroupId);
  assertNotNull(config.registeredGroupId);
  File sitePath=new File("String_Node_Str").getAbsoluteFile();
  if (sitePath.getName().equals("String_Node_Str")) {
    sitePath=sitePath.getParentFile();
  }
  assertEquals(sitePath.getAbsolutePath(),config.sitePath);
  assertNotNull(config.registerEmailPrivateKey);
  assertTrue(20 < config.registerEmailPrivateKey.length());
}
Program: 39060
Project: 39060
Buggy source:
private static boolean isBecomeAnyoneEnabled(){
  try {
    String s="String_Node_Str";
    return Boolean.getBoolean(s);
  }
 catch (  SecurityException se) {
    return false;
  }
}

Fixed version (ground truth):
private static boolean isBecomeAnyoneEnabled(){
  try {
    return Boolean.getBoolean("String_Node_Str");
  }
 catch (  SecurityException se) {
    return false;
  }
}
Program: 39062
Project: 39062
Buggy source:
public void onSuccess(final HostPageData result){
  myConfig=result.config;
  if (result.xsrfToken != null) {
    JsonUtil.getDefaultXsrfManager().setToken(null,result.xsrfToken);
  }
  if (result.userAccount != null) {
    myAccount=result.userAccount;
    applyUserPreferences();
  }
  onModuleLoad2();
}

Fixed version (ground truth):
public void onSuccess(final HostPageData result){
  myConfig=result.config;
  if (result.userAccount != null) {
    myAccount=result.userAccount;
    applyUserPreferences();
  }
  onModuleLoad2();
}
Program: 39063
Project: 39063
Buggy source:
@Inject HostPageServlet(final Provider<CurrentUser> cu,final Provider<WebSession> ws,@SitePath final File path,final GerritConfig gc,@CanonicalWebUrl @Nullable final Provider<String> up,@CanonicalWebUrl @Nullable final String configuredUrl,final ServletContext servletContext) throws IOException {
  currentUser=cu;
  webSession=ws;
  urlProvider=up;
  sitePath=path;
  config=gc;
  wantSSL=configuredUrl != null && configuredUrl.startsWith("String_Node_Str");
  final String hostPageName="String_Node_Str";
  hostDoc=HtmlDomUtil.parseFile(servletContext,"String_Node_Str" + hostPageName);
  if (hostDoc == null) {
    throw new FileNotFoundException("String_Node_Str" + hostPageName + "String_Node_Str");
  }
  fixModuleReference(hostDoc,servletContext);
  injectCssFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
  injectXmlFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
  injectXmlFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
}

Fixed version (ground truth):
@Inject HostPageServlet(final Provider<CurrentUser> cu,@SitePath final File path,final GerritConfig gc,@CanonicalWebUrl @Nullable final Provider<String> up,@CanonicalWebUrl @Nullable final String configuredUrl,final ServletContext servletContext) throws IOException {
  currentUser=cu;
  urlProvider=up;
  sitePath=path;
  config=gc;
  wantSSL=configuredUrl != null && configuredUrl.startsWith("String_Node_Str");
  final String hostPageName="String_Node_Str";
  hostDoc=HtmlDomUtil.parseFile(servletContext,"String_Node_Str" + hostPageName);
  if (hostDoc == null) {
    throw new FileNotFoundException("String_Node_Str" + hostPageName + "String_Node_Str");
  }
  fixModuleReference(hostDoc,servletContext);
  injectCssFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
  injectXmlFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
  injectXmlFile(hostDoc,"String_Node_Str",sitePath,"String_Node_Str");
}
Program: 39064
Project: 39064
Buggy source:
@Override protected void doGet(final HttpServletRequest req,final HttpServletResponse rsp) throws IOException {
  if (wantSSL && !isSecure(req)) {
    final StringBuffer reqUrl=req.getRequestURL();
    if (isLocalHost(req)) {
      reqUrl.replace(0,reqUrl.indexOf("String_Node_Str"),"String_Node_Str");
    }
 else {
      reqUrl.setLength(0);
      reqUrl.append(urlProvider.get());
    }
    rsp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
    rsp.setHeader("String_Node_Str",reqUrl.toString());
    return;
  }
  final HostPageData pageData=new HostPageData();
  pageData.config=config;
  final CurrentUser user=currentUser.get();
  if (user instanceof IdentifiedUser) {
    pageData.xsrfToken=webSession.get().getToken();
    pageData.userAccount=((IdentifiedUser)user).getAccount();
  }
  final Document peruser=HtmlDomUtil.clone(hostDoc);
  injectJson(peruser,"String_Node_Str",pageData);
  final byte[] raw=HtmlDomUtil.toUTF8(peruser);
  final byte[] tosend;
  if (RPCServletUtils.acceptsGzipEncoding(req)) {
    rsp.setHeader("String_Node_Str","String_Node_Str");
    tosend=HtmlDomUtil.compress(raw);
  }
 else {
    tosend=raw;
  }
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setContentType("String_Node_Str");
  rsp.setCharacterEncoding(HtmlDomUtil.ENC);
  rsp.setContentLength(tosend.length);
  final OutputStream out=rsp.getOutputStream();
  try {
    out.write(tosend);
  }
  finally {
    out.close();
  }
}

Fixed version (ground truth):
@Override protected void doGet(final HttpServletRequest req,final HttpServletResponse rsp) throws IOException {
  if (wantSSL && !isSecure(req)) {
    final StringBuffer reqUrl=req.getRequestURL();
    if (isLocalHost(req)) {
      reqUrl.replace(0,reqUrl.indexOf("String_Node_Str"),"String_Node_Str");
    }
 else {
      reqUrl.setLength(0);
      reqUrl.append(urlProvider.get());
    }
    rsp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
    rsp.setHeader("String_Node_Str",reqUrl.toString());
    return;
  }
  final HostPageData pageData=new HostPageData();
  pageData.config=config;
  final CurrentUser user=currentUser.get();
  if (user instanceof IdentifiedUser) {
    pageData.userAccount=((IdentifiedUser)user).getAccount();
  }
  final Document peruser=HtmlDomUtil.clone(hostDoc);
  injectJson(peruser,"String_Node_Str",pageData);
  final byte[] raw=HtmlDomUtil.toUTF8(peruser);
  final byte[] tosend;
  if (RPCServletUtils.acceptsGzipEncoding(req)) {
    rsp.setHeader("String_Node_Str","String_Node_Str");
    tosend=HtmlDomUtil.compress(raw);
  }
 else {
    tosend=raw;
  }
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setHeader("String_Node_Str","String_Node_Str");
  rsp.setContentType("String_Node_Str");
  rsp.setCharacterEncoding(HtmlDomUtil.ENC);
  rsp.setContentLength(tosend.length);
  final OutputStream out=rsp.getOutputStream();
  try {
    out.write(tosend);
  }
  finally {
    out.close();
  }
}
Program: 39066
Project: 39066
Buggy source:
private void ensureCommentsVisible(final CommentDetail comments){
  if (comments.getCommentsA().isEmpty() && comments.getCommentsB().isEmpty()) {
    return;
  }
  final List<Edit> empty=new ArrayList<Edit>();
  int lastLine;
  lastLine=-1;
  for (  PatchLineComment plc : comments.getCommentsA()) {
    final int a=plc.getLine();
    if (lastLine != a) {
      safeAdd(empty,new Edit(a - 1,mapA2B(a - 1)));
      lastLine=a;
    }
  }
  lastLine=-1;
  for (  PatchLineComment plc : comments.getCommentsB()) {
    final int b=plc.getLine();
    if (lastLine != b) {
      safeAdd(empty,new Edit(mapB2A(b - 1),b - 1));
      lastLine=b;
    }
  }
  edits.addAll(empty);
  Collections.sort(edits,EDIT_SORT);
}

Fixed version (ground truth):
private void ensureCommentsVisible(final CommentDetail comments){
  if (comments.getCommentsA().isEmpty() && comments.getCommentsB().isEmpty()) {
    return;
  }
  final List<Edit> empty=new ArrayList<Edit>();
  int lastLine;
  lastLine=-1;
  for (  PatchLineComment plc : comments.getCommentsA()) {
    final int a=plc.getLine();
    if (lastLine != a) {
      final int b=mapA2B(a - 1);
      if (0 <= b) {
        safeAdd(empty,new Edit(a - 1,b));
      }
      lastLine=a;
    }
  }
  lastLine=-1;
  for (  PatchLineComment plc : comments.getCommentsB()) {
    final int b=plc.getLine();
    if (lastLine != b) {
      final int a=mapB2A(b - 1);
      if (0 <= a) {
        safeAdd(empty,new Edit(a,b - 1));
      }
      lastLine=b;
    }
  }
  edits.addAll(empty);
  Collections.sort(edits,EDIT_SORT);
}
Program: 39067
Project: 39067
Buggy source:
private int mapA2B(final int a){
  if (edits.isEmpty()) {
    return a;
  }
  if (a < edits.get(0).getBeginA()) {
    return a;
  }
  for (  Edit e : edits) {
    if (e.getBeginA() <= a && a <= e.getEndA()) {
      return e.getBeginB() + (a - e.getBeginA());
    }
  }
  final Edit last=edits.get(edits.size() - 1);
  return last.getBeginB() + (a - last.getEndA());
}

Fixed version (ground truth):
private int mapA2B(final int a){
  if (edits.isEmpty()) {
    return a;
  }
  for (int i=0; i < edits.size(); i++) {
    final Edit e=edits.get(i);
    if (a < e.getBeginA()) {
      if (i == 0) {
        return a;
      }
      return edits.get(i - i).getEndB() + (e.getBeginA() - a);
    }
    if (e.getBeginA() <= a && a <= e.getEndA()) {
      return -1;
    }
  }
  final Edit last=edits.get(edits.size() - 1);
  return last.getBeginB() + (a - last.getEndA());
}
Program: 39068
Project: 39068
Buggy source:
private int mapB2A(final int b){
  if (edits.isEmpty()) {
    return b;
  }
  if (b < edits.get(0).getBeginB()) {
    return b;
  }
  for (  Edit e : edits) {
    if (e.getBeginB() <= b && b <= e.getEndB()) {
      return e.getBeginA() + (b - e.getBeginB());
    }
  }
  final Edit last=edits.get(edits.size() - 1);
  return last.getBeginA() + (b - last.getEndB());
}

Fixed version (ground truth):
private int mapB2A(final int b){
  if (edits.isEmpty()) {
    return b;
  }
  for (int i=0; i < edits.size(); i++) {
    final Edit e=edits.get(i);
    if (b < e.getBeginB()) {
      if (i == 0) {
        return b;
      }
      return edits.get(i - i).getEndA() + (e.getBeginB() - b);
    }
    if (e.getBeginB() <= b && b <= e.getEndB()) {
      return -1;
    }
  }
  final Edit last=edits.get(edits.size() - 1);
  return last.getBeginA() + (b - last.getEndB());
}
Program: 39070
Project: 39070
Buggy source:
public PatchFile(final Repository repo,final RevId id,final Patch patch) throws MissingObjectException, IncorrectObjectTypeException, IOException {
  this.repo=repo;
  this.patch=patch;
  final RevWalk rw=new RevWalk(repo);
  final RevCommit bCommit=rw.parseCommit(ObjectId.fromString(id.get()));
  if (bCommit.getParentCount() > 0) {
    rw.parseHeaders(bCommit.getParent(0));
    aTree=bCommit.getParent(0).getTree();
  }
 else {
    aTree=emptyTree();
  }
  bTree=bCommit.getTree();
}

Fixed version (ground truth):
public PatchFile(final Repository repo,final RevId id,final Patch patch) throws MissingObjectException, IncorrectObjectTypeException, IOException {
  this.repo=repo;
  this.patch=patch;
  final RevWalk rw=new RevWalk(repo);
  final RevCommit bCommit=rw.parseCommit(ObjectId.fromString(id.get()));
  if (bCommit.getParentCount() > 0) {
    rw.parse(bCommit.getParent(0));
    aTree=bCommit.getParent(0).getTree();
  }
 else {
    aTree=emptyTree();
  }
  bTree=bCommit.getTree();
}
Program: 39071
Project: 39071
Buggy source:
private void packContent(){
  for (int curIdx=0; curIdx < edits.size(); ) {
    Edit curEdit=edits.get(curIdx);
    final int endIdx=findCombinedEnd(edits,curIdx);
    final Edit endEdit=edits.get(endIdx);
    int aCur=Math.max(0,curEdit.getBeginA() - context());
    int bCur=Math.max(0,curEdit.getBeginB() - context());
    final int aEnd=Math.min(srcA.size(),endEdit.getEndA() + context());
    final int bEnd=Math.min(srcB.size(),endEdit.getEndB() + context());
    while (aCur < aEnd || bCur < bEnd) {
      if (aCur < curEdit.getBeginA() || endIdx + 1 < curIdx) {
        srcA.addLineTo(dstA,aCur);
        aCur++;
        bCur++;
      }
 else       if (aCur < curEdit.getEndA()) {
        srcA.addLineTo(dstA,aCur++);
      }
 else       if (bCur < curEdit.getEndB()) {
        srcB.addLineTo(dstB,bCur++);
      }
      if (end(curEdit,aCur,bCur) && ++curIdx < edits.size()) {
        curEdit=edits.get(curIdx);
        while (curEdit.getType() == Edit.Type.EMPTY && curEdit != endEdit) {
          edits.remove(curIdx);
          curEdit=edits.get(curIdx);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void packContent(){
  for (int curIdx=0; curIdx < edits.size(); ) {
    Edit curEdit=edits.get(curIdx);
    final int endIdx=findCombinedEnd(edits,curIdx);
    final Edit endEdit=edits.get(endIdx);
    int aCur=Math.max(0,curEdit.getBeginA() - context());
    int bCur=Math.max(0,curEdit.getBeginB() - context());
    final int aEnd=Math.min(srcA.size(),endEdit.getEndA() + context());
    final int bEnd=Math.min(srcB.size(),endEdit.getEndB() + context());
    while (aCur < aEnd || bCur < bEnd) {
      if (aCur < curEdit.getBeginA() || endIdx + 1 < curIdx) {
        srcA.addLineTo(dstA,aCur);
        aCur++;
        bCur++;
      }
 else       if (aCur < curEdit.getEndA()) {
        srcA.addLineTo(dstA,aCur++);
      }
 else       if (bCur < curEdit.getEndB()) {
        srcB.addLineTo(dstB,bCur++);
      }
      if (end(curEdit,aCur,bCur) && ++curIdx < edits.size()) {
        curEdit=edits.get(curIdx);
        while (curEdit.getType() == Edit.Type.EMPTY) {
          if (aEnd <= curEdit.getBeginA() || bEnd <= curEdit.getEndB()) {
            break;
          }
          edits.remove(curIdx);
          if (curIdx < edits.size()) {
            curEdit=edits.get(curIdx);
          }
 else {
            break;
          }
        }
      }
    }
  }
}
Program: 39072
Project: 39072
Buggy source:
private void appendPatchSets(){
  for (  Map.Entry<Change.Id,ReceiveCommand> e : addByChange.entrySet()) {
    final ReceiveCommand cmd=e.getValue();
    final Change.Id changeId=e.getKey();
    try {
      appendPatchSet(changeId,cmd);
    }
 catch (    IOException err) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name(),e);
      reject(cmd,"String_Node_Str");
    }
catch (    OrmException err) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name(),e);
      reject(cmd,"String_Node_Str");
    }
    if (cmd.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name()+ "String_Node_Str"+ "String_Node_Str");
      reject(cmd,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void appendPatchSets(){
  for (  Map.Entry<Change.Id,ReceiveCommand> e : addByChange.entrySet()) {
    final ReceiveCommand cmd=e.getValue();
    final Change.Id changeId=e.getKey();
    try {
      appendPatchSet(changeId,cmd);
    }
 catch (    IOException err) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name(),err);
      reject(cmd,"String_Node_Str");
    }
catch (    OrmException err) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name(),err);
      reject(cmd,"String_Node_Str");
    }
    if (cmd.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) {
      log.error("String_Node_Str" + changeId + "String_Node_Str"+ cmd.getNewId().name()+ "String_Node_Str"+ "String_Node_Str");
      reject(cmd,"String_Node_Str");
    }
  }
}
Program: 39075
Project: 39075
Buggy source:
private void showInitialScreen(){
  final RootPanel sg=RootPanel.get("String_Node_Str");
  sg.getElement().getParentElement().removeChild(sg.getElement());
  History.addHistoryListener(new Link());
  if ("String_Node_Str".equals(History.getToken())) {
    if (isSignedIn()) {
      History.newItem(Link.MINE);
    }
 else {
      History.newItem(Link.ALL_OPEN);
    }
  }
 else {
    History.fireCurrentHistoryState();
  }
}

Fixed version (ground truth):
private void showInitialScreen(){
  final RootPanel sg=RootPanel.get("String_Node_Str");
  sg.getElement().getParentElement().removeChild(sg.getElement());
  RootPanel.detachNow(sg);
  History.addHistoryListener(new Link());
  if ("String_Node_Str".equals(History.getToken())) {
    if (isSignedIn()) {
      History.newItem(Link.MINE);
    }
 else {
      History.newItem(Link.ALL_OPEN);
    }
  }
 else {
    History.fireCurrentHistoryState();
  }
}
Program: 39076
Project: 39076
Buggy source:
/** 
 * Hook from   {@link SignInDialog} to let us know to refresh the UI. 
 */
static void postSignIn(){
  refreshMenuBar();
  for (  final SignedInListener l : signedInListeners) {
    l.onSignIn();
  }
}

Fixed version (ground truth):
/** 
 * Hook from   {@link SignInDialog} to let us know to refresh the UI. 
 */
static void postSignIn(){
  refreshMenuBar();
  DeferredCommand.addCommand(new Command(){
    public void execute(){
      for (      final SignedInListener l : signedInListeners) {
        l.onSignIn();
      }
    }
  }
);
}
Program: 39079
Project: 39079
Buggy source:
/** 
 * Processes a single kanji drawing with a single algorithm.
 * @param drawingInfo Drawing
 * @param algo Algorithm to use
 */
private void process(KanjiInfo drawingInfo,MatchAlgorithm algo){
  AlgoResults algoResults=results.get(algo);
  if (algoResults == null) {
    algoResults=new AlgoResults(algo);
    results.put(algo,algoResults);
  }
  KanjiMatch[] matches=list.getTopMatches(drawingInfo,algo,null);
  for (int i=0; i < matches.length; i++) {
    if (matches[i].getKanji().getKanji().equals(drawingInfo.getKanji())) {
      algoResults.addRanking(i + 1);
      return;
    }
  }
  algoResults.addFailure(drawingInfo);
}

Fixed version (ground truth):
/** 
 * Processes a single kanji drawing with a single algorithm.
 * @param drawingInfo Drawing
 * @param algo Algorithm to use
 */
private void process(KanjiInfo drawingInfo,MatchAlgorithm algo){
  KanjiMatch[] matches=list.getTopMatches(drawingInfo,algo,null);
synchronized (AnalyseRecognition.this) {
    AlgoResults algoResults=results.get(algo);
    if (algoResults == null) {
      algoResults=new AlgoResults(algo);
      results.put(algo,algoResults);
    }
    for (int i=0; i < matches.length; i++) {
      if (matches[i].getKanji().getKanji().equals(drawingInfo.getKanji())) {
        algoResults.addRanking(i + 1);
        return;
      }
    }
    algoResults.addFailure(drawingInfo);
  }
}
Program: 39080
Project: 39080
Buggy source:
/** 
 * Starts analysis process.
 * @throws Exception
 */
private void start() throws Exception {
  count=0;
  list=new KanjiList(new FileInputStream("String_Node_Str"));
  results=new TreeMap<MatchAlgorithm,AlgoResults>();
}

Fixed version (ground truth):
/** 
 * Starts analysis process.
 * @throws Exception
 */
private synchronized void start() throws Exception {
  processed=0;
  added=0;
  list=new KanjiList(new FileInputStream("String_Node_Str"));
  results=new TreeMap<MatchAlgorithm,AlgoResults>();
  threadPool=Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
}
Program: 39081
Project: 39081
Buggy source:
/** 
 * @param password Password
 * @param where Optional where clause (null if none), not including "WHERE"
 * @throws Exception Any error
 */
private void run(String password,String where) throws Exception {
  Class.forName("String_Node_Str");
  Properties props=new Properties();
  props.setProperty("String_Node_Str",JDBC_USER);
  props.setProperty("String_Node_Str",password);
  Connection c=null;
  Statement s=null;
  ResultSet rs=null;
  try {
    c=DriverManager.getConnection(JDBC_URL,props);
    String query=BASIC_QUERY;
    if (where != null) {
      query+="String_Node_Str" + where;
    }
    query+=ORDER_BY;
    s=c.createStatement();
    rs=s.executeQuery(query);
    start();
    while (rs.next()) {
      process(rs.getString("String_Node_Str"),rs.getString("String_Node_Str"));
    }
    finish();
  }
  finally {
    if (rs != null) {
      rs.close();
    }
    if (s != null) {
      s.close();
    }
    if (c != null) {
      c.close();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  KanjiInfo drawingInfo=new KanjiInfo(kanji,drawing);
  int actualStrokes=list.find(kanji).getStrokeCount();
  MatchAlgorithm[] algorithms;
  if (actualStrokes == drawingInfo.getStrokeCount()) {
    algorithms=new MatchAlgorithm[]{MatchAlgorithm.STRICT,MatchAlgorithm.FUZZY};
  }
 else   if (Math.abs(actualStrokes - drawingInfo.getStrokeCount()) == 1) {
    algorithms=new MatchAlgorithm[]{MatchAlgorithm.FUZZY_1OUT};
  }
 else   if (Math.abs(actualStrokes - drawingInfo.getStrokeCount()) == 2) {
    algorithms=new MatchAlgorithm[]{MatchAlgorithm.FUZZY_1OUT};
  }
 else {
    algorithms=new MatchAlgorithm[0];
  }
  for (  MatchAlgorithm algo : algorithms) {
    process(drawingInfo,algo);
  }
synchronized (AnalyseRecognition.this) {
    processed++;
    System.err.print("String_Node_Str" + processed + "String_Node_Str");
    AnalyseRecognition.this.notifyAll();
  }
}
Program: 39082
Project: 39082
Buggy source:
/** 
 * Called when the analysis run finishes. Displays all results.
 */
private void finish(){
  System.err.println();
  for (  Map.Entry<MatchAlgorithm,AlgoResults> entry : results.entrySet()) {
    String algoName=entry.getKey().toString();
    System.out.println();
    System.out.println(algoName);
    for (int i=0; i < algoName.length(); i++) {
      System.out.print("String_Node_Str");
    }
    System.out.println();
    System.out.println();
    entry.getValue().display();
  }
}

Fixed version (ground truth):
/** 
 * Called when the analysis run finishes. Displays all results.
 * @throws Exception Any error
 */
private void finish() throws Exception {
  threadPool.shutdown();
  threadPool.awaitTermination(1,TimeUnit.DAYS);
  System.err.println();
  for (  Map.Entry<MatchAlgorithm,AlgoResults> entry : results.entrySet()) {
    String algoName=entry.getKey().toString();
    System.out.println();
    System.out.println(algoName);
    for (int i=0; i < algoName.length(); i++) {
      System.out.print("String_Node_Str");
    }
    System.out.println();
    System.out.println();
    entry.getValue().display();
  }
}
Program: 39083
Project: 39083
Buggy source:
/** 
 * Shuts down the TTS engine. 
 */
public void shutdown(){
  if (isShutdown.compareAndSet(true,false)) {
    tts.shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Shuts down the TTS engine. 
 */
public void shutdown(){
  if (isShutdown.compareAndSet(false,true)) {
    tts.shutdown();
  }
}
Program: 39086
Project: 39086
Buggy source:
public static ReportNumberFormat getInstance(final Locale locale){
  ReportNumberFormat format=FORMATTERS.get(locale);
  if (format == null) {
synchronized (FORMATTERS) {
      format=FORMATTERS.get(locale);
      if (format == null) {
        format=new ReportNumberFormat(locale);
        FORMATTERS.put(locale,format);
      }
    }
  }
  return format;
}

Fixed version (ground truth):
public static ReportNumberFormat getInstance(final Locale locale){
  ReportNumberFormat format=FORMATTERS.get(locale);
  if (format == null) {
synchronized (FORMATTERS) {
      format=FORMATTERS.computeIfAbsent(locale,f -> new ReportNumberFormat(locale));
    }
  }
  return format;
}