nus-yam/ex-repair huggingface dataset:
Program: 4621
Project: 4621
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,Throwable cause) throws Exception {
  HttpResponse response=cause instanceof HandlerException ? ((HandlerException)cause).createFailureResponse() : createErrorResponse(cause);
  ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,Throwable cause) throws Exception {
  HttpResponse response=cause instanceof HandlerException ? ((HandlerException)cause).createFailureResponse() : createErrorResponse(cause);
  HttpUtil.setKeepAlive(response,false);
  ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
}
Program: 4622
Project: 4622
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object msg) throws Exception {
  if (!(msg instanceof HttpRequest)) {
    ctx.fireChannelRead(msg);
    return;
  }
  try {
    HttpRequest request=(HttpRequest)msg;
    if (request.uri().equals(Constants.EndPoints.STATUS)) {
      ByteBuf content=Unpooled.copiedBuffer(Constants.Monitor.STATUS_OK,StandardCharsets.UTF_8);
      HttpResponse response=new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.OK,content);
      HttpUtil.setContentLength(response,content.readableBytes());
      response.headers().set(HttpHeaderNames.CONTENT_TYPE,"String_Node_Str");
      ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
    }
 else {
      ReferenceCountUtil.retain(msg);
      ctx.fireChannelRead(msg);
    }
  }
  finally {
    ReferenceCountUtil.release(msg);
  }
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object msg) throws Exception {
  if (!(msg instanceof HttpRequest)) {
    ctx.fireChannelRead(msg);
    return;
  }
  try {
    HttpRequest request=(HttpRequest)msg;
    if (request.uri().equals(Constants.EndPoints.STATUS)) {
      ByteBuf content=Unpooled.copiedBuffer(Constants.Monitor.STATUS_OK,StandardCharsets.UTF_8);
      HttpResponse response=new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.OK,content);
      HttpUtil.setContentLength(response,content.readableBytes());
      HttpUtil.setKeepAlive(response,false);
      response.headers().set(HttpHeaderNames.CONTENT_TYPE,"String_Node_Str");
      ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
    }
 else {
      ReferenceCountUtil.retain(msg);
      ctx.fireChannelRead(msg);
    }
  }
  finally {
    ReferenceCountUtil.release(msg);
  }
}
Program: 4623
Project: 4623
Buggy source:
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception {
  if (!closeByIdle) {
    Channels.closeOnFlush(inboundChannel);
  }
  ctx.fireChannelInactive();
}

Fixed version (ground truth):
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception {
  if (requestInProgress || !keepAlive) {
    Channels.closeOnFlush(inboundChannel);
  }
  ctx.fireChannelInactive();
}
Program: 4624
Project: 4624
Buggy source:
@Override public void userEventTriggered(ChannelHandlerContext ctx,Object evt) throws Exception {
  if (!(evt instanceof IdleStateEvent)) {
    ctx.fireUserEventTriggered(evt);
    return;
  }
  if (IdleState.ALL_IDLE == ((IdleStateEvent)evt).state()) {
    if (requestInProgress) {
      LOG.trace("String_Node_Str");
    }
 else {
      Channel channel=ctx.channel();
      channel.close();
      closeByIdle=true;
      LOG.trace("String_Node_Str" + "String_Node_Str",channel,channel.localAddress(),channel.remoteAddress());
    }
  }
}

Fixed version (ground truth):
@Override public void userEventTriggered(ChannelHandlerContext ctx,Object evt) throws Exception {
  if (!(evt instanceof IdleStateEvent)) {
    ctx.fireUserEventTriggered(evt);
    return;
  }
  if (IdleState.ALL_IDLE == ((IdleStateEvent)evt).state()) {
    if (requestInProgress) {
      LOG.trace("String_Node_Str");
    }
 else {
      Channel channel=ctx.channel();
      channel.close();
      LOG.trace("String_Node_Str" + "String_Node_Str",channel,channel.localAddress(),channel.remoteAddress());
    }
  }
}
Program: 4625
Project: 4625
Buggy source:
@Override public void write(ChannelHandlerContext ctx,Object msg,ChannelPromise promise) throws Exception {
  if (!requestInProgress) {
    requestInProgress=msg instanceof HttpObject;
  }
  ctx.write(msg,promise);
}

Fixed version (ground truth):
@Override public void write(ChannelHandlerContext ctx,Object msg,ChannelPromise promise) throws Exception {
  if (msg instanceof HttpRequest) {
    requestInProgress=true;
    keepAlive=HttpUtil.isKeepAlive((HttpRequest)msg);
  }
  ctx.write(msg,promise);
}
Program: 4626
Project: 4626
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object msg) throws Exception {
  inboundChannel.write(msg);
  if (msg instanceof LastHttpContent) {
    requestInProgress=false;
  }
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object msg) throws Exception {
  inboundChannel.write(msg);
  if (msg instanceof HttpResponse) {
    keepAlive=HttpUtil.isKeepAlive((HttpResponse)msg);
  }
  if (msg instanceof LastHttpContent) {
    requestInProgress=false;
  }
}
Program: 4627
Project: 4627
Buggy source:
@Override public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
  if (requestInProgress) {
    final Channel channel=ctx.channel();
    ctx.executor().execute(new Runnable(){
      @Override public void run(){
        if (channel.isWritable()) {
          LOG.trace("String_Node_Str");
          inboundChannel.config().setAutoRead(true);
        }
 else {
          LOG.trace("String_Node_Str");
          inboundChannel.config().setAutoRead(false);
        }
      }
    }
);
  }
  ctx.fireChannelWritabilityChanged();
}

