nus-yam/ex-repair huggingface dataset:
Program: 50709
Project: 50709
Buggy source:
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  TTFDocument doc=(TTFDocument)this.getDoc();
  List<SequenceMessage> generatedOperations=new ArrayList<SequenceMessage>();
  int mpos=doc.viewToModel(opt.getPosition());
  if (opt.getType() == SequenceOperation.OpType.del) {
    for (int i=0; i < opt.getOffset(); i++) {
      TTFOperation op=TTFOperation.delete(opt,mpos + i,new VectorClock(this.siteVC));
      this.siteVC.inc(this.getReplicaNumber());
      generatedOperations.add(op);
      this.log.add(op);
      doc.apply(op);
    }
  }
 else {
    for (int i=0; i < opt.getContent().length(); i++) {
      TTFOperation op=TTFOperation.insert(opt,mpos + i,opt.getContent().charAt(i),new VectorClock(this.siteVC));
      this.siteVC.inc(this.getReplicaNumber());
      generatedOperations.add(op);
      this.log.add(op);
      doc.apply(op);
    }
  }
  return generatedOperations;
}

Fixed version (ground truth):
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  TTFDocument doc=(TTFDocument)this.getDoc();
  List<SequenceMessage> generatedOperations=new ArrayList<SequenceMessage>();
  int mpos=doc.viewToModel(opt.getPosition());
  if (opt.getType() == SequenceOperation.OpType.del) {
    int visibleIndex=0;
    for (int i=0; i < opt.getOffset(); i++) {
      while (!doc.getChar(mpos + visibleIndex).isVisible()) {
        visibleIndex++;
      }
      TTFOperation op=TTFOperation.delete(opt,mpos + visibleIndex,new VectorClock(this.siteVC));
      this.siteVC.inc(this.getReplicaNumber());
      generatedOperations.add(op);
      this.log.add(op);
      doc.apply(op);
    }
  }
 else {
    for (int i=0; i < opt.getContent().length(); i++) {
      TTFOperation op=TTFOperation.insert(opt,mpos + i,opt.getContent().charAt(i),new VectorClock(this.siteVC));
      this.siteVC.inc(this.getReplicaNumber());
      generatedOperations.add(op);
      this.log.add(op);
      doc.apply(op);
    }
  }
  return generatedOperations;
}
Program: 50710
Project: 50710
Buggy source:
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  List<SequenceMessage> lop=new ArrayList<SequenceMessage>();
  RGADocument rgadoc=(RGADocument)(this.getDoc());
  RGAS4Vector s4vtms, s4vpos=null;
  RGAOperation rgaop;
  RGANode target=null;
  int p=opt.getPosition();
  int offset;
  if (opt.getType() == SequenceOperation.OpType.del) {
    offset=opt.getOffset();
    target=rgadoc.getVisibleNode(p + 1);
  }
 else {
    offset=opt.getContent().length();
    if (p == 0)     s4vpos=null;
 else     s4vpos=rgadoc.getVisibleS4V(p);
  }
  for (int i=0; i < offset; i++) {
    this.siteVC.inc(this.getReplicaNumber());
    s4vtms=new RGAS4Vector(this.getReplicaNumber(),this.siteVC);
    if (opt.getType() == SequenceOperation.OpType.del) {
      rgaop=new RGAOperation(opt,p + 1,target.getKey(),s4vtms);
      target=target.getNextVisible();
    }
 else {
      rgaop=new RGAOperation(opt,p + i,s4vpos,opt.getContent().charAt(i),s4vtms);
      s4vpos=s4vtms;
    }
    lop.add(rgaop);
    rgadoc.apply(rgaop);
    purger.setLastVC(this.getReplicaNumber(),this.siteVC);
  }
  return lop;
}

Fixed version (ground truth):
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  List<SequenceMessage> lop=new ArrayList<SequenceMessage>();
  RGADocument rgadoc=(RGADocument)(this.getDoc());
  RGAS4Vector s4vtms, s4vpos=null;
  RGAOperation rgaop;
  RGANode target=null;
  int p=opt.getPosition();
  int offset;
  if (opt.getType() == SequenceOperation.OpType.del) {
    offset=opt.getOffset();
    target=rgadoc.getVisibleNode(p + 1);
  }
 else {
    offset=opt.getContent().length();
    if (p == 0)     s4vpos=null;
 else     s4vpos=rgadoc.getVisibleS4V(p);
  }
  for (int i=0; i < offset; i++) {
    this.siteVC.inc(this.getReplicaNumber());
    s4vtms=new RGAS4Vector(this.getReplicaNumber(),this.siteVC);
    if (opt.getType() == SequenceOperation.OpType.del) {
      rgaop=new RGAOperation(opt,p + 1,target.getKey(),s4vtms);
      target=target.getNextVisible();
    }
 else {
      rgaop=new RGAOperation(opt,p + i,s4vpos,opt.getContent().charAt(i),s4vtms);
      s4vpos=s4vtms;
    }
    lop.add(rgaop);
    rgadoc.apply(rgaop);
  }
  return lop;
}
Program: 50711
Project: 50711
Buggy source:
public RGAMerge(Document doc,int r){
  super(doc,r);
  siteVC=new VectorClock();
  purger=new RGAPurger((RGADocument)this.getDoc());
}

Fixed version (ground truth):
public RGAMerge(Document doc,int r){
  super(doc,r);
  siteVC=new VectorClock();
}
Program: 50712
Project: 50712
Buggy source:
@Override protected void integrateLocal(SequenceMessage op) throws IncorrectTraceException {
  RGAOperation rgaop=(RGAOperation)op;
  RGADocument rgadoc=(RGADocument)(this.getDoc());
  this.siteVC.inc(rgaop.getOriginalOp().getReplica());
  rgadoc.apply(rgaop);
  purger.setLastVC(rgaop.getS4VTms().sid,rgaop.getOriginalOp().getVectorClock());
}

