nus-yam/ex-repair huggingface dataset:
Program: 15456
Project: 15456
Buggy source:
protected AsyncRequest(final TwiceChecked<Q,R> cb){
  super();
  this.response=new AsyncResponseFuture<R>();
  this.handler=new AsyncRequestHandler<Q,R>(this.response);
  this.callbackSequence=new CallbackListenerSequence<R>();
  this.callback=new TwiceChecked<Q,R>(){
    @Override public void fireException(    Throwable t){
      try {
        cb.fireException(t);
      }
 catch (      Throwable ex) {
        LOG.error(ex,ex);
      }
      try {
        AsyncRequest.this.callbackSequence.fireException(t);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
    @Override public void fire(    R r){
      try {
        if (Logs.EXTREME) {
          LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
        }
        cb.fire(r);
        try {
          AsyncRequest.this.callbackSequence.fire(r);
        }
 catch (        Throwable ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      RuntimeException ex) {
        LOG.error(ex,ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
catch (      Exception ex) {
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
    }
    @Override public void initialize(    Q request) throws Exception {
      if (Logs.EXTREME) {
        LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + request);
      }
    }
  }
;
  Callbacks.addListenerHandler(response,this.callback);
}

Fixed version (ground truth):
protected AsyncRequest(final TwiceChecked<Q,R> cb){
  super();
  this.result=new AsyncResponseFuture<R>();
  this.requestResult=new AsyncResponseFuture<R>();
  this.handler=new AsyncRequestHandler<Q,R>(this.requestResult);
  this.callbackSequence=new CallbackListenerSequence<R>();
  this.callback=new TwiceChecked<Q,R>(){
    @Override public void fireException(    Throwable t){
      try {
        cb.fireException(t);
      }
 catch (      Throwable ex) {
        AsyncRequest.this.result.setException(ex);
        LOG.error(ex,ex);
      }
      try {
        AsyncRequest.this.callbackSequence.fireException(t);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
    @Override public void fire(    R r){
      try {
        if (Logs.EXTREME) {
          LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
        }
        cb.fire(r);
        try {
          AsyncRequest.this.result.set(r);
          AsyncRequest.this.callbackSequence.fire(r);
        }
 catch (        Throwable ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      RuntimeException ex) {
        LOG.error(ex,ex);
        AsyncRequest.this.result.setException(ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
catch (      Exception ex) {
        AsyncRequest.this.result.setException(ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
    }
    @Override public void initialize(    Q request) throws Exception {
      if (Logs.EXTREME) {
        LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + request);
      }
    }
  }
;
  Callbacks.addListenerHandler(requestResult,this.callback);
}
Program: 15457
Project: 15457
Buggy source:
/** 
 * @see com.eucalyptus.util.async.Request#getResponse()
 * @return
 */
@Override public CheckedListenableFuture<R> getResponse(){
  return this.response;
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.async.Request#getResponse()
 * @return
 */
@Override public CheckedListenableFuture<R> getResponse(){
  return this.result;
}
Program: 15459
Project: 15459
Buggy source:
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    try {
      AsyncRequest.this.result.set(r);
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}
Program: 15460
Project: 15460
Buggy source:
@Override public void fireException(Throwable t){
  try {
    cb.fireException(t);
  }
 catch (  Throwable ex) {
    LOG.error(ex,ex);
  }
  try {
    AsyncRequest.this.callbackSequence.fireException(t);
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void fireException(Throwable t){
  try {
    cb.fireException(t);
  }
 catch (  Throwable ex) {
    AsyncRequest.this.result.setException(ex);
    LOG.error(ex,ex);
  }
  try {
    AsyncRequest.this.callbackSequence.fireException(t);
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}
Program: 15461
Project: 15461
Buggy source:
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      res.get();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
          try {
            T res2=secondCall.call();
            resultFuture.set(res2.get());
          }
 catch (          Exception ex) {
            resultFuture.setException(ex);
          }
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
          resultFuture.setException(ex);
        }
catch (        ExecutionException ex) {
          resultFuture.setException(ex.getCause());
        }
catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}

Fixed version (ground truth):
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
          try {
            T res2=secondCall.call();
            resultFuture.set(res2.get());
          }
 catch (          Exception ex) {
            resultFuture.setException(ex);
          }
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
          resultFuture.setException(ex);
        }
catch (        ExecutionException ex) {
          resultFuture.setException(ex.getCause());
        }
catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}
Program: 15463
Project: 15463
Buggy source:
public void fireException(Throwable t){
  this.teardown();
  AtomicMarkedState.this.error();
}

Fixed version (ground truth):
public void fireException(Throwable t){
  this.transitionFuture.setException(t);
  this.teardown();
  AtomicMarkedState.this.error();
}
Program: 15464
Project: 15464
Buggy source:
protected AsyncRequest(final TwiceChecked<Q,R> cb){
  super();
  this.response=new AsyncResponseFuture<R>();
  this.handler=new AsyncRequestHandler<Q,R>(this.response);
  this.callbackSequence=new CallbackListenerSequence<R>();
  this.callback=new TwiceChecked<Q,R>(){
    @Override public void fireException(    Throwable t){
      try {
        cb.fireException(t);
      }
 catch (      Throwable ex) {
        LOG.error(ex,ex);
      }
      try {
        AsyncRequest.this.callbackSequence.fireException(t);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
    @Override public void fire(    R r){
      try {
        if (Logs.EXTREME) {
          LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
        }
        cb.fire(r);
        try {
          AsyncRequest.this.callbackSequence.fire(r);
        }
 catch (        Throwable ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      RuntimeException ex) {
        LOG.error(ex,ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
catch (      Exception ex) {
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
    }
    @Override public void initialize(    Q request) throws Exception {
      if (Logs.EXTREME) {
        LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + request);
      }
    }
  }
;
  Callbacks.addListenerHandler(response,this.callback);
}

Fixed version (ground truth):
protected AsyncRequest(final TwiceChecked<Q,R> cb){
  super();
  this.response=new AsyncResponseFuture<R>();
  this.handler=new AsyncRequestHandler<Q,R>(this.response);
  this.callbackSequence=new CallbackListenerSequence<R>();
  this.callback=new TwiceChecked<Q,R>(){
    @Override public void fireException(    Throwable t){
      try {
        cb.fireException(t);
      }
 catch (      Throwable ex) {
        LOG.error(ex,ex);
      }
      try {
        AsyncRequest.this.callbackSequence.fireException(t);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
    @Override public void fire(    R r){
      try {
        if (Logs.EXTREME) {
          LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
        }
        cb.fire(r);
        try {
          AsyncRequest.this.callbackSequence.fire(r);
        }
 catch (        Throwable ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      RuntimeException ex) {
        LOG.error(ex,ex);
        this.fireException(ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
catch (      Exception ex) {
        this.fireException(ex);
        AsyncRequest.this.callbackSequence.fireException(ex);
      }
    }
    @Override public void initialize(    Q request) throws Exception {
      if (Logs.EXTREME) {
        LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + request);
      }
    }
  }
;
  Callbacks.addListenerHandler(response,this.callback);
}
Program: 15465
Project: 15465
Buggy source:
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      LOG.debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    this.fireException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    this.fireException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}
Program: 15466
Project: 15466
Buggy source:
@Override public void run(){
  R reply=null;
  try {
    reply=this.future.get();
    if (reply == null) {
      this.LOG.warn("String_Node_Str" + this.getClass().getSimpleName());
      Exceptions.eat("String_Node_Str" + reply);
    }
    try {
      this.LOG.trace(EventRecord.here(this.getClass(),EventType.CALLBACK,"String_Node_Str" + reply.getClass().getSimpleName() + "String_Node_Str").toString());
      this.callback.fire(reply);
    }
 catch (    final Throwable ex) {
      this.LOG.error(EventRecord.here(this.getClass(),EventType.CALLBACK,"String_Node_Str","String_Node_Str" + reply.getClass().getSimpleName() + "String_Node_Str",ex.getMessage()).toString());
      this.doFail(ex);
    }
  }
 catch (  final Throwable e) {
    this.LOG.error(EventRecord.here(this.getClass(),EventType.FUTURE,"String_Node_Str","String_Node_Str",e.getMessage()).toString());
    this.doFail(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  R reply=null;
  try {
    reply=this.future.get();
    if (reply == null) {
      this.LOG.warn("String_Node_Str" + this.getClass().getSimpleName());
      Exceptions.eat("String_Node_Str" + reply);
    }
    try {
      this.LOG.trace(EventRecord.here(this.getClass(),EventType.CALLBACK,"String_Node_Str" + reply.getClass().getSimpleName() + "String_Node_Str").toString());
      this.callback.fire(reply);
    }
 catch (    final Throwable ex) {
      this.LOG.error(EventRecord.here(this.getClass(),EventType.CALLBACK,"String_Node_Str","String_Node_Str" + reply.getClass().getSimpleName() + "String_Node_Str",ex.getMessage()).toString());
      this.doFail(ex);
      throw new UndeclaredThrowableException(ex);
    }
  }
 catch (  final Throwable e) {
    this.LOG.error(EventRecord.here(this.getClass(),EventType.FUTURE,"String_Node_Str","String_Node_Str",e.getMessage()).toString());
    this.doFail(e);
    throw new UndeclaredThrowableException(e);
  }
}
Program: 15468
Project: 15468
Buggy source:
@Override public void run(){
  try {
    if (BasicService.this.stateMachine.getState().ordinal() > State.NOTREADY.ordinal()) {
      BasicService.this.stateMachine.transition(BasicService.this.stateMachine.getState()).get();
    }
 else     if (State.NOTREADY.isIn(BasicService.this.getServiceConfiguration())) {
      BasicService.this.stateMachine.transition(State.DISABLED).get();
    }
  }
 catch (  Throwable ex) {
    LOG.debug("String_Node_Str" + ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (Component.State.ENABLED.equals(config.lookupService().getGoal()) && Component.State.DISABLED.isIn(config)) {
      config.lookupComponent().enableTransition(config);
    }
 else     if (Component.State.DISABLED.equals(config.lookupService().getGoal()) && Component.State.ENABLED.isIn(config)) {
      config.lookupComponent().disableTransition(config);
    }
 else     if (BasicService.this.stateMachine.getState().ordinal() > State.NOTREADY.ordinal()) {
      BasicService.this.stateMachine.transition(BasicService.this.stateMachine.getState()).get();
    }
 else     if (State.NOTREADY.isIn(BasicService.this.getServiceConfiguration())) {
      BasicService.this.stateMachine.transition(State.DISABLED).get();
    }
 else     if (State.NOTREADY.isIn(BasicService.this.getServiceConfiguration())) {
      BasicService.this.stateMachine.transition(State.DISABLED).get();
    }
  }
 catch (  Throwable ex) {
    LOG.debug("String_Node_Str" + ex);
    BasicService.this.getServiceConfiguration().info(ex);
  }
}
Program: 15469
Project: 15469
Buggy source:
public void destroyTransition(final ServiceConfiguration configuration) throws ServiceRegistrationException {
  try {
    Service service=null;
    if (this.serviceRegistry.hasService(configuration)) {
      service=this.serviceRegistry.lookup(configuration);
    }
    try {
      ServiceTransitions.destroyTransitionChain(configuration).get();
    }
 catch (    ExecutionException ex1) {
      configuration.error(ex1);
    }
catch (    InterruptedException ex1) {
      configuration.error(ex1);
    }
    try {
      EventRecord.caller(Component.class,EventType.COMPONENT_SERVICE_DESTROY,this.getName(),configuration.getFullName(),configuration.getUri().toString()).info();
      this.serviceRegistry.deregister(configuration);
    }
 catch (    Throwable ex) {
      throw new ServiceRegistrationException("String_Node_Str" + configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw new ServiceRegistrationException("String_Node_Str" + configuration,ex);
  }
}

Fixed version (ground truth):
public void destroyTransition(final ServiceConfiguration configuration) throws ServiceRegistrationException {
  try {
    Service service=null;
    if (this.serviceRegistry.hasService(configuration)) {
      service=this.serviceRegistry.lookup(configuration);
    }
    try {
      ServiceTransitions.destroyTransitionChain(configuration).get();
    }
 catch (    ExecutionException ex1) {
      LOG.error(ex1);
    }
catch (    InterruptedException ex1) {
      LOG.error(ex1);
    }
    try {
      EventRecord.caller(Component.class,EventType.COMPONENT_SERVICE_DESTROY,this.getName(),configuration.getFullName(),configuration.getUri().toString()).info();
      this.serviceRegistry.deregister(configuration);
    }
 catch (    Throwable ex) {
      throw new ServiceRegistrationException("String_Node_Str" + configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw new ServiceRegistrationException("String_Node_Str" + configuration,ex);
  }
}
Program: 15470
Project: 15470
Buggy source:
public static void checkPreconditions() throws EucalyptusCloudException, ExecutionException {
  String returnValue;
  returnValue=SystemUtil.run(new String[]{WalrusProperties.eucaHome + WalrusProperties.EUCA_ROOT_WRAPPER,"String_Node_Str","String_Node_Str"});
  if (returnValue.length() == 0) {
    Components.lookup(Walrus.class).getLocalServiceConfiguration().error(new EucalyptusCloudException("String_Node_Str"));
  }
}

Fixed version (ground truth):
public static void checkPreconditions() throws EucalyptusCloudException, ExecutionException {
  String returnValue;
  returnValue=SystemUtil.run(new String[]{WalrusProperties.eucaHome + WalrusProperties.EUCA_ROOT_WRAPPER,"String_Node_Str","String_Node_Str"});
  if (returnValue.length() == 0) {
    Components.lookup(Walrus.class).getLocalServiceConfiguration().info(new EucalyptusCloudException("String_Node_Str"));
  }
}
Program: 15471
Project: 15471
Buggy source:
private UserFullName(User user) throws AuthException {
  super(user.getAccount(),"String_Node_Str",user.getName());
  this.userId=user.getUserId();
  this.userName=user.getName();
}

Fixed version (ground truth):
private UserFullName(User user) throws AuthException {
  super(Accounts.lookupAccountFullNameByUserId(user.getUserId()),"String_Node_Str",user.getName());
  this.userId=user.getUserId();
  this.userName=user.getName();
}
Program: 15472
Project: 15472
Buggy source:
/** 
 * Builds a Service instance for this component using the provided service configuration.
 * @return Service instance of the service
 * @throws ServiceRegistrationException
 */
public CheckedListenableFuture<ServiceConfiguration> loadService(final ServiceConfiguration config) throws ServiceRegistrationException {
  this.lookupRegisteredService(config);
  if (State.INITIALIZED.isIn(config)) {
    try {
      return config.lookupStateMachine().transitionByName(Transition.LOADING);
    }
 catch (    Throwable ex) {
      throw new ServiceRegistrationException("String_Node_Str" + config + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
 else   if (State.LOADED.isIn(config)) {
    return Futures.predestinedFuture(config);
  }
 else {
    return Futures.predestinedFuture(config);
  }
}

Fixed version (ground truth):
/** 
 * Builds a Service instance for this component using the provided service configuration.
 * @return Service instance of the service
 * @throws ServiceRegistrationException
 */
public CheckedListenableFuture<ServiceConfiguration> loadService(final ServiceConfiguration config) throws ServiceRegistrationException {
  this.lookupRegisteredService(config);
  if (State.INITIALIZED.isIn(config)) {
    try {
      config.lookupStateMachine().transitionByName(Transition.LOADING).get();
    }
 catch (    Throwable ex) {
      throw new ServiceRegistrationException("String_Node_Str" + config + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
  if (State.LOADED.isIn(config)) {
    return Futures.predestinedFuture(config);
  }
 else {
    return Futures.predestinedFuture(config);
  }
}
Program: 15473
Project: 15473
Buggy source:
private void getLoginUserProfile(){
  this.clientFactory.getBackendService().getLoginUserProfile(this.clientFactory.getLocalSession().getSession(),new AsyncCallback<LoginUserProfile>(){
    @Override public void onFailure(    Throwable caught){
      LOG.log(Level.WARNING,"String_Node_Str" + caught);
      clientFactory.getLifecyclePlaceController().goTo(new LoginPlace(LoginPlace.DEFAULT_PROMPT));
    }
    @Override public void onSuccess(    LoginUserProfile result){
      if (result == null) {
        LOG.log(Level.WARNING,"String_Node_Str");
        clientFactory.getLifecyclePlaceController().goTo(new LoginPlace(LoginPlace.LOADING_FAILURE_PROMPT));
      }
 else {
        clientFactory.getSessionData().setLoginUser(result);
        clientFactory.getLoadingProgressView().setProgress(33);
        getSystemProperties();
      }
    }
  }
);
}

Fixed version (ground truth):
private void getLoginUserProfile(){
  this.clientFactory.getBackendService().getLoginUserProfile(this.clientFactory.getLocalSession().getSession(),new AsyncCallback<LoginUserProfile>(){
    @Override public void onFailure(    Throwable caught){
      LOG.log(Level.WARNING,"String_Node_Str" + caught);
      if (EucalyptusServiceException.INVALID_SESSION.equals(caught.getMessage())) {
        clientFactory.getLocalSession().clearSession();
      }
      clientFactory.getLifecyclePlaceController().goTo(new LoginPlace(LoginPlace.DEFAULT_PROMPT));
    }
    @Override public void onSuccess(    LoginUserProfile result){
      if (result == null) {
        LOG.log(Level.WARNING,"String_Node_Str");
        clientFactory.getLifecyclePlaceController().goTo(new LoginPlace(LoginPlace.LOADING_FAILURE_PROMPT));
      }
 else {
        clientFactory.getSessionData().setLoginUser(result);
        clientFactory.getLoadingProgressView().setProgress(33);
        getSystemProperties();
      }
    }
  }
);
}
Program: 15474
Project: 15474
Buggy source:
private static SystemConfiguration validateSystemConfiguration(SystemConfiguration s){
  SystemConfiguration sysConf=s != null ? s : new SystemConfiguration();
  if (sysConf.getRegistrationId() == null) {
    sysConf.setRegistrationId(UUID.randomUUID().toString());
  }
  if (sysConf.getCloudHost() == null) {
    String ipAddr=SystemConfiguration.getInternalIpAddress();
    sysConf.setCloudHost(ipAddr);
  }
  if (sysConf.getDefaultKernel() == null) {
    sysConf.setDefaultRamdisk(ForwardImages.defaultKernel());
  }
  if (sysConf.getDefaultRamdisk() == null) {
    sysConf.setDefaultRamdisk(ForwardImages.defaultRamdisk());
  }
  if (sysConf.getDnsDomain() == null) {
    sysConf.setDnsDomain(DNSProperties.DOMAIN);
  }
  if (sysConf.getNameserver() == null) {
    sysConf.setNameserver(DNSProperties.NS_HOST);
  }
  if (sysConf.getNameserverAddress() == null) {
    sysConf.setNameserverAddress(DNSProperties.NS_IP);
  }
  if (sysConf.getMaxUserPublicAddresses() == null) {
    sysConf.setMaxUserPublicAddresses(5);
  }
  if (sysConf.isDoDynamicPublicAddresses() == null) {
    sysConf.setDoDynamicPublicAddresses(true);
  }
  if (sysConf.getSystemReservedPublicAddresses() == null) {
    sysConf.setSystemReservedPublicAddresses(10);
  }
  return sysConf;
}

Fixed version (ground truth):
private static SystemConfiguration validateSystemConfiguration(SystemConfiguration s){
  SystemConfiguration sysConf=s != null ? s : new SystemConfiguration();
  if (sysConf.getRegistrationId() == null) {
    sysConf.setRegistrationId(UUID.randomUUID().toString());
  }
  if (sysConf.getCloudHost() == null) {
    String ipAddr=SystemConfiguration.getInternalIpAddress();
    sysConf.setCloudHost(ipAddr);
  }
  if (sysConf.getDnsDomain() == null) {
    sysConf.setDnsDomain(DNSProperties.DOMAIN);
  }
  if (sysConf.getNameserver() == null) {
    sysConf.setNameserver(DNSProperties.NS_HOST);
  }
  if (sysConf.getNameserverAddress() == null) {
    sysConf.setNameserverAddress(DNSProperties.NS_IP);
  }
  if (sysConf.getMaxUserPublicAddresses() == null) {
    sysConf.setMaxUserPublicAddresses(5);
  }
  if (sysConf.isDoDynamicPublicAddresses() == null) {
    sysConf.setDoDynamicPublicAddresses(true);
  }
  if (sysConf.getSystemReservedPublicAddresses() == null) {
    sysConf.setSystemReservedPublicAddresses(10);
  }
  return sysConf;
}
Program: 15475
Project: 15475
Buggy source:
public DescribeRegionsResponseType DescribeRegions(DescribeRegionsType request){
  DescribeRegionsResponseType reply=(DescribeRegionsResponseType)request.getReply();
  SystemConfiguration config=SystemConfiguration.getSystemConfiguration();
  reply.getRegionInfo().add(new RegionInfoType("String_Node_Str",SystemConfiguration.getCloudUrl()));
  try {
    Component walrus=Components.lookup(Walrus.class);
    NavigableSet<ServiceConfiguration> configs=walrus.lookupServiceConfigurations();
    if (!configs.isEmpty() && Component.State.ENABLED.isIn(configs.first())) {
      reply.getRegionInfo().add(new RegionInfoType(walrus.getComponentId().name(),configs.first().getUri().toASCIIString()));
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
  return reply;
}

Fixed version (ground truth):
public DescribeRegionsResponseType DescribeRegions(DescribeRegionsType request){
  DescribeRegionsResponseType reply=(DescribeRegionsResponseType)request.getReply();
  SystemConfiguration config=SystemConfiguration.getSystemConfiguration();
  reply.getRegionInfo().add(new RegionInfoType("String_Node_Str",Internets.localhostAddress().getCanonicalHostName()));
  try {
    Component walrus=Components.lookup(Walrus.class);
    NavigableSet<ServiceConfiguration> configs=walrus.lookupServiceConfigurations();
    if (!configs.isEmpty() && Component.State.ENABLED.isIn(configs.first())) {
      reply.getRegionInfo().add(new RegionInfoType(walrus.getComponentId().name(),configs.first().getUri().toASCIIString()));
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
  return reply;
}
Program: 15477
Project: 15477
Buggy source:
@Override public void run(){
  try {
    if (BasicService.this.stateMachine.getState().ordinal() > State.STOPPED.ordinal()) {
      BasicService.this.stateMachine.transition(BasicService.this.stateMachine.getState());
    }
  }
 catch (  Throwable ex) {
    LOG.debug("String_Node_Str" + ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (BasicService.this.stateMachine.getState().ordinal() > State.NOTREADY.ordinal()) {
      BasicService.this.stateMachine.transition(BasicService.this.stateMachine.getState());
    }
 else     if (State.NOTREADY.isIn(BasicService.this.getServiceConfiguration())) {
      BasicService.this.stateMachine.transition(State.DISABLED);
    }
  }
 catch (  Throwable ex) {
    LOG.debug("String_Node_Str" + ex);
  }
}
Program: 15478
Project: 15478
Buggy source:
public String toString(){
  StringBuilder sb=new StringBuilder();
  sb.append(EventType.TRANSITION).append(this.name).append("String_Node_Str").append(this.transition != null ? this.transition.toString() : "String_Node_Str").append("String_Node_Str").append(this.id).append("String_Node_Str").append(new Date(this.startTime));
  Logs.exhaust().info(sb.toString());
  Logs.exhaust().info(Exceptions.string(this.startStackTrace));
  return sb.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuilder sb=new StringBuilder();
  sb.append(EventType.TRANSITION).append("String_Node_Str").append(this.name).append("String_Node_Str").append(this.transition != null ? this.transition.toString() : "String_Node_Str").append("String_Node_Str").append(this.id).append("String_Node_Str").append(new Date(this.startTime));
  Logs.exhaust().info(sb.toString());
  Logs.exhaust().info(Exceptions.string(this.startStackTrace));
  return sb.toString();
}
Program: 15479
Project: 15479
Buggy source:
@Override public String toString(){
  String actionName="String_Node_Str";
  if (this.action != null) {
    actionName=this.action.getClass().getName().replaceAll("String_Node_Str","String_Node_Str");
  }
  return String.format("String_Node_Str",this.getName(),this.getFromState(),this.getFromStateMark(),this.getToState(),this.getToStateMark(),"String_Node_Str" + this.action);
}

Fixed version (ground truth):
@Override public String toString(){
  String actionName="String_Node_Str";
  if (this.action != null) {
    actionName=this.action.getClass().getName().replaceAll("String_Node_Str","String_Node_Str");
  }
  return String.format("String_Node_Str",this.getName(),this.getFromState(),this.getFromStateMark(),this.getToState(),this.getToStateMark(),this.getErrorState(),"String_Node_Str" + this.action);
}
Program: 15480
Project: 15480
Buggy source:
public void stop(){
  this.running.set(false);
  this.workers.shutdownNow();
}

Fixed version (ground truth):
public void stop(){
  this.running.set(false);
}
Program: 15481
Project: 15481
Buggy source:
public List<Runnable> free(){
  execServices.remove(this.getName());
  List<Runnable> ret=Lists.newArrayList();
  for (  final Runnable r : (ret=this.pool.shutdownNow())) {
    LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str"+ r.getClass()+ "String_Node_Str"+ r.toString()+ "String_Node_Str");
  }
  try {
    while (!this.pool.awaitTermination(1,TimeUnit.SECONDS)) {
      LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str");
      if (this.pool instanceof ThreadPoolExecutor) {
        final ThreadPoolExecutor tpe=(ThreadPoolExecutor)this.pool;
        for (        final Runnable r : tpe.getQueue().toArray(EMPTY)) {
          LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str"+ r.getClass());
        }
      }
    }
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
    LOG.error(e,e);
  }
  return ret;
}

Fixed version (ground truth):
public List<Runnable> free(){
  List<Runnable> ret=Lists.newArrayList();
  for (  final Runnable r : (ret=this.pool.shutdownNow())) {
    LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str"+ r.getClass()+ "String_Node_Str"+ r.toString()+ "String_Node_Str");
  }
  try {
    while (!this.pool.awaitTermination(1,TimeUnit.SECONDS)) {
      LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str");
      if (this.pool instanceof ThreadPoolExecutor) {
        final ThreadPoolExecutor tpe=(ThreadPoolExecutor)this.pool;
        for (        final Runnable r : tpe.getQueue().toArray(EMPTY)) {
          LOG.warn("String_Node_Str" + ThreadPool.this.name + "String_Node_Str"+ r.getClass());
        }
      }
    }
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
    LOG.error(e,e);
  }
  return ret;
}
Program: 15484
Project: 15484
Buggy source:
public static Cluster lookup(ServiceConfiguration clusterConfig){
  return Clusters.getInstance().lookup(clusterConfig.getName());
}

Fixed version (ground truth):
public static Cluster lookup(ServiceConfiguration clusterConfig){
  try {
    return Clusters.getInstance().lookup(clusterConfig.getName());
  }
 catch (  NoSuchElementException ex) {
    return Clusters.getInstance().lookupDisabled(clusterConfig.getName());
  }
}
Program: 15485
Project: 15485
Buggy source:
boolean doesMatch(String[] otherFields,double errorMargin){
  if (!(fields.length == otherFields.length))   return false;
  for (int i=0; i < fields.length; i++) {
    if (i == doublePlusFieldInd)     continue;
    if (fields[i].trim().length() == 0)     continue;
    if (!fieldMatches(fields[i],otherFields[i],errorMargin))     if (debug)     System.out.printf("String_Node_Str",i,fields[i],otherFields[i]);
    return false;
  }
  return true;
}

Fixed version (ground truth):
boolean doesMatch(String[] otherFields,double errorMargin){
  if (!(fields.length == otherFields.length)) {
    if (debug)     System.err.printf("String_Node_Str",fields.length,otherFields.length);
    return false;
  }
  for (int i=0; i < fields.length; i++) {
    if (i == doublePlusFieldInd)     continue;
    if (fields[i].trim().length() == 0)     continue;
    if (!fieldMatches(fields[i],otherFields[i],errorMargin)) {
      if (debug)       System.err.printf("String_Node_Str",i,fields[i],otherFields[i]);
      return false;
    }
  }
  return true;
}
Program: 15486
Project: 15486
Buggy source:
private static boolean isWithinError(double val,double correctVal,double errorPercent){
  return correctVal * (1 - errorPercent) < val && val < correctVal * (1 + errorPercent);
}

Fixed version (ground truth):
private static boolean isWithinError(double val,double correctVal,double errorPercent){
  if (val == correctVal) {
    return true;
  }
 else {
    return correctVal * (1 - errorPercent) < val && val < correctVal * (1 + errorPercent);
  }
}
Program: 15487
Project: 15487
Buggy source:
ReferenceLine(int doublePlusFieldInd,String[] fields,boolean debug){
  this.doublePlusFieldInd=doublePlusFieldInd;
  this.fields=fields;
  this.debug=debug;
}

Fixed version (ground truth):
ReferenceLine(int doublePlusFieldInd,String[] fields){
  this.doublePlusFieldInd=doublePlusFieldInd;
  this.fields=fields;
}
Program: 15489
Project: 15489
Buggy source:
@Override public void fireEvent(Event event){
  if (!Bootstrap.isFinished()) {
    LOG.info(this.getConfiguration().toString() + "String_Node_Str");
  }
 else   if (event instanceof Hertz) {
    Hertz tick=(Hertz)event;
    boolean mod10=tick.isAsserted(10l);
    boolean mod3=tick.isAsserted(3l);
    if (mod10 && State.ENABLED.equals(this.stateMachine.getState())) {
      this.nextState();
    }
 else     if (mod3 && State.ENABLED.ordinal() < this.stateMachine.getState().ordinal()) {
      this.updateVolatiles();
    }
  }
 else   if (event instanceof LifecycleEvent) {
    LifecycleEvent lifecycleEvent=(LifecycleEvent)event;
    if (this.configuration.equals(lifecycleEvent.getReference())) {
      LOG.info(event);
    }
  }
}

Fixed version (ground truth):
@Override public void fireEvent(Event event){
  if (!Bootstrap.isFinished()) {
    LOG.info(this.getConfiguration().getFullName() + "String_Node_Str");
  }
 else   if (event instanceof Hertz) {
    this.fireClockTick((Hertz)event);
  }
 else   if (event instanceof LifecycleEvent) {
    this.fireLifecycleEvent((LifecycleEvent)event);
  }
}
Program: 15490
Project: 15490
Buggy source:
private void verifyUser(String sessionId){
  SessionInfo session;
  try {
    session=EucalyptusWebBackendImpl.verifySession(sessionId);
    User user=null;
    try {
      user=Accounts.lookupUserById(session.getUserId());
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str");
    }
    if (!user.isSystemAdmin()) {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  SerializableException e1) {
    throw new RuntimeException("String_Node_Str");
  }
  session.setLastAccessed(System.currentTimeMillis());
}

Fixed version (ground truth):
private void verifyUser(String sessionId){
  SessionInfo session;
  try {
    session=EucalyptusWebBackendImpl.verifySession(sessionId);
    User user=null;
    try {
      user=Accounts.lookupUserByName(session.getUserId());
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str");
    }
    if (!user.isSystemAdmin()) {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  SerializableException e1) {
    throw new RuntimeException("String_Node_Str");
  }
  session.setLastAccessed(System.currentTimeMillis());
}
Program: 15491
Project: 15491
Buggy source:
@Override public void leave(ServiceConfiguration parent,Completion transitionCallback){
  if (parent.isLocal() || Internets.testLocal(parent.getHostName())) {
    try {
      if (State.LOADED.ordinal() < parent.lookupComponent().getState().ordinal()) {
        parent.lookupComponent().getBootstrapper().check();
        if (parent.lookupComponent().getLocalService() != null) {
          parent.lookupComponent().getBuilder().fireCheck(parent);
        }
      }
      transitionCallback.fire();
    }
 catch (    Throwable ex) {
      LOG.error("String_Node_Str" + parent.lookupComponent().getName() + "String_Node_Str"+ ex.toString(),ex);
      if (State.ENABLED.equals(parent.lookupService().getState())) {
        try {
          parent.lookupComponent().getBootstrapper().disable();
          if (parent.lookupComponent().hasLocalService()) {
            parent.lookupComponent().getBuilder().fireDisable(parent);
          }
        }
 catch (        ServiceRegistrationException ex1) {
          LOG.error("String_Node_Str" + parent.lookupComponent().getName() + "String_Node_Str"+ ex.toString(),ex);
        }
      }
      transitionCallback.fireException(ex);
      parent.lookupComponent().submitError(ex);
    }
  }
 else {
    transitionCallback.fire();
  }
}

Fixed version (ground truth):
@Override public void leave(ServiceConfiguration parent,Completion transitionCallback){
  if (parent.isLocal() || Internets.testLocal(parent.getHostName())) {
    try {
      if (State.LOADED.ordinal() < parent.lookupComponent().getState().ordinal()) {
        parent.lookupComponent().getBootstrapper().check();
        if (parent.lookupComponent().getLocalService() != null) {
          parent.lookupComponent().getBuilder().fireCheck(parent);
        }
      }
      transitionCallback.fire();
    }
 catch (    Throwable ex) {
      LOG.error("String_Node_Str" + parent.lookupComponent().getName() + "String_Node_Str"+ ex.toString(),ex);
      if (State.ENABLED.equals(parent.lookupService().getState())) {
        try {
          parent.lookupComponent().getBootstrapper().disable();
          if (parent.lookupComponent().hasLocalService()) {
            parent.lookupComponent().getBuilder().fireDisable(parent);
          }
        }
 catch (        Throwable ex1) {
          LOG.error("String_Node_Str" + parent.lookupComponent().getName() + "String_Node_Str"+ ex.toString(),ex);
        }
      }
      transitionCallback.fireException(ex);
      parent.lookupComponent().submitError(ex);
    }
  }
 else {
    transitionCallback.fire();
  }
}
Program: 15492
Project: 15492
Buggy source:
@Override public void fireStop(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  Cluster cluster=Clusters.getInstance().lookup(config.getName());
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_STOPPED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  Cluster clusterInstance=Clusters.getInstance().lookup(config.getName());
  clusterInstance.stop();
  super.fireStop(config);
}

Fixed version (ground truth):
@Override public void fireStop(ServiceConfiguration config) throws ServiceRegistrationException {
  try {
    LOG.info("String_Node_Str" + config);
    Cluster cluster=Clusters.getInstance().lookup(config.getName());
    EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_STOPPED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
    cluster.stop();
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
  super.fireStop(config);
}
Program: 15495
Project: 15495
Buggy source:
public CheckedListenableFuture<ServiceConfiguration> enableTransition(final ServiceConfiguration configuration) throws IllegalStateException {
  final CheckedListenableFuture<ServiceConfiguration> transitionFuture=Futures.newGenericFuture();
  if (!this.hasLocalService()) {
    this.serviceRegistry.register(configuration);
  }
  Callable<ServiceConfiguration> transition=null;
switch (this.getState()) {
case NOTREADY:
case DISABLED:
    transition=makeEnableCallable(configuration,transitionFuture);
  break;
case LOADED:
case STOPPED:
transition=makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture));
break;
case INITIALIZED:
transition=makeLoadCallable(configuration,null,makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture)));
break;
case ENABLED:
transition=noTransition;
transitionFuture.set(this.getLocalService().getServiceConfiguration());
break;
default :
throw new IllegalStateException("String_Node_Str" + this.toString());
}
Threads.lookup(Empyrean.class).submit(transition);
return transitionFuture;
}

Fixed version (ground truth):
public CheckedListenableFuture<ServiceConfiguration> enableTransition(final ServiceConfiguration configuration) throws IllegalStateException {
  final CheckedListenableFuture<ServiceConfiguration> transitionFuture=Futures.newGenericFuture();
  if (!this.hasLocalService()) {
    try {
      this.serviceRegistry.register(configuration).transition(State.INITIALIZED);
    }
 catch (    NoSuchElementException ex) {
      LOG.error(ex,ex);
      throw new RuntimeException(ex.getMessage());
    }
catch (    ExistingTransitionException ex) {
      LOG.error(ex,ex);
      throw new RuntimeException(ex.getMessage());
    }
  }
  Callable<ServiceConfiguration> transition=null;
switch (this.getState()) {
case NOTREADY:
case DISABLED:
    transition=makeEnableCallable(configuration,transitionFuture);
  break;
case LOADED:
case STOPPED:
transition=makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture));
break;
case INITIALIZED:
transition=makeLoadCallable(configuration,null,makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture)));
break;
case ENABLED:
transition=noTransition;
transitionFuture.set(this.getLocalService().getServiceConfiguration());
break;
default :
throw new IllegalStateException("String_Node_Str" + this.toString());
}
Threads.lookup(Empyrean.class).submit(transition);
return transitionFuture;
}
Program: 15496
Project: 15496
Buggy source:
public CheckedListenableFuture<ServiceConfiguration> startTransition(final ServiceConfiguration configuration) throws IllegalStateException {
  final CheckedListenableFuture<ServiceConfiguration> transitionFuture=Futures.newGenericFuture();
  if (!this.hasLocalService()) {
    this.serviceRegistry.register(configuration);
  }
  Callable<ServiceConfiguration> transition=null;
switch (this.getState()) {
case LOADED:
case STOPPED:
    transition=makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture));
  break;
case INITIALIZED:
transition=makeLoadCallable(configuration,null,makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture)));
break;
case DISABLED:
case ENABLED:
case NOTREADY:
transition=noTransition;
transitionFuture.set(this.getLocalService().getServiceConfiguration());
break;
default :
throw new IllegalStateException("String_Node_Str" + this.toString());
}
Threads.lookup(Empyrean.class).submit(transition);
return transitionFuture;
}

Fixed version (ground truth):
public CheckedListenableFuture<ServiceConfiguration> startTransition(final ServiceConfiguration configuration) throws IllegalStateException {
  final CheckedListenableFuture<ServiceConfiguration> transitionFuture=Futures.newGenericFuture();
  if (!this.hasLocalService()) {
    try {
      this.serviceRegistry.register(configuration).transition(State.INITIALIZED);
    }
 catch (    NoSuchElementException ex) {
      LOG.error(ex,ex);
      throw new RuntimeException(ex.getMessage());
    }
catch (    ExistingTransitionException ex) {
      LOG.error(ex,ex);
      throw new RuntimeException(ex.getMessage());
    }
  }
  Callable<ServiceConfiguration> transition=null;
switch (this.getState()) {
case LOADED:
case STOPPED:
    transition=makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture));
  break;
case INITIALIZED:
transition=makeLoadCallable(configuration,null,makeStartCallable(configuration,null,makeEnableCallable(configuration,transitionFuture)));
break;
case DISABLED:
case ENABLED:
case NOTREADY:
transition=noTransition;
transitionFuture.set(this.getLocalService().getServiceConfiguration());
break;
default :
throw new IllegalStateException("String_Node_Str" + this.toString());
}
Threads.lookup(Empyrean.class).submit(transition);
return transitionFuture;
}
Program: 15497
Project: 15497
Buggy source:
private static void startSync(){
  LOG.debug("String_Node_Str");
  timeTillNextSync=lic.getSyncInterval();
  if (!inSync) {
    inSync=true;
    Threads.newThread(new Runnable(){
      @Override public void run(){
        LOG.debug("String_Node_Str");
        sync(lic);
        setSyncCompleted();
        LOG.debug("String_Node_Str");
      }
    }
,LDAP_SYNC_THREAD).start();
  }
}

Fixed version (ground truth):
private static void startSync(){
  LOG.debug("String_Node_Str");
  timeTillNextSync=lic.getSyncInterval();
  if (!getAndSetSync(true)) {
    Threads.newThread(new Runnable(){
      @Override public void run(){
        LOG.debug("String_Node_Str");
        sync(lic);
        getAndSetSync(false);
        LOG.debug("String_Node_Str");
      }
    }
,LDAP_SYNC_THREAD).start();
  }
}
Program: 15498
Project: 15498
Buggy source:
@Override public void run(){
  LOG.debug("String_Node_Str");
  sync(lic);
  setSyncCompleted();
  LOG.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  LOG.debug("String_Node_Str");
  sync(lic);
  getAndSetSync(false);
  LOG.debug("String_Node_Str");
}
Program: 15499
Project: 15499
Buggy source:
private Selection parseSelection(JSONObject obj) throws JSONException {
  Selection selection=new Selection();
  selection.setSearchFilter(JsonUtils.getRequiredByType(String.class,obj,LicSpec.FILTER));
  if (selection.getSearchFilter() == null) {
    throw new JSONException("String_Node_Str");
  }
  selection.getSelected().addAll(JsonUtils.getRequiredArrayByType(String.class,obj,LicSpec.SELECT));
  validateDnSet(selection.getSelected());
  selection.getNotSelected().addAll(JsonUtils.getRequiredArrayByType(String.class,obj,LicSpec.NOT_SELECT));
  validateDnSet(selection.getSelected());
  selection.getSelected().removeAll(selection.getNotSelected());
  return selection;
}

Fixed version (ground truth):
private Selection parseSelection(JSONObject obj) throws JSONException {
  Selection selection=new Selection();
  selection.setSearchFilter(JsonUtils.getRequiredByType(String.class,obj,LicSpec.FILTER));
  if (selection.getSearchFilter() == null) {
    throw new JSONException("String_Node_Str");
  }
  selection.getSelected().addAll(JsonUtils.getArrayByType(String.class,obj,LicSpec.SELECT));
  validateDnSet(selection.getSelected());
  selection.getNotSelected().addAll(JsonUtils.getArrayByType(String.class,obj,LicSpec.NOT_SELECT));
  validateDnSet(selection.getSelected());
  selection.getSelected().removeAll(selection.getNotSelected());
  return selection;
}
Program: 15500
Project: 15500
Buggy source:
@Override protected ServiceConfiguration newInstance(){
  ComponentId compId=this.getComponent().getComponentId();
  return new EphemeralConfiguration(compId,compId.getPartition(),compId.name(),compId.getLocalEndpointUri());
}

Fixed version (ground truth):
@Override protected ServiceConfiguration newInstance(){
  ComponentId compId=this.getComponent().getComponentId();
  return ServiceConfigurations.createEphemeral(compId,compId.getPartition(),compId.name(),compId.getLocalEndpointUri());
}
Program: 15501
Project: 15501
Buggy source:
@Override public FullName getFullName(){
  return FullName.create.vendor("String_Node_Str").region(ComponentIds.lookup(Cluster.class).name()).namespace(this.getCluster()).relativeId("String_Node_Str",this.getName());
}

Fixed version (ground truth):
@Override public FullName getFullName(){
  return FullName.create.vendor("String_Node_Str").region(ComponentIds.lookup(ClusterController.class).name()).namespace(this.getCluster()).relativeId("String_Node_Str",this.getName());
}