Fixed version (ground truth):
@Override public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
  if (requestInProgress) {
    final Channel channel=ctx.channel();
    ctx.executor().execute(() -> {
      if (channel.isWritable()) {
        LOG.trace("String_Node_Str");
        inboundChannel.config().setAutoRead(true);
      }
 else {
        LOG.trace("String_Node_Str");
        inboundChannel.config().setAutoRead(false);
      }
    }
);
  }
  ctx.fireChannelWritabilityChanged();
}
Program: 4628
Project: 4628
Buggy source:
@POST @Path("String_Node_Str") public void upload(FullHttpRequest request,HttpResponder responder) throws IOException {
  ByteBuf content=request.content();
  int readableBytes;
  ChunkResponder chunkResponder=responder.sendChunkStart(HttpResponseStatus.OK);
  while ((readableBytes=content.readableBytes()) > 0) {
    int read=Math.min(readableBytes,CHUNK_SIZE);
    chunkResponder.sendChunk(content.readRetainedSlice(read));
  }
  chunkResponder.close();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void upload(FullHttpRequest request,HttpResponder responder) throws IOException {
  numRequests.incrementAndGet();
  ByteBuf content=request.content();
  int readableBytes;
  ChunkResponder chunkResponder=responder.sendChunkStart(HttpResponseStatus.OK);
  while ((readableBytes=content.readableBytes()) > 0) {
    int read=Math.min(readableBytes,CHUNK_SIZE);
    chunkResponder.sendChunk(content.readRetainedSlice(read));
  }
  chunkResponder.close();
}
Program: 4629
Project: 4629
Buggy source:
@POST @Path("String_Node_Str") public BodyConsumer upload2(HttpRequest request,HttpResponder responder) throws Exception {
  return new AbstractBodyConsumer(TEMP_FOLDER.newFile()){
    @Override protected void onFinish(    HttpResponder responder,    File file) throws Exception {
      responder.sendFile(file);
    }
  }
;
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public BodyConsumer upload2(HttpRequest request,HttpResponder responder) throws Exception {
  numRequests.incrementAndGet();
  return new AbstractBodyConsumer(TEMP_FOLDER.newFile()){
    @Override protected void onFinish(    HttpResponder responder,    File file) throws Exception {
      responder.sendFile(file);
    }
  }
;
}
Program: 4630
Project: 4630
Buggy source:
private void checkMutualExclusive(Map<String,String> props,String key1,String key2){
  Preconditions.checkArgument(!(Boolean.valueOf(props.get(key1)) && Boolean.valueOf(props.get(key2))),"String_Node_Str",FileSetProperties.DATA_EXTERNAL,FileSetProperties.DATA_USE_EXISTING);
}

Fixed version (ground truth):
private void checkMutualExclusive(Map<String,String> props,String key1,String key2){
  Preconditions.checkArgument(!(Boolean.valueOf(props.get(key1)) && Boolean.valueOf(props.get(key2))),"String_Node_Str",key1,key2);
}
Program: 4631
Project: 4631
Buggy source:
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception {
  if (requestInProgress) {
    Channels.closeOnFlush(inboundChannel);
  }
  ctx.fireChannelInactive();
}

Fixed version (ground truth):
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception {
  if (!closeByIdle) {
    Channels.closeOnFlush(inboundChannel);
  }
  ctx.fireChannelInactive();
}
Program: 4632
Project: 4632
Buggy source:
@Override public void userEventTriggered(ChannelHandlerContext ctx,Object evt) throws Exception {
  if (!(evt instanceof IdleStateEvent)) {
    ctx.fireUserEventTriggered(evt);
    return;
  }
  if (IdleState.ALL_IDLE == ((IdleStateEvent)evt).state()) {
    if (requestInProgress) {
      LOG.trace("String_Node_Str");
    }
 else {
      Channel channel=ctx.channel();
      channel.close();
      LOG.trace("String_Node_Str" + "String_Node_Str",channel,channel.localAddress(),channel.remoteAddress());
    }
  }
}

Fixed version (ground truth):
@Override public void userEventTriggered(ChannelHandlerContext ctx,Object evt) throws Exception {
  if (!(evt instanceof IdleStateEvent)) {
    ctx.fireUserEventTriggered(evt);
    return;
  }
  if (IdleState.ALL_IDLE == ((IdleStateEvent)evt).state()) {
    if (requestInProgress) {
      LOG.trace("String_Node_Str");
    }
 else {
      Channel channel=ctx.channel();
      channel.close();
      closeByIdle=true;
      LOG.trace("String_Node_Str" + "String_Node_Str",channel,channel.localAddress(),channel.remoteAddress());
    }
  }
}
Program: 4633
Project: 4633
Buggy source:
@Inject TokenSecureStoreRenewer(YarnConfiguration yarnConf,CConfiguration cConf,LocationFactory locationFactory,SecureStore secureStore){
  this.yarnConf=yarnConf;
  this.locationFactory=locationFactory;
  this.secureStore=secureStore;
  this.secureExplore=cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && UserGroupInformation.isSecurityEnabled();
}

Fixed version (ground truth):
@Inject TokenSecureStoreRenewer(YarnConfiguration yarnConf,CConfiguration cConf,LocationFactory locationFactory,SecureStore secureStore){
  this.yarnConf=yarnConf;
  this.cConf=cConf;
  this.locationFactory=locationFactory;
  this.secureStore=secureStore;
  this.secureExplore=cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && UserGroupInformation.isSecurityEnabled();
}
Program: 4634
Project: 4634
Buggy source:
/** 
 * Creates a   {@link Credentials} that contains delegation tokens of the current user for all services that CDAP uses.
 */
public Credentials createCredentials(){
  try {
    Credentials refreshedCredentials=new Credentials();
    if (User.isSecurityEnabled()) {
      YarnTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (User.isHBaseSecurityEnabled(yarnConf)) {
      HBaseTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (secureExplore) {
      HiveTokenUtils.obtainToken(refreshedCredentials);
      JobHistoryServerTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (secureStore instanceof DelegationTokensUpdater) {
      String renewer=UserGroupInformation.getCurrentUser().getShortUserName();
      ((DelegationTokensUpdater)secureStore).addDelegationTokens(renewer,refreshedCredentials);
    }
    YarnUtils.addDelegationTokens(yarnConf,locationFactory,refreshedCredentials);
    return refreshedCredentials;
  }
 catch (  IOException ioe) {
    throw Throwables.propagate(ioe);
  }
}

Fixed version (ground truth):
/** 
 * Creates a   {@link Credentials} that contains delegation tokens of the current user for all services that CDAP uses.
 */
public Credentials createCredentials(){
  try {
    Credentials refreshedCredentials=new Credentials();
    if (User.isSecurityEnabled()) {
      YarnTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (User.isHBaseSecurityEnabled(yarnConf)) {
      HBaseTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (secureExplore) {
      HiveTokenUtils.obtainTokens(cConf,refreshedCredentials);
      JobHistoryServerTokenUtils.obtainToken(yarnConf,refreshedCredentials);
    }
    if (secureStore instanceof DelegationTokensUpdater) {
      String renewer=UserGroupInformation.getCurrentUser().getShortUserName();
      ((DelegationTokensUpdater)secureStore).addDelegationTokens(renewer,refreshedCredentials);
    }
    YarnUtils.addDelegationTokens(yarnConf,locationFactory,refreshedCredentials);
    return refreshedCredentials;
  }
 catch (  IOException ioe) {
    throw Throwables.propagate(ioe);
  }
}
Program: 4636
Project: 4636
Buggy source:
/** 
 * Remove a specific node from the dag. Removing a node will remove all connections into the node and all connection coming out of the node. Removing a node will also re-compute the sources and sinks of the dag.
 * @param node the node to remove
 */
private void removeNode(String node){
  for (  String outputNode : outgoingConnections.removeAll(node)) {
    incomingConnections.remove(outputNode,node);
    if (incomingConnections.get(outputNode).isEmpty()) {
      sources.add(outputNode);
    }
  }
  for (  String inputNode : incomingConnections.removeAll(node)) {
    outgoingConnections.remove(inputNode,node);
    if (outgoingConnections.get(inputNode).isEmpty()) {
      sinks.add(inputNode);
    }
  }
  sinks.remove(node);
  sources.remove(node);
}

Fixed version (ground truth):
/** 
 * Remove a specific node from the dag. Removing a node will remove all connections into the node and all connection coming out of the node. Removing a node will also re-compute the sources and sinks of the dag.
 * @param node the node to remove
 */
private void removeNode(String node){
  for (  String outputNode : outgoingConnections.removeAll(node)) {
    incomingConnections.remove(outputNode,node);
    if (incomingConnections.get(outputNode).isEmpty()) {
      sources.add(outputNode);
    }
  }
  for (  String inputNode : incomingConnections.removeAll(node)) {
    outgoingConnections.remove(inputNode,node);
    if (outgoingConnections.get(inputNode).isEmpty()) {
      sinks.add(inputNode);
    }
  }
  sinks.remove(node);
  sources.remove(node);
  nodes.remove(node);
}
Program: 4639
Project: 4639
Buggy source:
@Override protected UGIWithPrincipal createUGI(ImpersonationRequest impersonationRequest) throws IOException {
  ImpersonationRequest jsonRequest=new ImpersonationRequest(impersonationRequest.getEntityId(),impersonationRequest.getImpersonatedOpType(),impersonationRequest.getPrincipal());
  PrincipalCredentials principalCredentials=GSON.fromJson(executeRequest(jsonRequest).getResponseBodyAsString(),PrincipalCredentials.class);
  LOG.debug("String_Node_Str",principalCredentials);
  Location location=locationFactory.create(URI.create(principalCredentials.getCredentialsPath()));
  try {
    UserGroupInformation impersonatedUGI=UserGroupInformation.createRemoteUser(principalCredentials.getPrincipal());
    impersonatedUGI.addCredentials(readCredentials(location));
    return new UGIWithPrincipal(principalCredentials.getPrincipal(),impersonatedUGI);
  }
  finally {
    try {
      if (!location.delete()) {
        LOG.warn("String_Node_Str",location);
      }
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str",location,e);
    }
  }
}

Fixed version (ground truth):
@Override protected UGIWithPrincipal createUGI(ImpersonationRequest impersonationRequest) throws IOException {
  ImpersonationRequest jsonRequest=new ImpersonationRequest(impersonationRequest.getEntityId(),impersonationRequest.getImpersonatedOpType(),impersonationRequest.getPrincipal());
  PrincipalCredentials principalCredentials=GSON.fromJson(executeRequest(jsonRequest).getResponseBodyAsString(),PrincipalCredentials.class);
  LOG.debug("String_Node_Str",principalCredentials);
  Location location=locationFactory.create(URI.create(principalCredentials.getCredentialsPath()));
  try {
    String user=principalCredentials.getPrincipal();
    if (impersonationRequest.getImpersonatedOpType() == ImpersonatedOpType.EXPLORE) {
      user=new KerberosName(user).getShortName();
    }
    UserGroupInformation impersonatedUGI=UserGroupInformation.createRemoteUser(user);
    impersonatedUGI.addCredentials(readCredentials(location));
    return new UGIWithPrincipal(principalCredentials.getPrincipal(),impersonatedUGI);
  }
  finally {
    try {
      if (!location.delete()) {
        LOG.warn("String_Node_Str",location);
      }
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str",location,e);
    }
  }
}
Program: 4641
Project: 4641
Buggy source:
@VisibleForTesting static Version determineVersionFromVersionString(String versionString) throws ParseException {
  if (versionString.startsWith(HBASE_94_VERSION)) {
    return Version.HBASE_94;
  }
  if (versionString.startsWith(HBASE_96_VERSION)) {
    return Version.HBASE_96;
  }
  if (versionString.startsWith(HBASE_98_VERSION)) {
    return Version.HBASE_98;
  }
  VersionNumber ver=VersionNumber.create(versionString);
  if (versionString.startsWith(HBASE_10_VERSION)) {
    return getHBase10VersionFromVersion(ver);
  }
  if (versionString.startsWith(HBASE_11_VERSION)) {
    return Version.HBASE_11;
  }
  if (versionString.startsWith(HBASE_12_VERSION)) {
    return getHBase12VersionFromVersion(ver);
  }
  if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER)) {
    return Version.UNKNOWN_CDH;
  }
  return Version.UNKNOWN;
}

Fixed version (ground truth):
@VisibleForTesting static Version determineVersionFromVersionString(String versionString) throws ParseException {
  if (versionString.startsWith(HBASE_94_VERSION)) {
    return Version.HBASE_94;
  }
  if (versionString.startsWith(HBASE_96_VERSION)) {
    return Version.HBASE_96;
  }
  if (versionString.startsWith(HBASE_98_VERSION)) {
    return Version.HBASE_98;
  }
  VersionNumber ver=VersionNumber.create(versionString);
  if (versionString.startsWith(HBASE_10_VERSION)) {
    return getHBase10VersionFromVersion(ver);
  }
  if (versionString.startsWith(HBASE_11_VERSION)) {
    return Version.HBASE_11;
  }
  if (versionString.startsWith(HBASE_12_VERSION)) {
    return getHBase12VersionFromVersion(ver);
  }
  boolean isCDH=ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER);
  if (versionString.startsWith(HBASE_13_VERSION) && !isCDH) {
    return Version.HBASE_11;
  }
  if (isCDH) {
    return Version.UNKNOWN_CDH;
  }
  return Version.UNKNOWN;
}
Program: 4643
Project: 4643
Buggy source:
private static Version getHBase12VersionFromVersion(VersionNumber ver){
  if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER)) {
    if (ver.getClassifier().startsWith(CDH57_CLASSIFIER) || ver.getClassifier().startsWith(CDH58_CLASSIFIER) || ver.getClassifier().startsWith(CDH59_CLASSIFIER)|| ver.getClassifier().startsWith(CDH510_CLASSIFIER)|| ver.getClassifier().startsWith(CDH511_CLASSIFIER)|| ver.getClassifier().startsWith(CDH512_CLASSIFIER)) {
      return Version.HBASE_12_CDH57;
    }
    return Version.UNKNOWN_CDH;
  }
 else {
    return Version.HBASE_11;
  }
}

Fixed version (ground truth):
private static Version getHBase12VersionFromVersion(VersionNumber ver){
  if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER)) {
    if (ver.getClassifier().startsWith(CDH57_CLASSIFIER) || ver.getClassifier().startsWith(CDH58_CLASSIFIER) || ver.getClassifier().startsWith(CDH59_CLASSIFIER)|| ver.getClassifier().startsWith(CDH510_CLASSIFIER)|| ver.getClassifier().startsWith(CDH511_CLASSIFIER)|| ver.getClassifier().startsWith(CDH512_CLASSIFIER)|| ver.getClassifier().startsWith(CDH513_CLASSIFIER)) {
      return Version.HBASE_12_CDH57;
    }
    return Version.UNKNOWN_CDH;
  }
 else {
    return Version.HBASE_11;
  }
}
Program: 4644
Project: 4644
Buggy source:
protected AccessToken fetchAccessToken(String username,String password) throws IOException, TimeoutException, InterruptedException {
  Properties properties=new Properties();
  properties.setProperty("String_Node_Str",username);
  properties.setProperty("String_Node_Str",password);
  final AuthenticationClient authClient=new BasicAuthenticationClient();
  authClient.configure(properties);
  ConnectionConfig connectionConfig=getClientConfig().getConnectionConfig();
  authClient.setConnectionInfo(connectionConfig.getHostname(),connectionConfig.getPort(),false);
  checkServicesWithRetry(new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return authClient.getAccessToken() != null;
    }
  }