Fixed version (ground truth):
@Override protected void integrateLocal(SequenceMessage op) throws IncorrectTraceException {
  RGAOperation rgaop=(RGAOperation)op;
  RGADocument rgadoc=(RGADocument)(this.getDoc());
  this.siteVC.inc(rgaop.getOriginalOp().getReplica());
  rgadoc.apply(rgaop);
}
Program: 50713
Project: 50713
Buggy source:
@Override public CommutativeMessage clone(){
  CommutativeMessage clone=copy();
  clone.msgs=(LinkedList<CommutativeMessage>)msgs.clone();
  return clone;
}

Fixed version (ground truth):
@Override public CommutativeMessage clone(){
  CommutativeMessage clone=copy();
  for (  CommutativeMessage m : msgs) {
    clone.msgs.add(m.copy());
  }
  return clone;
}
Program: 50714
Project: 50714
Buggy source:
public int compareTo(RGAS4Vector s4v){
  if (this.ssn > s4v.ssn)   return AFTER;
 else   if (this.ssn < s4v.ssn)   return BEFORE;
 else {
    if (this.sum > s4v.sum)     return AFTER;
 else     if (this.sum < s4v.ssn)     return BEFORE;
 else {
      if (this.sid > s4v.sid)       return AFTER;
 else       if (this.sid < s4v.sid)       return BEFORE;
 else       return EQUAL;
    }
  }
}

Fixed version (ground truth):
public int compareTo(RGAS4Vector s4v){
  if (this.ssn > s4v.ssn)   return AFTER;
 else   if (this.ssn < s4v.ssn)   return BEFORE;
 else {
    if (this.sum > s4v.sum)     return AFTER;
 else     if (this.sum < s4v.sum)     return BEFORE;
 else {
      if (this.sid > s4v.sid)       return AFTER;
 else       if (this.sid < s4v.sid)       return BEFORE;
 else       return EQUAL;
    }
  }
}
Program: 50715
Project: 50715
Buggy source:
public void rebuildKnowledgeBaseViaKnowledgeAgent() throws ConnectException {
  this.createKnowledgeBaseViaKnowledgeAgent(true);
}

Fixed version (ground truth):
public synchronized void rebuildKnowledgeBaseViaKnowledgeAgent() throws ConnectException {
  this.createKnowledgeBaseViaKnowledgeAgent(true);
}
Program: 50716
Project: 50716
Buggy source:
public void createOrRebuildKnowledgeBaseViaKnowledgeAgentOrBuilder(){
  try {
    this.createKnowledgeBaseViaKnowledgeAgent(true);
  }
 catch (  ConnectException x) {
    log.warn("String_Node_Str");
    rebuildKnowledgeBaseViaKnowledgeBuilder();
  }
}

Fixed version (ground truth):
public synchronized void createOrRebuildKnowledgeBaseViaKnowledgeAgentOrBuilder(){
  try {
    this.createKnowledgeBaseViaKnowledgeAgent(true);
  }
 catch (  ConnectException x) {
    log.warn("String_Node_Str");
    rebuildKnowledgeBaseViaKnowledgeBuilder();
  }
}
Program: 50717
Project: 50717
Buggy source:
protected void checkKAgentAndBaseHealth(){
  long kAgentRefreshLapsedTime=System.currentTimeMillis() - lastKAgentRefresh;
  long kAgentRefreshMillis=1000 * 60 * kAgentRefreshHours;
  if (kbase == null || (kAgentMonitor && (kAgentRefreshLapsedTime > kAgentRefreshMillis))) {
    log.info("String_Node_Str" + kAgentRefreshLapsedTime + "String_Node_Str"+ kAgentRefreshMillis);
    kbase=null;
    createKnowledgeBaseViaKnowledgeAgentOrBuilder();
  }
}

Fixed version (ground truth):
protected synchronized void checkKAgentAndBaseHealth(){
  long kAgentRefreshLapsedTime=System.currentTimeMillis() - lastKAgentRefresh;
  long kAgentRefreshMillis=1000 * 60 * kAgentRefreshHours;
  if (kbase == null || (kAgentMonitor && (kAgentRefreshLapsedTime > kAgentRefreshMillis))) {
    log.info("String_Node_Str" + kAgentRefreshLapsedTime + "String_Node_Str"+ kAgentRefreshMillis);
    createKnowledgeBaseViaKnowledgeAgentOrBuilder();
  }
}
Program: 50718
Project: 50718
Buggy source:
public void createKnowledgeBaseViaKnowledgeAgentOrBuilder(){
  try {
    this.createKnowledgeBaseViaKnowledgeAgent();
  }
 catch (  ConnectException x) {
    log.warn("String_Node_Str");
    rebuildKnowledgeBaseViaKnowledgeBuilder();
  }
}

Fixed version (ground truth):
public synchronized void createKnowledgeBaseViaKnowledgeAgentOrBuilder(){
  try {
    this.createKnowledgeBaseViaKnowledgeAgent();
  }
 catch (  ConnectException x) {
    log.warn("String_Node_Str");
    rebuildKnowledgeBaseViaKnowledgeBuilder();
  }
}
Program: 50720
Project: 50720
Buggy source:
/** 
 * Copy response body data (the entity) from the proxy to the servlet client.
 * @param proxyResponse The response from the target server
 * @param servletResponse The response back to the client
 * @throws IOException Failed to copy content
 */
protected void copyResponseContent(HttpResponse proxyResponse,HttpServletResponse servletResponse) throws IOException {
  OutputStream servletOutputStream=servletResponse.getOutputStream();
  try {
    proxyResponse.getEntity().writeTo(servletOutputStream);
  }
  finally {
    try {
      servletOutputStream.close();
    }
 catch (    Exception e) {
      log(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Copy response body data (the entity) from the proxy to the servlet client. Ensures that proxyInputStream will be closed in any case by closing the inputStream
 * @see org.apache.http.HttpEntity.getContent()
 * @param proxyResponse The response from the target server
 * @param servletResponse The response back to the client
 * @throws IOException Failed to copy content
 */
protected void copyResponseContent(HttpResponse proxyResponse,HttpServletResponse servletResponse) throws IOException {
  InputStream proxyInputStream=null;
  OutputStream servletOutputStream=null;
  try {
    proxyInputStream=proxyResponse.getEntity().getContent();
    servletOutputStream=servletResponse.getOutputStream();
    proxyResponse.getEntity().writeTo(servletOutputStream);
  }
  finally {
    secureCloseStream(proxyInputStream);
    secureCloseStream(servletOutputStream);
  }
}
Program: 50721
Project: 50721
Buggy source:
@Override public void doOnReturn(Integer deleteCount){
  notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),i18n.format("String_Node_Str",deleteCount));
}

Fixed version (ground truth):
@Override public void doOnReturn(String deleteCount){
  notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),i18n.format("String_Node_Str",deleteCount));
}
Program: 50722
Project: 50722
Buggy source:
@Override public void doOnComplete(org.overlord.rtgov.ui.client.local.services.rpc.IRpcServiceInvocationHandler.RpcResult<Integer> result){
  situationsTable.clear();
}

Fixed version (ground truth):
@Override public void doOnComplete(org.overlord.rtgov.ui.client.local.services.rpc.IRpcServiceInvocationHandler.RpcResult<String> result){
  situationsTable.clear();
}
Program: 50723
Project: 50723
Buggy source:
@EventHandler("String_Node_Str") public void onDeleteClick(ClickEvent event){
  if (!Window.confirm("String_Node_Str" + (applyActionToFilteredRowsOnly ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str")) {
    return;
  }
  SituationsFilterBean situationsFilterBean=applyActionToFilteredRowsOnly ? filtersPanel.getValue() : new SituationsFilterBean();
  final NotificationBean notificationBean=notificationService.startProgressNotification(i18n.format("String_Node_Str"),i18n.format("String_Node_Str"));
  situationsService.delete(situationsFilterBean,new RpcServiceInvocationHandlerAdapter<Integer>(){
    @Override public void doOnReturn(    Integer deleteCount){
      notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),i18n.format("String_Node_Str",deleteCount));
    }
    @Override public void doOnError(    Throwable error){
      notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),error);
    }
    @Override public void doOnComplete(    org.overlord.rtgov.ui.client.local.services.rpc.IRpcServiceInvocationHandler.RpcResult<Integer> result){
      situationsTable.clear();
    }
  }
);
}

Fixed version (ground truth):
@EventHandler("String_Node_Str") public void onDeleteClick(ClickEvent event){
  if (!Window.confirm("String_Node_Str" + (applyActionToFilteredRowsOnly ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str")) {
    return;
  }
  SituationsFilterBean situationsFilterBean=applyActionToFilteredRowsOnly ? filtersPanel.getValue() : new SituationsFilterBean();
  final NotificationBean notificationBean=notificationService.startProgressNotification(i18n.format("String_Node_Str"),i18n.format("String_Node_Str"));
  situationsService.delete(situationsFilterBean,new RpcServiceInvocationHandlerAdapter<String>(){
    @Override public void doOnReturn(    String deleteCount){
      notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),i18n.format("String_Node_Str",deleteCount));
    }
    @Override public void doOnError(    Throwable error){
      notificationService.completeProgressNotification(notificationBean.getUuid(),i18n.format("String_Node_Str"),error);
    }
    @Override public void doOnComplete(    org.overlord.rtgov.ui.client.local.services.rpc.IRpcServiceInvocationHandler.RpcResult<String> result){
      situationsTable.clear();
    }
  }
);
}
Program: 50724
Project: 50724
Buggy source:
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.ISituationsService#delete(SituationsFilterBean)
 */