,"String_Node_Str" + connectionConfig);
  return authClient.getAccessToken();
}

Fixed version (ground truth):
protected AccessToken fetchAccessToken(String username,String password) throws IOException, TimeoutException, InterruptedException {
  Properties properties=new Properties();
  properties.setProperty("String_Node_Str",username);
  properties.setProperty("String_Node_Str",password);
  properties.setProperty("String_Node_Str",Boolean.toString(getClientConfig().isVerifySSLCert()));
  final AuthenticationClient authClient=new BasicAuthenticationClient();
  authClient.configure(properties);
  ConnectionConfig connectionConfig=getClientConfig().getConnectionConfig();
  authClient.setConnectionInfo(connectionConfig.getHostname(),connectionConfig.getPort(),connectionConfig.isSSLEnabled());
  checkServicesWithRetry(new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return authClient.getAccessToken() != null;
    }
  }
,"String_Node_Str" + connectionConfig);
  return authClient.getAccessToken();
}
Program: 4645
Project: 4645
Buggy source:
@Override protected void shutDown() throws Exception {
  if (refreshService != null) {
    refreshService.interrupt();
  }
  if (storage != null) {
    storage.stop();
  }
}

Fixed version (ground truth):
@Override protected void shutDown() throws Exception {
  if (refreshService != null) {
    refreshService.interrupt();
    refreshService.join(10);
  }
  if (storage != null) {
    storage.stop();
  }
}
Program: 4646
Project: 4646
Buggy source:
@Path("String_Node_Str") @GET public void getPruneInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String regionName){
  if (!initializePruningDebug(responder)) {
    return;
  }
  try {
    Method method=debugClazz.getMethod("String_Node_Str",String.class);
    method.setAccessible(true);
    Object response=method.invoke(debugObject,regionName);
    if (response == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    RegionPruneInfo pruneInfo=(RegionPruneInfo)response;
    responder.sendJson(HttpResponseStatus.OK,pruneInfo);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void getPruneInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String regionName){
  try {
    if (!initializePruningDebug(responder)) {
      return;
    }
    RegionPruneInfo pruneInfo=pruningDebug.getRegionPruneInfo(regionName);
    if (pruneInfo == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    responder.sendJson(HttpResponseStatus.OK,pruneInfo);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}
Program: 4647
Project: 4647
Buggy source:
private boolean initializePruningDebug(HttpResponder responder){
  if (!pruneEnable) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    return false;
  }
synchronized (this) {
    if (debugClazz == null || debugObject == null) {
      try {
        this.debugClazz=getClass().getClassLoader().loadClass("String_Node_Str");
        this.debugObject=debugClazz.newInstance();
        for (        Map.Entry<String,String> entry : cConf) {
          hConf.set(entry.getKey(),entry.getValue());
        }
        Method initMethod=debugClazz.getMethod("String_Node_Str",Configuration.class);
        initMethod.setAccessible(true);
        initMethod.invoke(debugObject,hConf);
      }
 catch (      ClassNotFoundException|IllegalAccessException|InstantiationException ex) {
        LOG.debug("String_Node_Str",ex);
        this.debugClazz=null;
      }
catch (      NoSuchMethodException|InvocationTargetException ex) {
        LOG.debug("String_Node_Str",ex);
        this.debugClazz=null;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean initializePruningDebug(HttpResponder responder){
  if (!pruneEnable) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    return false;
  }
synchronized (this) {
    if (pruningDebug != null) {
      return true;
    }
    Configuration configuration=new Configuration();
    configuration.clear();
    copyConf(configuration,hConf);
    copyConf(configuration,cConf);
    try {
      @SuppressWarnings("String_Node_Str") Class<? extends InvalidListPruningDebug> clazz=(Class<? extends InvalidListPruningDebug>)getClass().getClassLoader().loadClass(PRUNING_TOOL_CLASS_NAME);
      this.pruningDebug=clazz.newInstance();
      pruningDebug.initialize(configuration);
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
      responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str" + e.getMessage());
      pruningDebug=null;
      return false;
    }
    return true;
  }
}
Program: 4648
Project: 4648
Buggy source:
@Override public void destroy(HandlerContext context){
  super.destroy(context);
synchronized (this) {
    if (debugClazz != null && debugObject != null) {
      try {
        Method destroyMethod=debugClazz.getMethod("String_Node_Str");
        destroyMethod.setAccessible(true);
        destroyMethod.invoke(debugObject);
      }
 catch (      NoSuchMethodException|InvocationTargetException|IllegalAccessException e) {
        LOG.debug("String_Node_Str",e);
      }
 finally {
        debugClazz=null;
        debugObject=null;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void destroy(HandlerContext context){
  super.destroy(context);
synchronized (this) {
    if (pruningDebug != null) {
      try {
        pruningDebug.destroy();
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
}
Program: 4649
Project: 4649
Buggy source:
@Path("String_Node_Str") @GET public void getIdleRegions(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numRegions){
  if (!initializePruningDebug(responder)) {
    return;
  }
  try {
    Method method=debugClazz.getMethod("String_Node_Str",Integer.class);
    method.setAccessible(true);
    Object response=method.invoke(debugObject,numRegions);
    Queue<RegionPruneInfo> pruneInfos=(Queue<RegionPruneInfo>)response;
    responder.sendJson(HttpResponseStatus.OK,pruneInfos);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void getIdleRegions(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numRegions,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String time){
  try {
    if (!initializePruningDebug(responder)) {
      return;
    }
    SortedSet<? extends RegionPruneInfo> pruneInfos=pruningDebug.getIdleRegions(numRegions,time);
    responder.sendJson(HttpResponseStatus.OK,pruneInfos);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}
Program: 4650
Project: 4650
Buggy source:
@Path("String_Node_Str") @GET public void getTimeRegions(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") long time){
  if (!initializePruningDebug(responder)) {
    return;
  }
  try {
    Method method=debugClazz.getMethod("String_Node_Str",Long.class);
    method.setAccessible(true);
    Object response=method.invoke(debugObject,time);
    if (response == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",time));
      return;
    }
    Map<Long,SortedSet<String>> timeRegionInfo=(Map<Long,SortedSet<String>>)response;
    responder.sendJson(HttpResponseStatus.OK,timeRegionInfo);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void getTimeRegions(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String time){
  try {
    if (!initializePruningDebug(responder)) {
      return;
    }
    RegionsAtTime timeRegionInfo=pruningDebug.getRegionsOnOrBeforeTime(time);
    responder.sendJson(HttpResponseStatus.OK,timeRegionInfo);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}
Program: 4651
Project: 4651
Buggy source:
@Path("String_Node_Str") @GET public void getRegionsToBeCompacted(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numRegions){
  if (!initializePruningDebug(responder)) {
    return;
  }
  try {
    Method method=debugClazz.getMethod("String_Node_Str",Integer.class);
    method.setAccessible(true);
    Object response=method.invoke(debugObject,numRegions);
    Set<String> regionNames=(Set<String>)response;
    responder.sendJson(HttpResponseStatus.OK,regionNames);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void getRegionsToBeCompacted(HttpRequest request,HttpResponder responder,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numRegions,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String time){
  try {
    if (!initializePruningDebug(responder)) {
      return;
    }
    Set<String> regionNames=pruningDebug.getRegionsToBeCompacted(numRegions,time);
    responder.sendJson(HttpResponseStatus.OK,regionNames);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    LOG.debug("String_Node_Str",e);
  }
}
Program: 4652
Project: 4652
Buggy source:
protected static CConfiguration createBasicCConf() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Service.MASTER_SERVICES_BIND_ADDRESS,hostname);
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder("String_Node_Str").getAbsolutePath());
  cConf.set(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  cConf.set(Constants.AppFabric.TEMP_DIR,System.getProperty("String_Node_Str"));
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  String updateSchedules=System.getProperty(Constants.AppFabric.APP_UPDATE_SCHEDULES);
  if (updateSchedules != null) {
    cConf.set(Constants.AppFabric.APP_UPDATE_SCHEDULES,updateSchedules);
  }
  cConf.setLong(Constants.Scheduler.EVENT_POLL_DELAY_MILLIS,100L);
  cConf.setLong(Constants.AppFabric.STATUS_EVENT_POLL_DELAY_MILLIS,100L);
  return cConf;
}

Fixed version (ground truth):
protected static CConfiguration createBasicCConf() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Service.MASTER_SERVICES_BIND_ADDRESS,hostname);
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder("String_Node_Str").getAbsolutePath());
  cConf.set(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  cConf.set(Constants.AppFabric.TEMP_DIR,System.getProperty("String_Node_Str"));
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  String updateSchedules=System.getProperty(Constants.AppFabric.APP_UPDATE_SCHEDULES);
  if (updateSchedules != null) {
    cConf.set(Constants.AppFabric.APP_UPDATE_SCHEDULES,updateSchedules);
  }
  cConf.setLong(Constants.Scheduler.EVENT_POLL_DELAY_MILLIS,100L);
  cConf.setLong(Constants.AppFabric.STATUS_EVENT_POLL_DELAY_MILLIS,100L);
  cConf.setBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE,true);
  return cConf;
}
Program: 4653
Project: 4653
Buggy source:
/** 
 * Tests invalidating a transaction.
 * @throws Exception
 */
@Test public void testInvalidateTx() throws Exception {
  TransactionSystemClient txClient=getTxClient();
  Transaction tx1=txClient.startShort();
  HttpResponse response=doPost("String_Node_Str" + tx1.getWritePointer() + "String_Node_Str");
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  Transaction tx2=txClient.startShort();
  txClient.commitOrThrow(tx2);
  response=doPost("String_Node_Str" + tx2.getWritePointer() + "String_Node_Str");
  Assert.assertEquals(409,response.getStatusLine().getStatusCode());
  Assert.assertEquals(400,doPost("String_Node_Str").getStatusLine().getStatusCode());
}

Fixed version (ground truth):
/** 
 * Tests invalidating a transaction.
 */
@Test public void testInvalidateTx() throws Exception {
  TransactionSystemClient txClient=getTxClient();
  Transaction tx1=txClient.startShort();
  HttpResponse response=doPost("String_Node_Str" + tx1.getWritePointer() + "String_Node_Str");
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  Transaction tx2=txClient.startShort();
  txClient.commitOrThrow(tx2);
  response=doPost("String_Node_Str" + tx2.getWritePointer() + "String_Node_Str");
  Assert.assertEquals(409,response.getStatusLine().getStatusCode());
  Assert.assertEquals(400,doPost("String_Node_Str").getStatusLine().getStatusCode());
}
Program: 4654
Project: 4654
Buggy source:
void publish(MessagingService messagingService) throws IOException {
  if (payloads.isEmpty()) {
    return;
  }
  int failureCount=0;
  long startTime=-1L;
  boolean done=false;
  while (!done) {
    try {
      messagingService.publish(StoreRequestBuilder.of(topicId).addPayloads(payloads.iterator()).build());
      payloads.clear();
      done=true;
    }
 catch (    TopicNotFoundException|ServiceUnavailableException e) {
      if (startTime < 0) {
        startTime=System.currentTimeMillis();
      }
      long retryMillis=getRetryStrategy().nextRetry(++failureCount,startTime);
      if (retryMillis < 0) {
        throw new IOException("String_Node_Str",e);
      }
      LOG.debug("String_Node_Str",e.getMessage(),retryMillis);
      try {
        TimeUnit.MILLISECONDS.sleep(retryMillis);
      }
 catch (      InterruptedException e1) {
        Thread.currentThread().interrupt();
        done=true;
      }
    }
  }
}

Fixed version (ground truth):
void publish(MessagingService messagingService) throws IOException {
  if (payloads.isEmpty()) {
    return;
  }
  int failureCount=0;
  long startTime=-1L;
  boolean done=false;
  boolean interrupted=false;
  while (!done) {
    try {
      interrupted=Thread.interrupted();
      messagingService.publish(StoreRequestBuilder.of(topicId).addPayloads(payloads.iterator()).build());
      payloads.clear();
      done=true;
    }
 catch (    TopicNotFoundException|ServiceUnavailableException e) {
      if (startTime < 0) {
        startTime=System.currentTimeMillis();
      }
      long retryMillis=getRetryStrategy().nextRetry(++failureCount,startTime);
      if (retryMillis < 0) {
        throw new IOException("String_Node_Str",e);
      }
      LOG.debug("String_Node_Str",e.getMessage(),retryMillis);
      if (interrupted) {
        LOG.warn("String_Node_Str");
        done=true;
      }
 else {
        try {
          TimeUnit.MILLISECONDS.sleep(retryMillis);
        }
 catch (        InterruptedException e1) {
          Thread.currentThread().interrupt();
          done=true;
        }
      }
    }
  }
  if (interrupted) {
    Thread.currentThread().interrupt();
  }
}
Program: 4655
Project: 4655
Buggy source:
public MapReduceMetricsWriter(Job jobConf,BasicMapReduceContext context){
  this.jobConf=jobConf;
  this.mapperMetrics=context.getProgramMetrics().childContext(Constants.Metrics.Tag.MR_TASK_TYPE,MapReduceMetrics.TaskType.Mapper.getId());
  this.reducerMetrics=context.getProgramMetrics().childContext(Constants.Metrics.Tag.MR_TASK_TYPE,MapReduceMetrics.TaskType.Reducer.getId());
  this.mapTaskMetricsCollectors=CacheBuilder.newBuilder().build(new CacheLoader<String,MetricsContext>(){
    @Override public MetricsContext load(    String taskId){
      return mapperMetrics.childContext(Constants.Metrics.Tag.INSTANCE_ID,taskId);
    }
  }
);
  this.reduceTaskMetricsCollectors=CacheBuilder.newBuilder().build(new CacheLoader<String,MetricsContext>(){
    @Override public MetricsContext load(    String taskId){
      return reducerMetrics.childContext(Constants.Metrics.Tag.INSTANCE_ID,taskId);
    }
  }
);
}

Fixed version (ground truth):
public MapReduceMetricsWriter(Job jobConf,BasicMapReduceContext context){
  this.jobConf=jobConf;
  this.mapperMetrics=context.getProgramMetrics().childContext(Constants.Metrics.Tag.MR_TASK_TYPE,MapReduceMetrics.TaskType.Mapper.getId());
  this.reducerMetrics=context.getProgramMetrics().childContext(Constants.Metrics.Tag.MR_TASK_TYPE,MapReduceMetrics.TaskType.Reducer.getId());
}
Program: 4658
Project: 4658
Buggy source:
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  boolean result=super.nextKeyValue();
  if (++processedRecords > flushFreq) {
    try {
      LOG.trace("String_Node_Str");
      basicMapReduceContext.flushOperations();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
      throw Throwables.propagate(e);
    }
    processedRecords=0;
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  boolean result=super.nextKeyValue();
  if (++processedRecords > flushFreq) {
    try {
      LOG.trace("String_Node_Str");
      basicMapReduceContext.flushOperations();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
      throw Throwables.propagate(e);
    }
    processedRecords=0;
  }
  if (System.currentTimeMillis() >= nextTimeToReportMetrics) {
    metricsWriter.reportMetrics();
    nextTimeToReportMetrics=System.currentTimeMillis() + reportIntervalInMillis;
  }
  return result;
}
Program: 4660
Project: 4660
Buggy source:
private WrappedReducer.Context createAutoFlushingContext(final Context context,final BasicMapReduceTaskContext basicMapReduceContext){
  final int flushFreq=context.getConfiguration().getInt("String_Node_Str",10000);
  @SuppressWarnings("String_Node_Str") WrappedReducer.Context flushingContext=new WrappedReducer().new Context(context){
    private int processedRecords=0;
    @Override public boolean nextKeyValue() throws IOException, InterruptedException {
      boolean result=super.nextKey();
      if (++processedRecords > flushFreq) {
        try {
          LOG.trace("String_Node_Str");
          basicMapReduceContext.flushOperations();
        }
 catch (        Exception e) {
          LOG.error("String_Node_Str",e);
          throw Throwables.propagate(e);
        }
        processedRecords=0;
      }
      return result;
    }
  }
;
  return flushingContext;
}

Fixed version (ground truth):
private WrappedReducer.Context createAutoFlushingContext(final Context context,final BasicMapReduceTaskContext basicMapReduceContext,final ReduceTaskMetricsWriter metricsWriter){
  final int flushFreq=context.getConfiguration().getInt("String_Node_Str",10000);
  final long reportIntervalInMillis=basicMapReduceContext.getMetricsReportIntervalMillis();
  @SuppressWarnings("String_Node_Str") WrappedReducer.Context flushingContext=new WrappedReducer().new Context(context){
    private int processedRecords=0;
    private long nextTimeToReportMetrics=0L;
    @Override public boolean nextKeyValue() throws IOException, InterruptedException {
      boolean result=super.nextKey();
      if (++processedRecords > flushFreq) {
        try {
          LOG.trace("String_Node_Str");
          basicMapReduceContext.flushOperations();
        }
 catch (        Exception e) {
          LOG.error("String_Node_Str",e);
          throw Throwables.propagate(e);
        }
        processedRecords=0;
      }
      if (System.currentTimeMillis() >= nextTimeToReportMetrics) {
        metricsWriter.reportMetrics();
        nextTimeToReportMetrics=System.currentTimeMillis() + reportIntervalInMillis;
      }
      return result;
    }
  }
;
  return flushingContext;
}
Program: 4661
Project: 4661
Buggy source:
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  boolean result=super.nextKey();
  if (++processedRecords > flushFreq) {
    try {
      LOG.trace("String_Node_Str");
      basicMapReduceContext.flushOperations();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
      throw Throwables.propagate(e);
    }
    processedRecords=0;
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  boolean result=super.nextKey();
  if (++processedRecords > flushFreq) {
    try {
      LOG.trace("String_Node_Str");
      basicMapReduceContext.flushOperations();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
      throw Throwables.propagate(e);
    }
    processedRecords=0;
  }
  if (System.currentTimeMillis() >= nextTimeToReportMetrics) {
    metricsWriter.reportMetrics();
    nextTimeToReportMetrics=System.currentTimeMillis() + reportIntervalInMillis;
  }
  return result;
}
Program: 4663
Project: 4663
Buggy source:
@Inject public DistributedSchedulerService(TimeScheduler timeScheduler,StreamSizeScheduler streamSizeScheduler,Store store){
  super(timeScheduler,streamSizeScheduler,store);
  this.serviceDelegate=new RetryOnStartFailureService(new Supplier<Service>(){
    @Override public Service get(){
      return new AbstractService(){
        @Override protected void doStart(){
          try {
            startSchedulers();
            notifyStarted();
          }
 catch (          ServiceUnavailableException e) {
            LOG.debug("String_Node_Str",e.getMessage());
            notifyFailed(e);
          }
catch (          SchedulerException e) {
            LOG.warn("String_Node_Str",e);
            notifyFailed(e);
          }
        }
        @Override protected void doStop(){
          try {
            stopScheduler();
            notifyStopped();
          }
 catch (          SchedulerException e) {
            notifyFailed(e);
          }
        }
      }
;
    }
  }
,RetryStrategies.exponentialDelay(200,5000,TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
@Inject public DistributedSchedulerService(TimeScheduler timeScheduler,StreamSizeScheduler streamSizeScheduler,Store store){
  super(timeScheduler,streamSizeScheduler,store);
  this.startUpLatch=new CountDownLatch(1);
  this.serviceDelegate=new RetryOnStartFailureService(new Supplier<Service>(){
    @Override public Service get(){
      return new AbstractService(){
        @Override protected void doStart(){
          try {
            startSchedulers();
            notifyStarted();
            startUpLatch.countDown();
          }
 catch (          ServiceUnavailableException e) {
            LOG.debug("String_Node_Str",e.getMessage());
            notifyFailed(e);
          }
catch (          SchedulerException e) {
            LOG.warn("String_Node_Str",e);
            notifyFailed(e);
          }
        }
        @Override protected void doStop(){
          try {
            stopScheduler();
            notifyStopped();
          }
 catch (          SchedulerException e) {
            notifyFailed(e);
          }
        }
      }
;
    }
  }
,RetryStrategies.exponentialDelay(200,5000,TimeUnit.MILLISECONDS));
}
Program: 4664
Project: 4664
Buggy source:
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  serviceDelegate.startAndWait();
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  serviceDelegate.startAndWait();
  startUpLatch.await();
}
Program: 4665
Project: 4665
Buggy source:
@Override public Service get(){
  return new AbstractService(){
    @Override protected void doStart(){
      try {
        startSchedulers();
        notifyStarted();
      }
 catch (      ServiceUnavailableException e) {
        LOG.debug("String_Node_Str",e.getMessage());
        notifyFailed(e);
      }
catch (      SchedulerException e) {
        LOG.warn("String_Node_Str",e);
        notifyFailed(e);
      }
    }
    @Override protected void doStop(){
      try {
        stopScheduler();
        notifyStopped();
      }
 catch (      SchedulerException e) {
        notifyFailed(e);
      }
    }
  }
;
}

Fixed version (ground truth):
@Override public Service get(){
  return new AbstractService(){
    @Override protected void doStart(){
      try {
        startSchedulers();
        notifyStarted();
        startUpLatch.countDown();
      }
 catch (      ServiceUnavailableException e) {
        LOG.debug("String_Node_Str",e.getMessage());
        notifyFailed(e);
      }
catch (      SchedulerException e) {
        LOG.warn("String_Node_Str",e);
        notifyFailed(e);
      }
    }
    @Override protected void doStop(){
      try {
        stopScheduler();
        notifyStopped();
      }
 catch (      SchedulerException e) {
        notifyFailed(e);
      }
    }
  }
;
}
Program: 4666
Project: 4666
Buggy source:
@Override protected void doStart(){
  try {
    startSchedulers();
    notifyStarted();
  }
 catch (  ServiceUnavailableException e) {
    LOG.debug("String_Node_Str",e.getMessage());
    notifyFailed(e);
  }
catch (  SchedulerException e) {
    LOG.warn("String_Node_Str",e);
    notifyFailed(e);
  }
}

Fixed version (ground truth):
@Override protected void doStart(){
  try {
    startSchedulers();
    notifyStarted();
    startUpLatch.countDown();
  }
 catch (  ServiceUnavailableException e) {
    LOG.debug("String_Node_Str",e.getMessage());
    notifyFailed(e);
  }
catch (  SchedulerException e) {
    LOG.warn("String_Node_Str",e);
    notifyFailed(e);
  }
}
Program: 4667
Project: 4667
Buggy source:
@BeforeClass public static void beforeClass() throws Exception {
  cConf=CConfiguration.create();
  hBaseTableUtil=new HBaseTableUtilFactory(cConf,new SimpleNamespaceQueryAdmin()).get();
  ddlExecutor=new HBaseDDLExecutorFactory(cConf,TEST_HBASE.getConfiguration()).get();
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NamespaceId.SYSTEM));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE1));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE2));
  ConfigurationWriter writer=new ConfigurationWriter(TEST_HBASE.getConfiguration(),cConf);
  writer.write(ConfigurationReader.Type.DEFAULT,cConf);
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws Exception {
  cConf=CConfiguration.create();
  hBaseTableUtil=new HBaseTableUtilFactory(cConf,new SimpleNamespaceQueryAdmin()).get();
  ddlExecutor=new HBaseDDLExecutorFactory(cConf,TEST_HBASE.getConfiguration()).get();
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE1));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE2));
}