public void delete(SituationsFilterBean situationsFilterBean,IRpcServiceInvocationHandler<Integer> handler){
  RemoteCallback<Integer> successCallback=new DelegatingRemoteCallback<Integer>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    remoteSituationsService.call(successCallback,errorCallback).delete(situationsFilterBean);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.ISituationsService#delete(SituationsFilterBean)
 */
public void delete(SituationsFilterBean situationsFilterBean,IRpcServiceInvocationHandler<String> handler){
  RemoteCallback<String> successCallback=new DelegatingRemoteCallback<String>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    remoteSituationsService.call(successCallback,errorCallback).delete(situationsFilterBean);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}
Program: 50725
Project: 50725
Buggy source:
/** 
 * Deletes all situation's matching the given filter.
 * @param situationsFilterBean
 * @throws UiException
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) public int delete(SituationsFilterBean situationsFilterBean) throws UiException ;

Fixed version (ground truth):
/** 
 * Deletes all situation's matching the given filter.
 * @param situationsFilterBean
 * @throws UiException
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) public String delete(SituationsFilterBean situationsFilterBean) throws UiException ;
Program: 50726
Project: 50726
Buggy source:
@Override public int delete(SituationsFilterBean situationsFilterBean) throws UiException {
  return impl.delete(situationsFilterBean);
}

Fixed version (ground truth):
@Override public String delete(SituationsFilterBean situationsFilterBean) throws UiException {
  return "String_Node_Str" + impl.delete(situationsFilterBean);
}
Program: 50727
Project: 50727
Buggy source:
/** 
 * @param isTakeoverPossible
 */
public void setTakeoverPossible(boolean isTakeoverPossible){
  this.isTakeoverPossible=isTakeoverPossible;
}

Fixed version (ground truth):
/** 
 * @param isTakeoverPossible
 */
public void setTakeoverPossible(boolean isTakeoverPossible){
  this.takeoverPossible=isTakeoverPossible;
}
Program: 50728
Project: 50728
Buggy source:
/** 
 * @return whether this situation is assigned to the currently logged-in user
 */
public boolean isAssignedToCurrentUser(){
  return isAssignedToCurrentUser;
}

Fixed version (ground truth):
/** 
 * @return whether this situation is assigned to the currently logged-in user
 */
public boolean isAssignedToCurrentUser(){
  return assignedToCurrentUser;
}
Program: 50729
Project: 50729
Buggy source:
/** 
 * @param isResubmitPossible the isResubmitPossible to set
 */
public void setResubmitPossible(boolean isResubmitPossible){
  this.isResubmitPossible=isResubmitPossible;
}

Fixed version (ground truth):
/** 
 * @param isResubmitPossible the isResubmitPossible to set
 */
public void setResubmitPossible(boolean isResubmitPossible){
  this.resubmitPossible=isResubmitPossible;
}
Program: 50730
Project: 50730
Buggy source:
/** 
 * @return the isResubmitPossible
 */
public boolean isResubmitPossible(){
  return isResubmitPossible;
}

Fixed version (ground truth):
/** 
 * @return the isResubmitPossible
 */
public boolean isResubmitPossible(){
  return resubmitPossible;
}
Program: 50731
Project: 50731
Buggy source:
/** 
 * @return whether this {@link Situation} can be taken over by the currently logged-in user
 */
public boolean isTakeoverPossible(){
  return isTakeoverPossible;
}

Fixed version (ground truth):
/** 
 * @return whether this {@link Situation} can be taken over by the currently logged-in user
 */
public boolean isTakeoverPossible(){
  return takeoverPossible;
}
Program: 50732
Project: 50732
Buggy source:
/** 
 * @param isAssignedToCurrentUser
 */
public void setAssignedToCurrentUser(boolean isAssignedToCurrentUser){
  this.isAssignedToCurrentUser=isAssignedToCurrentUser;
}

Fixed version (ground truth):
/** 
 * @param isAssignedToCurrentUser
 */
public void setAssignedToCurrentUser(boolean isAssignedToCurrentUser){
  this.assignedToCurrentUser=isAssignedToCurrentUser;
}
Program: 50733
Project: 50733
Buggy source:
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getReference(String)
 */
public void getReference(String id,IRpcServiceInvocationHandler<ReferenceBean> handler){
  RemoteCallback<ReferenceBean> successCallback=new DelegatingRemoteCallback<ReferenceBean>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    remoteServicesService.call(successCallback,errorCallback).getReference(id);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getReference(String)
 */
public void getReference(String id,IRpcServiceInvocationHandler<ReferenceBean> handler){
  RemoteCallback<ReferenceBean> successCallback=new DelegatingRemoteCallback<ReferenceBean>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    String encodedId=com.google.gwt.http.client.URL.encode(id);
    remoteServicesService.call(successCallback,errorCallback).getReference(encodedId);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}
Program: 50734
Project: 50734
Buggy source:
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getService(String)
 */
public void getService(String id,IRpcServiceInvocationHandler<ServiceBean> handler){
  RemoteCallback<ServiceBean> successCallback=new DelegatingRemoteCallback<ServiceBean>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    remoteServicesService.call(successCallback,errorCallback).getService(id);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getService(String)
 */
public void getService(String id,IRpcServiceInvocationHandler<ServiceBean> handler){
  RemoteCallback<ServiceBean> successCallback=new DelegatingRemoteCallback<ServiceBean>(handler);
  ErrorCallback<?> errorCallback=new DelegatingErrorCallback(handler);
  try {
    String encodedId=com.google.gwt.http.client.URL.encode(id);
    remoteServicesService.call(successCallback,errorCallback).getService(encodedId);
  }
 catch (  UiException e) {
    errorCallback.error(null,e);
  }
}
Program: 50735
Project: 50735
Buggy source:
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getReference(java.lang.String)
 */
@Override public ReferenceBean getReference(String id) throws UiException {
  return impl.getReference(id);
}

Fixed version (ground truth):
/** 
 * @see org.overlord.rtgov.ui.client.shared.services.IServicesService#getReference(java.lang.String)
 */
@Override public ReferenceBean getReference(String id) throws UiException {
  try {
    id=java.net.URLDecoder.decode(id,"String_Node_Str");
  }
 catch (  Exception e) {
    LOG.log(Level.SEVERE,"String_Node_Str",e);
  }
  return impl.getReference(id);
}
Program: 50736
Project: 50736
Buggy source:
/** 
 * @see org.overlord.dtgov.ui.client.shared.services.IServicesService#getService(java.lang.String)
 */
@Override public ServiceBean getService(String id) throws UiException {
  return impl.getService(id);
}

Fixed version (ground truth):
/** 
 * @see org.overlord.dtgov.ui.client.shared.services.IServicesService#getService(java.lang.String)
 */
@Override public ServiceBean getService(String id) throws UiException {
  try {
    id=java.net.URLDecoder.decode(id,"String_Node_Str");
  }
 catch (  Exception e) {
    LOG.log(Level.SEVERE,"String_Node_Str",e);
  }
  return impl.getService(id);
}
Program: 50738
Project: 50738
Buggy source:
/** 
 * This method sets the activity collector.
 * @param collector The activity collector
 */
public static ActivityProxyHelper setActivityCollector(ActivityCollector collector){
  if (LOG.isLoggable(Level.FINER)) {
    LOG.finer("String_Node_Str" + collector);
  }
  _collector=collector;
  return (new ActivityProxyHelper());
}

Fixed version (ground truth):
/** 
 * This method sets the activity collector.
 * @param collector The activity collector
 * @return The activity proxy helper
 */
public static ActivityProxyHelper setActivityCollector(ActivityCollector collector){
  if (LOG.isLoggable(Level.FINER)) {
    LOG.finer("String_Node_Str" + collector);
  }
  _collector=collector;
  return (new ActivityProxyHelper());
}
Program: 50739
Project: 50739
Buggy source:
MVELEvaluateAction(final ActiveCollectionContext context,final Serializable expressionCompiled,final Object item){
  this.context=context;
  this.expressionCompiled=expressionCompiled;
  this.item=item;
}

Fixed version (ground truth):
MVELEvaluateAction(final ActiveCollectionContext context,final Serializable expressionCompiled,final Object item){
  _context=context;
  _expressionCompiled=expressionCompiled;
  _item=item;
}
Program: 50740
Project: 50740
Buggy source:
public Boolean run(){
  Boolean ret=null;
  java.util.Map<String,Object> vars=new java.util.HashMap<String,Object>();
  vars.put("String_Node_Str",context);
  Object result=org.mvel2.MVEL.executeExpression(expressionCompiled,item,vars);
  if (result instanceof Boolean) {
    ret=Boolean.class.cast(result);
  }
 else {
    LOG.severe(MessageFormat.format(java.util.PropertyResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"),_expression,result,item));
  }
  return ret;
}

Fixed version (ground truth):
public Boolean run(){
  Boolean ret=null;
  java.util.Map<String,Object> vars=new java.util.HashMap<String,Object>();
  vars.put("String_Node_Str",_context);
  Object result=org.mvel2.MVEL.executeExpression(_expressionCompiled,_item,vars);
  if (result instanceof Boolean) {
    ret=Boolean.class.cast(result);
  }
 else {
    LOG.severe(MessageFormat.format(java.util.PropertyResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"),_expression,result,_item));
  }
  return ret;
}
Program: 50741
Project: 50741
Buggy source:
/** 
 * This method updates the endpoint context value when the process type and/or instance id are changed.
 */
protected void updateEndpointContext(){
  try {
    Context current=null;
    for (    Context context : getContext()) {
      if (context.getType() == Context.Type.Endpoint) {
        current=context;
        break;
      }
    }
    if (current == null) {
      current=new Context();
      current.setType(Context.Type.Endpoint);
      getContext().add(current);
    }
    String endpoint="String_Node_Str";
    if (_processType != null) {
      endpoint=_processType;
      if (_instanceId != null) {
        endpoint+="String_Node_Str";
      }
    }
    if (_instanceId != null) {
      endpoint+=_instanceId;
    }
    current.setValue(endpoint);
  }
 catch (  Throwable t) {
  }
}

Fixed version (ground truth):
/** 
 * This method updates the endpoint context value when the process type and/or instance id are changed.
 */
protected void updateEndpointContext(){
  Context current=null;
  try {
    for (    Context context : getContext()) {
      if (context.getType() == Context.Type.Endpoint) {
        current=context;
        break;
      }
    }
    if (current == null) {
      current=new Context();
      current.setType(Context.Type.Endpoint);
      getContext().add(current);
    }
    String endpoint="String_Node_Str";
    if (_processType != null) {
      endpoint=_processType;
      if (_instanceId != null) {
        endpoint+="String_Node_Str";
      }
    }
    if (_instanceId != null) {
      endpoint+=_instanceId;
    }
    current.setValue(endpoint);
  }
 catch (  Throwable t) {
    current=null;
  }
}
Program: 50742
Project: 50742
Buggy source:
/** 
 * This method returns a resolved object for the supplied type.
 * @param cls The required type
 * @return The resolved object, or null if not found
 */
@SuppressWarnings("String_Node_Str") public static <T>T getBean(Class<T> cls){
  T ret=null;
  try {
    javax.enterprise.inject.spi.BeanManager bm=javax.naming.InitialContext.doLookup("String_Node_Str");
    java.util.Set<javax.enterprise.inject.spi.Bean<?>> beans=bm.getBeans(cls);
    for (    javax.enterprise.inject.spi.Bean<?> b : beans) {
      javax.enterprise.context.spi.CreationalContext<Object> cc=new javax.enterprise.context.spi.CreationalContext<Object>(){
        public void push(        Object arg0){
        }
        public void release(){
        }
      }
;
      ret=(T)((javax.enterprise.inject.spi.Bean<Object>)b).create(cc);
      if (LOG.isLoggable(java.util.logging.Level.FINE)) {
        LOG.fine("String_Node_Str" + ret + "String_Node_Str"+ b);
      }
      if (ret != null) {
        break;
      }
    }
  }
 catch (  Throwable e) {
    LOG.log(java.util.logging.Level.SEVERE,"String_Node_Str" + cls + "String_Node_Str",e);
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns a resolved object for the supplied type.
 * @param cls The required type
 * @param < T > The bean type
 * @return The resolved object, or null if not found
 */
@SuppressWarnings("String_Node_Str") public static <T>T getBean(Class<T> cls){
  T ret=null;
  try {
    javax.enterprise.inject.spi.BeanManager bm=javax.naming.InitialContext.doLookup("String_Node_Str");
    java.util.Set<javax.enterprise.inject.spi.Bean<?>> beans=bm.getBeans(cls);
    for (    javax.enterprise.inject.spi.Bean<?> b : beans) {
      javax.enterprise.context.spi.CreationalContext<Object> cc=new javax.enterprise.context.spi.CreationalContext<Object>(){
        public void push(        Object arg0){
        }
        public void release(){
        }
      }
;
      ret=(T)((javax.enterprise.inject.spi.Bean<Object>)b).create(cc);
      if (LOG.isLoggable(java.util.logging.Level.FINE)) {
        LOG.fine("String_Node_Str" + ret + "String_Node_Str"+ b);
      }
      if (ret != null) {
        break;
      }
    }
  }
 catch (  Throwable e) {
    LOG.log(java.util.logging.Level.SEVERE,"String_Node_Str" + cls + "String_Node_Str",e);
  }
  return (ret);
}
Program: 50743
Project: 50743
Buggy source:
/** 
 * This method resolves multiple objects of the required type.
 * @param cls The required type
 * @param list The result list
 */
public static <T>void getBeans(Class<T> cls,java.util.List<T> list){
  try {
    javax.enterprise.inject.spi.BeanManager bm=javax.naming.InitialContext.doLookup("String_Node_Str");
    java.util.Set<javax.enterprise.inject.spi.Bean<?>> beans=bm.getBeans(cls);
    for (    javax.enterprise.inject.spi.Bean<?> b : beans) {
      javax.enterprise.context.spi.CreationalContext<Object> cc=new javax.enterprise.context.spi.CreationalContext<Object>(){
        public void push(        Object arg0){
        }
        public void release(){
        }
      }
;
      @SuppressWarnings("String_Node_Str") T entry=(T)((javax.enterprise.inject.spi.Bean<Object>)b).create(cc);
      if (LOG.isLoggable(java.util.logging.Level.FINE)) {
        LOG.fine("String_Node_Str" + entry + "String_Node_Str"+ b);
      }
      list.add(entry);
    }
  }
 catch (  Throwable e) {
    LOG.log(java.util.logging.Level.SEVERE,"String_Node_Str" + cls + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * This method resolves multiple objects of the required type.
 * @param cls The required type
 * @param list The result list
 * @param < T > The bean type
 */
public static <T>void getBeans(Class<T> cls,java.util.List<T> list){
  try {
    javax.enterprise.inject.spi.BeanManager bm=javax.naming.InitialContext.doLookup("String_Node_Str");
    java.util.Set<javax.enterprise.inject.spi.Bean<?>> beans=bm.getBeans(cls);
    for (    javax.enterprise.inject.spi.Bean<?> b : beans) {
      javax.enterprise.context.spi.CreationalContext<Object> cc=new javax.enterprise.context.spi.CreationalContext<Object>(){
        public void push(        Object arg0){
        }
        public void release(){
        }
      }
;
      @SuppressWarnings("String_Node_Str") T entry=(T)((javax.enterprise.inject.spi.Bean<Object>)b).create(cc);
      if (LOG.isLoggable(java.util.logging.Level.FINE)) {
        LOG.fine("String_Node_Str" + entry + "String_Node_Str"+ b);
      }
      list.add(entry);
    }
  }
 catch (  Throwable e) {
    LOG.log(java.util.logging.Level.SEVERE,"String_Node_Str" + cls + "String_Node_Str",e);
  }
}
Program: 50744
Project: 50744
Buggy source:
/** 
 * This method loads the rule base associated with the Drools event processor.
 * @return The knowledge base
 * @throws Exception Failed to load rule base
 */
private KieBase loadRuleBase() throws Exception {
  String droolsRuleBase=getRuleName() + "String_Node_Str";
  try {
    KieServices ks=KieServices.Factory.get();
    KieRepository kr=ks.getRepository();
    KieModuleModel kmm=ks.newKieModuleModel();
    KieBaseModel kbm=kmm.newKieBaseModel(getRuleName()).setEqualsBehavior(EqualityBehaviorOption.EQUALITY).setEventProcessingMode(EventProcessingOption.STREAM);
    kbm.setDefault(true);
    KieFileSystem kfs=ks.newKieFileSystem();
    kfs.write("String_Node_Str" + kbm.getName() + "String_Node_Str",ks.getResources().newClassPathResource(droolsRuleBase));
    kfs.writeKModuleXML(kmm.toXML());
    KieBuilder kb=ks.newKieBuilder(kfs);
    kb.buildAll();
    KieContainer container=ks.newKieContainer(kr.getDefaultReleaseId());
    KieBase kbase=container.getKieBase();
    System.setProperty("String_Node_Str","String_Node_Str");
    return kbase;
  }
 catch (  Throwable e) {
    String mesg=MessageFormat.format(java.util.PropertyResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"),droolsRuleBase,getRuleName());
    LOG.log(Level.SEVERE,mesg,e);
    throw new Exception(mesg,e);
  }
}

Fixed version (ground truth):
/** 
 * This method loads the rule base associated with the Drools event processor.
 * @return The knowledge base
 * @throws Exception Failed to load rule base
 */
@SuppressWarnings("String_Node_Str") private KieBase loadRuleBase() throws Exception {
  String droolsRuleBase=getRuleName() + "String_Node_Str";
  try {
    KnowledgeBuilderConfiguration kBuilderConfiguration=KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,Thread.currentThread().getContextClassLoader());
    KnowledgeBuilder kbuilder=KnowledgeBuilderFactory.newKnowledgeBuilder(kBuilderConfiguration);
    kbuilder.add(ResourceFactory.newClassPathResource(droolsRuleBase),ResourceType.DRL);
    if (kbuilder.hasErrors()) {
      String mesg=MessageFormat.format(java.util.PropertyResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"),droolsRuleBase,getRuleName());
      mesg+="String_Node_Str" + kbuilder.getErrors().toString();
      LOG.log(Level.SEVERE,mesg);
      throw new Exception(mesg);
    }
    KieBaseConfiguration config=KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,Thread.currentThread().getContextClassLoader());
    config.setOption(EventProcessingOption.STREAM);
    KnowledgeBase kbase=KnowledgeBaseFactory.newKnowledgeBase(config);
    kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
    return kbase;
  }
 catch (  Throwable e) {
    String mesg=MessageFormat.format(java.util.PropertyResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"),droolsRuleBase,getRuleName());
    LOG.log(Level.SEVERE,mesg,e);
    throw new Exception(mesg,e);
  }
}
Program: 50745
Project: 50745
Buggy source:
@Test public void testGetWorkingDurationAcrossDayBoundary(){
  Calendar cal=new Calendar();
  Calendar.WorkingDay monday=new Calendar.WorkingDay();
  monday.setStartHour(9);
  monday.setEndHour(17);
  monday.setEndMinute(30);
  cal.setMonday(monday);
  Calendar.WorkingDay tuesday=new Calendar.WorkingDay();
  tuesday.setStartHour(9);
  tuesday.setEndHour(17);
  tuesday.setEndMinute(30);
  cal.setTuesday(tuesday);
  java.util.Calendar from1=java.util.Calendar.getInstance();
  from1.set(java.util.Calendar.DAY_OF_MONTH,24);
  from1.set(java.util.Calendar.MONTH,java.util.Calendar.JUNE);
  from1.set(java.util.Calendar.YEAR,2013);
  from1.set(java.util.Calendar.HOUR_OF_DAY,16);
  from1.set(java.util.Calendar.MINUTE,0);
  java.util.Calendar to1=java.util.Calendar.getInstance();
  to1.set(java.util.Calendar.DAY_OF_MONTH,25);
  to1.set(java.util.Calendar.MONTH,java.util.Calendar.JUNE);
  to1.set(java.util.Calendar.YEAR,2013);
  to1.set(java.util.Calendar.HOUR_OF_DAY,10);
  to1.set(java.util.Calendar.MINUTE,0);
  if (cal.getWorkingDuration(from1.getTimeInMillis(),to1.getTimeInMillis()) != 2.5 * 60 * 60* 1000) {
    fail("String_Node_Str" + cal.getWorkingDuration(from1.getTimeInMillis(),to1.getTimeInMillis()));
  }
}

Fixed version (ground truth):
@Test public void testGetWorkingDurationAcrossDayBoundary(){
  Calendar cal=new Calendar();
  Calendar.WorkingDay monday=new Calendar.WorkingDay();
  monday.setStartHour(9);
  monday.setEndHour(17);
  monday.setEndMinute(30);
  cal.setMonday(monday);
  Calendar.WorkingDay tuesday=new Calendar.WorkingDay();
  tuesday.setStartHour(9);
  tuesday.setEndHour(17);
  tuesday.setEndMinute(30);
  cal.setTuesday(tuesday);
  java.util.Calendar from1=java.util.Calendar.getInstance();
  from1.set(java.util.Calendar.DAY_OF_MONTH,24);
  from1.set(java.util.Calendar.MONTH,java.util.Calendar.JUNE);
  from1.set(java.util.Calendar.YEAR,2013);
  from1.set(java.util.Calendar.HOUR_OF_DAY,16);
  from1.set(java.util.Calendar.MINUTE,0);
  java.util.Calendar to1=java.util.Calendar.getInstance();
  to1.set(java.util.Calendar.DAY_OF_MONTH,25);
  to1.set(java.util.Calendar.MONTH,java.util.Calendar.JUNE);
  to1.set(java.util.Calendar.YEAR,2013);
  to1.set(java.util.Calendar.HOUR_OF_DAY,10);
  to1.set(java.util.Calendar.MINUTE,0);
  double val=Math.abs(cal.getWorkingDuration(from1.getTimeInMillis(),to1.getTimeInMillis()) - 2.5 * 60 * 60* 1000);
  if (val > 10) {
    fail("String_Node_Str" + cal.getWorkingDuration(from1.getTimeInMillis(),to1.getTimeInMillis()));
  }
}
Program: 50748
Project: 50748
Buggy source:
/** 
 * This method initializes the active collection source.
 * @throws Exception Failed to initialize source
 */
public void init(ActiveCollectionContext context) throws Exception {
  _context=context;
  preInit();
  if (_listeners.size() > 0) {
    for (    AbstractActiveChangeListener l : _listeners) {
      if (LOG.isLoggable(Level.FINER)) {
        LOG.finer("String_Node_Str" + getName() + "String_Node_Str"+ l);
      }
      l.init();
      if (_activeCollection != null) {
        _activeCollection.addActiveChangeListener(l);
      }
    }
  }
  if (_groupBy != null) {
    _groupByExpression=MVEL.compileExpression(_groupBy);
    if (_aggregationDuration > 0) {
      _aggregator=new Aggregator();
    }
  }
  if (_scheduledScriptExpression != null && _scheduledInterval > 0) {
    _scheduledTimer=new java.util.Timer();
    _scheduledTimer.scheduleAtFixedRate(new TimerTask(){
      public void run(){
        java.util.Map<String,Object> vars=new java.util.HashMap<String,Object>();
        vars.put("String_Node_Str",ActiveCollectionSource.this);
        vars.put("String_Node_Str",_variables);
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("String_Node_Str" + getName() + "String_Node_Str"+ _variables);
        }
synchronized (ActiveCollectionSource.this) {
          MVEL.executeExpression(_scheduledScriptExpression,vars);
        }
      }
    }
,0,_scheduledInterval);
  }
}

Fixed version (ground truth):
/** 
 * This method initializes the active collection source.
 * @param context The context
 * @throws Exception Failed to initialize source
 */
public void init(ActiveCollectionContext context) throws Exception {
  _context=context;
  preInit();
  if (_listeners.size() > 0) {
    for (    AbstractActiveChangeListener l : _listeners) {
      if (LOG.isLoggable(Level.FINER)) {
        LOG.finer("String_Node_Str" + getName() + "String_Node_Str"+ l);
      }
      l.init();
      if (_activeCollection != null) {
        _activeCollection.addActiveChangeListener(l);
      }
    }
  }
  if (_groupBy != null) {
    _groupByExpression=MVEL.compileExpression(_groupBy);
    if (_aggregationDuration > 0) {
      _aggregator=new Aggregator();
    }
  }
  if (_scheduledScriptExpression != null && _scheduledInterval > 0) {
    _scheduledTimer=new java.util.Timer();
    _scheduledTimer.scheduleAtFixedRate(new TimerTask(){
      public void run(){
        java.util.Map<String,Object> vars=new java.util.HashMap<String,Object>();
        vars.put("String_Node_Str",ActiveCollectionSource.this);
        vars.put("String_Node_Str",_variables);
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("String_Node_Str" + getName() + "String_Node_Str"+ _variables);
        }
synchronized (ActiveCollectionSource.this) {
          MVEL.executeExpression(_scheduledScriptExpression,vars);
        }
      }
    }
,0,_scheduledInterval);
  }
}
Program: 50750
Project: 50750
Buggy source:
/** 
 * This method sets the reason for exclusion.
 * @param val The reason
 */
public ExcludedDay setReason(String val){
  _reason=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the reason for exclusion.
 * @param val The reason
 * @return The excluded day
 */
public ExcludedDay setReason(String val){
  _reason=val;
  return (this);
}
Program: 50751
Project: 50751
Buggy source:
/** 
 * This method sets the day.
 * @param val The day
 */
public ExcludedDay setDay(int val){
  _day=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the day.
 * @param val The day
 * @return The excluded day
 */
public ExcludedDay setDay(int val){
  _day=val;
  return (this);
}
Program: 50752
Project: 50752
Buggy source:
/** 
 * This method sets the end minute.
 * @param val The end minute
 */
public WorkingDay setEndMinute(int val){
  _endMinute=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the end minute.
 * @param val The end minute
 * @return The working day
 */
public WorkingDay setEndMinute(int val){
  _endMinute=val;
  return (this);
}
Program: 50753
Project: 50753
Buggy source:
/** 
 * This method sets the month. January is represented by 1, through to December which is represented by 12.
 * @param val The month
 */
public ExcludedDay setMonth(int val){
  _month=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the month. January is represented by 1, through to December which is represented by 12.
 * @param val The month
 * @return The excluded day
 */
public ExcludedDay setMonth(int val){
  _month=val;
  return (this);
}
Program: 50754
Project: 50754
Buggy source:
/** 
 * This method sets the year.
 * @param val The year
 */
public ExcludedDay setYear(int val){
  _year=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the year.
 * @param val The year
 * @return The excluded day
 */
public ExcludedDay setYear(int val){
  _year=val;
  return (this);
}
Program: 50755
Project: 50755
Buggy source:
/** 
 * This method sets the end hour.
 * @param val The end hour
 */
public WorkingDay setEndHour(int val){
  _endHour=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the end hour.
 * @param val The end hour
 * @return The working day
 */
public WorkingDay setEndHour(int val){
  _endHour=val;
  return (this);
}
Program: 50756
Project: 50756
Buggy source:
/** 
 * This method sets the start minute.
 * @param val The start minute
 */
public WorkingDay setStartMinute(int val){
  _startMinute=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the start minute.
 * @param val The start minute
 * @return The working day
 */
public WorkingDay setStartMinute(int val){
  _startMinute=val;
  return (this);
}
Program: 50757
Project: 50757
Buggy source:
/** 
 * This method sets the start hour.
 * @param val The start hour
 */
public WorkingDay setStartHour(int val){
  _startHour=val;
  return (this);
}

Fixed version (ground truth):
/** 
 * This method sets the start hour.
 * @param val The start hour
 * @return The working day
 */
public WorkingDay setStartHour(int val){
  _startHour=val;
  return (this);
}
Program: 50758
Project: 50758
Buggy source:
/** 
 * This method returns the service node associated with the supplied service interface.
 * @param intf The interface
 * @return The service node, or null if not found
 */
public ServiceNode getServiceNode(String serviceType){
  ServiceNode ret=null;
  for (  ServiceNode sn : _nodes) {
    if (sn.getService().getServiceType().equals(serviceType)) {
      ret=sn;
      break;
    }
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns the service node associated with the supplied service interface.
 * @param serviceType The service type
 * @return The service node, or null if not found
 */
public ServiceNode getServiceNode(String serviceType){
  ServiceNode ret=null;
  for (  ServiceNode sn : _nodes) {
    if (sn.getService().getServiceType().equals(serviceType)) {
      ret=sn;
      break;
    }
  }
  return (ret);
}
Program: 50760
Project: 50760
Buggy source:
/** 
 * This method returns activity types (events) associated with the supplied context value.
 * @param type The type
 * @param value The value
 * @return The list of activity types
 * @throws Exception Failed to obtain activity types
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String getActivityTypes(@QueryParam("String_Node_Str") String type,@QueryParam("String_Node_Str") String value,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") long from,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") long to) throws Exception {
  String ret="String_Node_Str";
  Context context=new Context();
  if (type != null) {
    context.setType(Context.Type.valueOf(type));
  }
  context.setValue(value);
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + context);
  }
  if (_activityServer == null) {
    throw new Exception("String_Node_Str");
  }
  java.util.List<ActivityType> list=null;
  if (from > 0 || to > 0) {
    list=_activityServer.getActivityTypes(context,from,to);
  }
 else {
    list=_activityServer.getActivityTypes(context);
  }
  if (list != null) {
    byte[] b=ActivityUtil.serializeActivityTypeList(list);
    ret=new String(b);
  }
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns activity types (events) associated with the supplied context value.
 * @param type The type
 * @param value The value
 * @param from The optional 'from' timestamp
 * @param to The optional 'to' timestamp
 * @return The list of activity types
 * @throws Exception Failed to obtain activity types
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String getActivityTypes(@QueryParam("String_Node_Str") String type,@QueryParam("String_Node_Str") String value,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") long from,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") long to) throws Exception {
  String ret="String_Node_Str";
  Context context=new Context();
  if (type != null) {
    context.setType(Context.Type.valueOf(type));
  }
  context.setValue(value);
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + context);
  }
  if (_activityServer == null) {
    throw new Exception("String_Node_Str");
  }
  java.util.List<ActivityType> list=null;
  if (from > 0 || to > 0) {
    list=_activityServer.getActivityTypes(context,from,to);
  }
 else {
    list=_activityServer.getActivityTypes(context);
  }
  if (list != null) {
    byte[] b=ActivityUtil.serializeActivityTypeList(list);
    ret=new String(b);
  }
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}
Program: 50766
Project: 50766
Buggy source:
/** 
 * This method handles queries.
 * @param width The optional width
 * @return The list of objects
 * @throws Exception Failed to query
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String instance(@QueryParam("String_Node_Str") String identifier) throws Exception {
  String ret="String_Node_Str";
  CallTrace ct=getCallTrace(identifier);
  if (ct != null) {
    byte[] b=CallTraceUtil.serializeCallTrace(ct);
    if (b != null) {
      ret=new String(b);
    }
  }
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns the call trace for the specified identifier.
 * @param identifier The identifier
 * @return The call trace for the identifier
 * @throws Exception Failed to obtain call trace
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String instance(@QueryParam("String_Node_Str") String identifier) throws Exception {
  String ret="String_Node_Str";
  CallTrace ct=getCallTrace(identifier);
  if (ct != null) {
    byte[] b=CallTraceUtil.serializeCallTrace(ct);
    if (b != null) {
      ret=new String(b);
    }
  }
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}
Program: 50767
Project: 50767
Buggy source:
/** 
 * {@inheritDoc}
 */
public InfinispanActiveMap(String name,Map<Object,Object> map,long itemExpiration,int maxItems,int highWaterMark){
  super(name,map,itemExpiration,maxItems,highWaterMark);
  if (map instanceof Cache) {
    Cache<Object,Object> cache=(Cache<Object,Object>)map;
    cache.addListener(_listener);
  }
}

Fixed version (ground truth):
/** 
 * This constructor initializes the active map.
 * @param name The name
 * @param map The map
 * @param itemExpiration Item expiration time, or 0 if not relevant
 * @param maxItems Max number of items, or 0 if not relevant
 * @param highWaterMark Generate warning if number of items exceed high water mark
 */
public InfinispanActiveMap(String name,Map<Object,Object> map,long itemExpiration,int maxItems,int highWaterMark){
  super(name,map,itemExpiration,maxItems,highWaterMark);
  if (map instanceof Cache) {
    Cache<Object,Object> cache=(Cache<Object,Object>)map;
    cache.addListener(_listener);
  }
}