nus-yam/ex-repair huggingface dataset:
Program: 93966
Project: 93966
Buggy source:
/** 
 * Whether this reason honors a   {@link Please#isRetry()}. Returns <code>false</code> if   {@link #wasCancelled()} or<code>this</code> is  {@link #ALREADY_CONNECTING_OR_CONNECTED}.
 */
public boolean allowsRetry(){
  return !this.wasCancelled() && this != ALREADY_CONNECTING_OR_CONNECTED;
}

Fixed version (ground truth):
/** 
 * Whether this status honors a   {@link BleNode.ConnectionFailListener.Please#isRetry()}. Returns <code>false</code> if   {@link #wasCancelled()} or<code>this</code> is  {@link #ALREADY_CONNECTING_OR_CONNECTED}.
 */
public boolean allowsRetry(){
  return !this.wasCancelled() && this != ALREADY_CONNECTING_OR_CONNECTED;
}
Program: 93967
Project: 93967
Buggy source:
/** 
 * Returns the number of historical data entries that have been logged for the device's given characteristic within the range provided.
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public int getHistoricalDataCount(final UUID uuid,final EpochTimeRange range){
  if (isNull())   return 0;
  return m_historicalDataMngr.getCount(uuid,EpochTimeRange.denull(range));
}

Fixed version (ground truth):
/** 
 * Returns the number of historical data entries that have been logged for the device's given characteristic within the range provided.
 * @see com.idevicesinc.sweetblue.BleNodeConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleNodeConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public int getHistoricalDataCount(final UUID uuid,final EpochTimeRange range){
  if (isNull())   return 0;
  return m_historicalDataMngr.getCount(uuid,EpochTimeRange.denull(range));
}
Program: 93968
Project: 93968
Buggy source:
/** 
 * Returns <code>true</code> if there is any historical data for the given uuid within the given range.
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public boolean hasHistoricalData(final UUID uuid,final EpochTimeRange range){
  if (isNull())   return false;
  return m_historicalDataMngr.hasHistoricalData(uuid,range);
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if there is any historical data for the given uuid within the given range.
 * @see com.idevicesinc.sweetblue.BleNodeConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleNodeConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public boolean hasHistoricalData(final UUID uuid,final EpochTimeRange range){
  if (isNull())   return false;
  return m_historicalDataMngr.hasHistoricalData(uuid,range);
}
Program: 93969
Project: 93969
Buggy source:
/** 
 * Same as   {@link #addHistoricalData(UUID,byte[],EpochTime)} but for large datasets this is more efficient when writing to disk.
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleDeviceConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public void addHistoricalData(final UUID uuid,final ForEach_Returning<HistoricalData> historicalData){
  if (isNull())   return;
  m_historicalDataMngr.add_multiple(uuid,historicalData);
}

Fixed version (ground truth):
/** 
 * Same as   {@link #addHistoricalData(UUID,byte[],EpochTime)} but for large datasets this is more efficient when writing to disk.
 * @see com.idevicesinc.sweetblue.BleNodeConfig.HistoricalDataLogFilter
 * @see com.idevicesinc.sweetblue.BleNodeConfig.DefaultHistoricalDataLogFilter
 */
@com.idevicesinc.sweetblue.annotations.Advanced public void addHistoricalData(final UUID uuid,final ForEach_Returning<HistoricalData> historicalData){
  if (isNull())   return;
  m_historicalDataMngr.add_multiple(uuid,historicalData);
}
Program: 93970
Project: 93970
Buggy source:
/** 
 * Returns <code>true</code> if the historical data for a given uuid is loaded into memory. Use   {@link com.idevicesinc.sweetblue.BleDevice.HistoricalDataLoadListener}to listen for when the load actually completes. If   {@link #hasHistoricalData(UUID)}returns <code>false</code> then this will also always return <code>false</code>.
 */
@com.idevicesinc.sweetblue.annotations.Advanced public boolean isHistoricalDataLoaded(final UUID uuid){
  return m_historicalDataMngr.isLoaded(uuid);
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if the historical data for a given uuid is loaded into memory. Use   {@link BleNode.HistoricalDataLoadListener}to listen for when the load actually completes. If   {@link #hasHistoricalData(UUID)}returns <code>false</code> then this will also always return <code>false</code>.
 */
@com.idevicesinc.sweetblue.annotations.Advanced public boolean isHistoricalDataLoaded(final UUID uuid){
  return m_historicalDataMngr.isLoaded(uuid);
}
Program: 93971
Project: 93971
Buggy source:
void invokeReadWriteCallback(final ReadWriteListener listener_nullable,final ReadWriteListener.ReadWriteEvent event){
  if (event.wasSuccess() && event.isRead() && event.target() == ReadWriteListener.Target.CHARACTERISTIC) {
    final EpochTime timestamp=new EpochTime();
    final BleDeviceConfig.HistoricalDataLogFilter.Source source=event.type().toHistoricalDataSource();
    m_historicalDataMngr.add_single(event.charUuid(),event.data(),timestamp,source);
  }
  m_txnMngr.onReadWriteResult(event);
  if (listener_nullable != null) {
    listener_nullable.onEvent(event);
  }
  if (m_defaultReadWriteListener != null) {
    m_defaultReadWriteListener.onEvent(event);
  }
  if (getManager() != null && getManager().m_defaultReadWriteListener != null) {
    getManager().m_defaultReadWriteListener.onEvent(event);
  }
  m_txnMngr.onReadWriteResultCallbacksCalled();
}

Fixed version (ground truth):
void invokeReadWriteCallback(final ReadWriteListener listener_nullable,final ReadWriteListener.ReadWriteEvent event){
  if (event.wasSuccess() && event.isRead() && event.target() == ReadWriteListener.Target.CHARACTERISTIC) {
    final EpochTime timestamp=new EpochTime();
    final BleNodeConfig.HistoricalDataLogFilter.Source source=event.type().toHistoricalDataSource();
    m_historicalDataMngr.add_single(event.charUuid(),event.data(),timestamp,source);
  }
  m_txnMngr.onReadWriteResult(event);
  if (listener_nullable != null) {
    listener_nullable.onEvent(event);
  }
  if (m_defaultReadWriteListener != null) {
    m_defaultReadWriteListener.onEvent(event);
  }
  if (getManager() != null && getManager().m_defaultReadWriteListener != null) {
    getManager().m_defaultReadWriteListener.onEvent(event);
  }
  m_txnMngr.onReadWriteResultCallbacksCalled();
}
Program: 93972
Project: 93972
Buggy source:
/** 
 * Returns the discovery listener set with   {@link #setListener_Discovery(com.idevicesinc.sweetblue.BleManager.DiscoveryListener)} or{@link BleManagerConfig#defaultDiscoveryListener}, or <code>null</code> if not set.
 */
public DiscoveryListener getListener_Discovery(){
  return m_discoveryListener;
}

Fixed version (ground truth):
/** 
 * Returns the discovery listener set with   {@link #setListener_Discovery(BleManager.DiscoveryListener)} or{@link BleManagerConfig#defaultDiscoveryListener}, or <code>null</code> if not set.
 */
public DiscoveryListener getListener_Discovery(){
  return m_discoveryListener;
}
Program: 93973
Project: 93973
Buggy source:
/** 
 * Sets a default backup   {@link com.idevicesinc.sweetblue.BleDevice.HistoricalDataLoadListener} that will be invokedfor all historical data loads to memory for all uuids for all devices.
 */
public void setListener_HistoricalDataLoad(@Nullable(Prevalence.NORMAL) final BleDevice.HistoricalDataLoadListener listener_nullable){
  m_historicalDataLoadListener=listener_nullable;
}

Fixed version (ground truth):
/** 
 * Sets a default backup   {@link BleNode.HistoricalDataLoadListener} that will be invokedfor all historical data loads to memory for all uuids for all devices.
 */
public void setListener_HistoricalDataLoad(@Nullable(Prevalence.NORMAL) final BleNode.HistoricalDataLoadListener listener_nullable){
  m_historicalDataLoadListener=listener_nullable;
}
Program: 93974
Project: 93974
Buggy source:
/** 
 * See explanation at   {@link BleDevice#getLastDisconnectIntent()}. <br><br> TIP: If   {@link ScanEvent#lastDisconnectIntent} isn't {@link State.ChangeIntent#NULL} then most likely you can early-outand return <code>true</code> from  {@link ScanFilter#onEvent(ScanEvent)} without having to checkuuids or names matching, because obviously you've seen and connected to this device before.
 */
public State.ChangeIntent lastDisconnectIntent(){
  return m_lastDisconnectIntent;
}

Fixed version (ground truth):
/** 
 * See explanation at   {@link BleDevice#getLastDisconnectIntent()}. <br><br> TIP: If   {@link ScanEvent#lastDisconnectIntent} isn't {@link com.idevicesinc.sweetblue.utils.State.ChangeIntent#NULL} then most likely you can early-outand return <code>true</code> from  {@link ScanFilter#onEvent(ScanEvent)} without having to checkuuids or names matching, because obviously you've seen and connected to this device before.
 */
public State.ChangeIntent lastDisconnectIntent(){
  return m_lastDisconnectIntent;
}
Program: 93975
Project: 93975
Buggy source:
/** 
 * Acknowledges the discovery if there's an overlap between the given advertisedServices and the   {@link Collection} passed into {@link BleManagerConfig.DefaultScanFilter#DefaultScanFilter(Collection)}.
 */
@Override public Please onEvent(ScanEvent e){
  return Please.acknowledgeIf(Utils.haveMatchingIds(e.advertisedServices(),m_whitelist));
}

Fixed version (ground truth):
/** 
 * Acknowledges the discovery if there's an overlap between the given advertisedServices and the   {@link Collection} passed into the constructor of {@link BleManagerConfig.DefaultScanFilter}.
 */
@Override public Please onEvent(ScanEvent e){
  return Please.acknowledgeIf(Utils.haveMatchingIds(e.advertisedServices(),m_whitelist));
}
Program: 93976
Project: 93976
Buggy source:
/** 
 * Return this from   {@link ReconnectFilter#onEvent(ReconnectFilter.ReconnectEvent)} to retry after the given amount of time.
 */
public static Please retryIn(Interval interval){
  return new Please(interval != null ? interval : SHOULD_TRY_AGAIN__INSTANTLY);
}

Fixed version (ground truth):
/** 
 * Return this from   {@link BleNodeConfig.ReconnectFilter#onEvent(BleNodeConfig.ReconnectFilter.ReconnectEvent)} to retry after the given amount of time.
 */
public static Please retryIn(Interval interval){
  return new Please(interval != null ? interval : SHOULD_TRY_AGAIN__INSTANTLY);
}
Program: 93977
Project: 93977
Buggy source:
/** 
 * Return this from   {@link ReconnectFilter#onEvent(ReconnectFilter.ReconnectEvent)} to stop a reconnect attempt loop.Note that  {@link BleDevice#disconnect()} {@link BleServer#disconnect(String)} will also stop any ongoing reconnect loops.
 */
public static Please stopRetrying(){
  return SHOULD_CONTINUE__STOP;
}

Fixed version (ground truth):
/** 
 * Return this from   {@link BleNodeConfig.ReconnectFilter#onEvent(BleNodeConfig.ReconnectFilter.ReconnectEvent)} to stop a reconnect attempt loop.Note that  {@link BleDevice#disconnect()} {@link BleServer#disconnect(String)} will also stop any ongoing reconnect loops.
 */
public static Please stopRetrying(){
  return SHOULD_CONTINUE__STOP;
}
Program: 93978
Project: 93978
Buggy source:
/** 
 * When   {@link ReconnectEvent#type()} is either {@link Type#SHORT_TERM__SHOULD_TRY_AGAIN} or {@link Type#LONG_TERM__SHOULD_TRY_AGAIN}, return this from   {@link ReconnectFilter#onEvent(ReconnectFilter.ReconnectEvent)} to instantly reconnect.
 */
public static Please retryInstantly(){
  return new Please(SHOULD_TRY_AGAIN__INSTANTLY);
}

Fixed version (ground truth):
/** 
 * When   {@link BleNodeConfig.ReconnectFilter.ReconnectEvent#type()} is either {@link Type#SHORT_TERM__SHOULD_TRY_AGAIN} or {@link Type#LONG_TERM__SHOULD_TRY_AGAIN}, return this from   {@link BleNodeConfig.ReconnectFilter#onEvent(BleNodeConfig.ReconnectFilter.ReconnectEvent)} to instantly reconnect.
 */
public static Please retryInstantly(){
  return new Please(SHOULD_TRY_AGAIN__INSTANTLY);
}
Program: 93979
Project: 93979
Buggy source:
/** 
 * The previous   {@link Interval} returned through {@link com.idevicesinc.sweetblue.BleNodeConfig.ReconnectFilter.Please#retryIn(Interval)}, or   {@link Interval#ZERO} for the first invocation.
 */
public Interval previousDelay(){
  return m_previousDelay;
}

Fixed version (ground truth):
/** 
 * The previous   {@link Interval} returned through {@link BleNodeConfig.ReconnectFilter.Please#retryIn(Interval)}, or   {@link Interval#ZERO} for the first invocation.
 */
public Interval previousDelay(){
  return m_previousDelay;
}
Program: 93980
Project: 93980
Buggy source:
static double getTimeout(final TaskTimeoutRequestFilter.TimeoutRequestEvent event){
  final BleManager manager=event.manager();
  final BleDevice device_nullable=!event.device().isNull() ? event.device() : null;
  final BleServer server_nullable=!event.server().isNull() ? event.server() : null;
  final TaskTimeoutRequestFilter filter_specific;
  if (device_nullable != null) {
    filter_specific=device_nullable.conf_device().taskTimeoutRequestFilter;
  }
 else   if (server_nullable != null) {
    filter_specific=server_nullable.conf_endpoint().taskTimeoutRequestFilter;
  }
 else {
    filter_specific=null;
  }
  final TaskTimeoutRequestFilter filter_mngr=manager.m_config.taskTimeoutRequestFilter;
  final TaskTimeoutRequestFilter filter=filter_specific != null ? filter_specific : filter_mngr;
  final TaskTimeoutRequestFilter.Please please=filter != null ? filter.onEvent(event) : null;
  final Interval timeout=please != null ? please.m_interval : Interval.DISABLED;
  final double toReturn=timeout != null ? timeout.secs() : Interval.DISABLED.secs();
  event.device().getManager().getLogger().checkPlease(please,TaskTimeoutRequestFilter.Please.class);
  return toReturn;
}

Fixed version (ground truth):
static double getTimeout(final TaskTimeoutRequestFilter.TaskTimeoutRequestEvent event){
  final BleManager manager=event.manager();
  final BleDevice device_nullable=!event.device().isNull() ? event.device() : null;
  final BleServer server_nullable=!event.server().isNull() ? event.server() : null;
  final TaskTimeoutRequestFilter filter_specific;
  if (device_nullable != null) {
    filter_specific=device_nullable.conf_device().taskTimeoutRequestFilter;
  }
 else   if (server_nullable != null) {
    filter_specific=server_nullable.conf_endpoint().taskTimeoutRequestFilter;
  }
 else {
    filter_specific=null;
  }
  final TaskTimeoutRequestFilter filter_mngr=manager.m_config.taskTimeoutRequestFilter;
  final TaskTimeoutRequestFilter filter=filter_specific != null ? filter_specific : filter_mngr;
  final TaskTimeoutRequestFilter.Please please=filter != null ? filter.onEvent(event) : null;
  final Interval timeout=please != null ? please.m_interval : Interval.DISABLED;
  final double toReturn=timeout != null ? timeout.secs() : Interval.DISABLED.secs();
  event.device().getManager().getLogger().checkPlease(please,TaskTimeoutRequestFilter.Please.class);
  return toReturn;
}
Program: 93981
Project: 93981
Buggy source:
/** 
 * Whether this reason honors a   {@link BleServer.ConnectionFailListener.Please#isRetry()}. Returns <code>false</code> if   {@link #wasCancelled()} or<code>this</code> is  {@link #ALREADY_CONNECTING_OR_CONNECTED}.
 */
public boolean allowsRetry(){
  return !this.wasCancelled() && this != ALREADY_CONNECTING_OR_CONNECTED;
}

Fixed version (ground truth):
/** 
 * Whether this reason honors a   {@link BleNode.ConnectionFailListener.Please#isRetry()}. Returns <code>false</code> if   {@link #wasCancelled()} or<code>this</code> is  {@link #ALREADY_CONNECTING_OR_CONNECTED}.
 */
public boolean allowsRetry(){
  return !this.wasCancelled() && this != ALREADY_CONNECTING_OR_CONNECTED;
}
Program: 93982
Project: 93982
Buggy source:
/** 
 * For each old->new bit difference, this mask will tell you if the transition was intentional. "Intentional" generally means a call was made to a public method of the library from app-code to trigger the state change, and so usually the stacktrace started from a user input event upstream. Otherwise the given bit will be 0x0 and so the state change was "unintentional". An example of intentional is if you call  {@link BleDevice#disconnect()} in response to a button click, whereas unintentional would be if the device disconnected because itwent out of range. As much as possible these flags are meant to represent the actual app <i>user's</i> intent through the app, not the intent of you the programmer, nor the intent of the user outside the bounds of the app, like disconnecting by turning the peripheral off. For example after a disconnect you might be using  {@link BleManagerConfig#reconnectRequestFilter_longTerm} to try periodicallyreconnecting. From you the programmer's perspective a connect, if/when it happens, is arguably an intentional action. From the user's perspective however the connect was unintentional. Therefore this mask is currently meant to serve an analytics or debugging role, not to necessarily gate application logic.
 */
public int intentMask(){
  return m_intentMask;
}

Fixed version (ground truth):
/** 
 * For each old->new bit difference, this mask will tell you if the transition was intentional. "Intentional" generally means a call was made to a public method of the library from app-code to trigger the state change, and so usually the stacktrace started from a user input event upstream. Otherwise the given bit will be 0x0 and so the state change was "unintentional". An example of intentional is if you call  {@link BleDevice#disconnect()} in response to a button click, whereas unintentional would be if the device disconnected because itwent out of range. As much as possible these flags are meant to represent the actual app <i>user's</i> intent through the app, not the intent of you the programmer, nor the intent of the user outside the bounds of the app, like disconnecting by turning the peripheral off. For example after a disconnect you might be using  {@link BleManagerConfig#reconnectFilter} to try periodicallyreconnecting. From you the programmer's perspective a connect, if/when it happens, is arguably an intentional action. From the user's perspective however the connect was unintentional. Therefore this mask is currently meant to serve an analytics or debugging role, not to necessarily gate application logic.
 */
public int intentMask(){
  return m_intentMask;
}
Program: 93983
Project: 93983
Buggy source:
/** 
 * Returns the device's name and current state for logging and debugging purposes.
 */
@Override public String toString(){
  if (isNull()) {
    return NULL_STRING();
  }
 else {
    return getName_debug() + "String_Node_Str" + stateTracker_main().toString();
  }
}

Fixed version (ground truth):
/** 
 * Returns the device's name and current state for logging and debugging purposes.
 */
@Override public String toString(){
  if (isNull()) {
    return NULL_STRING();
  }
 else {
    return m_nativeWrapper.getDebugName() + "String_Node_Str" + stateTracker_main().toString();
  }
}
Program: 93984
Project: 93984
Buggy source:
/** 
 * Pretty-prints the list of connecting or connected clients.
 */
public String toString(){
  return this.getClass().getSimpleName() + "String_Node_Str" + getClientCount(CONNECTING,CONNECTED)+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Pretty-prints the list of connecting or connected clients.
 */
public String toString(){
  return this.getClass().getSimpleName() + "String_Node_Str" + m_clientMngr.getClientCount(BleServerState.toBits(CONNECTING,CONNECTED))+ "String_Node_Str";
}
Program: 93985
Project: 93985
Buggy source:
void update_internal(double timeStep){
synchronized (this) {
    m_totalTimeArmedAndExecuting+=timeStep;
    m_updateCount++;
    if (m_totalTimeArmedAndExecuting >= m_executionDelay) {
      if (m_state == PE_TaskState.ARMED) {
        if (m_updateCount > 1) {
          if (m_softlyCancelled) {
            softlyCancel();
            return;
          }
          if (isExecutable()) {
            setState(PE_TaskState.EXECUTING);
            if (executeOnSeperateThread()) {
              m_executeHandler.post(m_executeRunnable);
            }
 else {
              execute_wrapper();
            }
            return;
          }
 else {
            failWithoutRetry();
            return;
          }
        }
      }
 else       if (m_state == PE_TaskState.EXECUTING) {
        if (!Interval.isDisabled(m_timeout) && m_timeout != Interval.INFINITE.secs()) {
          double timeExecuting=(System.currentTimeMillis() - m_resetableExecuteStartTime) / 1000.0;
          if (timeExecuting >= m_timeout) {
            timeout();
            return;
          }
        }
      }
    }
    this.update(timeStep);
  }
}

Fixed version (ground truth):
void update_internal(double timeStep){
synchronized (this) {
    m_totalTimeArmedAndExecuting+=timeStep;
    m_updateCount++;
    if (m_totalTimeArmedAndExecuting >= m_executionDelay) {
      if (m_state == PE_TaskState.ARMED) {
        if (m_updateCount > 1) {
          if (m_softlyCancelled) {
            softlyCancel();
            return;
          }
          if (isExecutable()) {
            setState(PE_TaskState.EXECUTING);
            if (executeOnSeperateThread()) {
              m_executeHandler.post(m_executeRunnable);
            }
 else {
              execute_wrapper();
            }
            return;
          }
 else {
            onNotExecutable();
            return;
          }
        }
      }
 else       if (m_state == PE_TaskState.EXECUTING) {
        if (!Interval.isDisabled(m_timeout) && m_timeout != Interval.INFINITE.secs()) {
          double timeExecuting=(System.currentTimeMillis() - m_resetableExecuteStartTime) / 1000.0;
          if (timeExecuting >= m_timeout) {
            timeout();
            return;
          }
        }
      }
    }
    this.update(timeStep);
  }
}
Program: 93986
Project: 93986
Buggy source:
protected void fail(Status status,int gattStatus,Target target,UUID charUuid,UUID descUuid){
  getDevice().invokeReadWriteCallback(m_readWriteListener,newReadWriteEvent(status,gattStatus,target,getServiceUuid(),charUuid,descUuid));
  this.fail();
}

Fixed version (ground truth):
protected void fail(Status status,int gattStatus,Target target,UUID charUuid,UUID descUuid){
  this.fail();
  getDevice().invokeReadWriteCallback(m_readWriteListener,newReadWriteEvent(status,gattStatus,target,getServiceUuid(),charUuid,descUuid));
}
Program: 93987
Project: 93987
Buggy source:
private void succeed(byte[] value,Target target){
  ReadWriteEvent result=newReadWriteEvent(value,target,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
  getDevice().addReadTime(result.time_total().secs());
  getDevice().invokeReadWriteCallback(m_readWriteListener,result);
  super.succeed();
}

Fixed version (ground truth):
private void succeed(byte[] value,Target target){
  super.succeed();
  final ReadWriteEvent event=newReadWriteEvent(value,target,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
  getDevice().addReadTime(event.time_total().secs());
  getDevice().invokeReadWriteCallback(m_readWriteListener,event);
}
Program: 93988
Project: 93988
Buggy source:
private void fail(Status status,int gattStatus){
  getDevice().invokeReadWriteCallback(m_readWriteListener,newEvent(status,gattStatus,0));
  this.fail();
}

Fixed version (ground truth):
private void fail(Status status,int gattStatus){
  this.fail();
  getDevice().invokeReadWriteCallback(m_readWriteListener,newEvent(status,gattStatus,0));
}
Program: 93989
Project: 93989
Buggy source:
private void succeed(int gattStatus,int rssi){
  ReadWriteEvent result=newEvent(Status.SUCCESS,gattStatus,rssi);
  getDevice().invokeReadWriteCallback(m_readWriteListener,result);
  super.succeed();
}

Fixed version (ground truth):
private void succeed(int gattStatus,int rssi){
  super.succeed();
  final ReadWriteEvent event=newEvent(Status.SUCCESS,gattStatus,rssi);
  getDevice().invokeReadWriteCallback(m_readWriteListener,event);
}
Program: 93990
Project: 93990
Buggy source:
@Override protected void fail(Status status,int gattStatus,Target target,UUID charUuid,UUID descUuid){
  if (m_enable) {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),charUuid,E_NotifyState.NOT_ENABLED);
  }
  super.fail(status,gattStatus,target,charUuid,descUuid);
}

Fixed version (ground truth):
@Override protected void fail(Status status,int gattStatus,Target target,UUID charUuid,UUID descUuid){
  super.fail(status,gattStatus,target,charUuid,descUuid);
  if (m_enable) {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),charUuid,E_NotifyState.NOT_ENABLED);
  }
}
Program: 93991
Project: 93991
Buggy source:
@Override protected void succeed(){
  ReadWriteEvent result=newReadWriteEvent(Status.SUCCESS,BluetoothGatt.GATT_SUCCESS,Target.DESCRIPTOR,getServiceUuid(),getCharUuid(),m_descUuid);
  if (m_enable) {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),getCharUuid(),E_NotifyState.ENABLED);
  }
 else {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),getCharUuid(),E_NotifyState.NOT_ENABLED);
  }
  getDevice().invokeReadWriteCallback(m_readWriteListener,result);
  super.succeed();
}

Fixed version (ground truth):
@Override protected void succeed(){
  if (m_enable) {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),getCharUuid(),E_NotifyState.ENABLED);
  }
 else {
    getDevice().getPollManager().onNotifyStateChange(getServiceUuid(),getCharUuid(),E_NotifyState.NOT_ENABLED);
  }
  super.succeed();
  final ReadWriteEvent event=newReadWriteEvent(Status.SUCCESS,BluetoothGatt.GATT_SUCCESS,Target.DESCRIPTOR,getServiceUuid(),getCharUuid(),m_descUuid);
  getDevice().invokeReadWriteCallback(m_readWriteListener,event);
}
Program: 93992
Project: 93992
Buggy source:
@Override public void execute(){
  super.execute();
  BluetoothGattCharacteristic char_native=getDevice().getNativeCharacteristic(getServiceUuid(),getCharUuid());
  if (char_native == null) {
    this.fail(Status.NO_MATCHING_TARGET,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.CHARACTERISTIC,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
    return;
  }
  if (!getDevice().getNativeGatt().setCharacteristicNotification(char_native,m_enable)) {
    this.fail(Status.FAILED_TO_TOGGLE_NOTIFICATION,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.CHARACTERISTIC,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
    return;
  }
  BluetoothGattDescriptor descriptor=char_native.getDescriptor(m_descUuid);
  if (descriptor == null) {
    succeed();
    return;
  }
  m_writeValue=getWriteValue(char_native,m_enable);
  if (!descriptor.setValue(getWriteValue())) {
    this.fail(Status.FAILED_TO_SET_VALUE_ON_TARGET,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.DESCRIPTOR,getCharUuid(),m_descUuid);
    return;
  }
  if (!getDevice().getNativeGatt().writeDescriptor(descriptor)) {
    this.fail(Status.FAILED_TO_SEND_OUT,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.DESCRIPTOR,getCharUuid(),m_descUuid);
    return;
  }
}

Fixed version (ground truth):
@Override public void execute(){
  super.execute();
  final BluetoothGattCharacteristic char_native=getDevice().getNativeCharacteristic(getServiceUuid(),getCharUuid());
  if (char_native == null) {
    this.fail(Status.NO_MATCHING_TARGET,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.CHARACTERISTIC,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
    return;
  }
  if (!getDevice().getNativeGatt().setCharacteristicNotification(char_native,m_enable)) {
    this.fail(Status.FAILED_TO_TOGGLE_NOTIFICATION,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.CHARACTERISTIC,getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
    return;
  }
  final BluetoothGattDescriptor descriptor=char_native.getDescriptor(m_descUuid);
  if (descriptor == null) {
    succeed();
    return;
  }
  m_writeValue=getWriteValue(char_native,m_enable);
  if (!descriptor.setValue(getWriteValue())) {
    this.fail(Status.FAILED_TO_SET_VALUE_ON_TARGET,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.DESCRIPTOR,getCharUuid(),m_descUuid);
    return;
  }
  if (!getDevice().getNativeGatt().writeDescriptor(descriptor)) {
    this.fail(Status.FAILED_TO_SEND_OUT,BleStatuses.GATT_STATUS_NOT_APPLICABLE,Target.DESCRIPTOR,getCharUuid(),m_descUuid);
    return;
  }
}
Program: 93993
Project: 93993
Buggy source:
@Override protected void succeed(){
  ReadWriteEvent result=newReadWriteEvent(Status.SUCCESS,BluetoothGatt.GATT_SUCCESS,getDefaultTarget(),getServiceUuid(),getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
  getDevice().addWriteTime(result.time_total().secs());
  getDevice().invokeReadWriteCallback(m_readWriteListener,result);
  super.succeed();
}

Fixed version (ground truth):
@Override protected void succeed(){
  super.succeed();
  final ReadWriteEvent event=newReadWriteEvent(Status.SUCCESS,BluetoothGatt.GATT_SUCCESS,getDefaultTarget(),getServiceUuid(),getCharUuid(),ReadWriteEvent.NON_APPLICABLE_UUID);
  getDevice().addWriteTime(event.time_total().secs());
  getDevice().invokeReadWriteCallback(m_readWriteListener,event);
}
Program: 93994
Project: 93994
Buggy source:
private void BleManager(Context context,BleManagerConfig config){
  m_context=context.getApplicationContext();
  m_config=config.clone();
  initLogger();
  m_historicalDatabase=PU_HistoricalData.newDatabase(context,this);
  m_diskOptionsMngr=new P_DiskOptionsManager(m_context);
  m_filterMngr=new P_ScanFilterManager(m_config.defaultScanFilter);
  m_btMngr=(BluetoothManager)m_context.getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE);
  BleManagerState nativeState;
  if (m_btMngr == null) {
    nativeState=BleManagerState.get(BluetoothAdapter.STATE_ON);
  }
 else {
    nativeState=BleManagerState.get(m_btMngr.getAdapter().getState());
  }
  m_stateTracker=new P_BleStateTracker(this);
  m_stateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_nativeStateTracker=new P_NativeBleStateTracker(this);
  m_nativeStateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_mainThreadHandler=new Handler(m_context.getMainLooper());
  m_taskQueue=new P_TaskQueue(this);
  m_crashResolver=new P_BluetoothCrashResolver(m_context);
  m_deviceMngr=new P_DeviceManager(this);
  m_deviceMngr_cache=new P_DeviceManager(this);
  m_listeners=new P_BleManager_Listeners(this);
  initConfigDependentMembers();
  m_logger.printBuildInfo();
}

Fixed version (ground truth):
private void BleManager(Context context,BleManagerConfig config){
  m_context=context.getApplicationContext();
  m_config=config.clone();
  initLogger();
  m_historicalDatabase=PU_HistoricalData.newDatabase(context,this);
  m_diskOptionsMngr=new P_DiskOptionsManager(m_context);
  m_filterMngr=new P_ScanFilterManager(this,m_config.defaultScanFilter);
  m_btMngr=(BluetoothManager)m_context.getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE);
  BleManagerState nativeState;
  if (m_btMngr == null) {
    nativeState=BleManagerState.get(BluetoothAdapter.STATE_ON);
  }
 else {
    nativeState=BleManagerState.get(m_btMngr.getAdapter().getState());
  }
  m_stateTracker=new P_BleStateTracker(this);
  m_stateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_nativeStateTracker=new P_NativeBleStateTracker(this);
  m_nativeStateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_mainThreadHandler=new Handler(m_context.getMainLooper());
  m_taskQueue=new P_TaskQueue(this);
  m_crashResolver=new P_BluetoothCrashResolver(m_context);
  m_deviceMngr=new P_DeviceManager(this);
  m_deviceMngr_cache=new P_DeviceManager(this);
  m_listeners=new P_BleManager_Listeners(this);
  initConfigDependentMembers();
  m_logger.printBuildInfo();
}
Program: 93995
Project: 93995
Buggy source:
/** 
 * Set a listener here to override any listener provided previously either through this method or through   {@link BleManager#newServer(IncomingListener)} or otherwise.
 */
public void setListener_Incoming(@Nullable(Nullable.Prevalence.NORMAL) final IncomingListener listener_nullable){
  m_incomingListener=listener_nullable;
}

Fixed version (ground truth):
/** 
 * Set a listener here to override any listener provided previously.
 */
public void setListener_Incoming(@Nullable(Nullable.Prevalence.NORMAL) final IncomingListener listener_nullable){
  m_incomingListener=listener_nullable;
}
Program: 93996
Project: 93996
Buggy source:
void onNativeConnect(final String macAddress,final boolean explicit){
  m_clientMngr.onConnected(macAddress);
  final ChangeIntent intent=explicit ? ChangeIntent.INTENTIONAL : ChangeIntent.UNINTENTIONAL;
  m_stateTracker.doStateTransition(macAddress,BleServerState.CONNECTING,BleServerState.CONNECTED,intent,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
}

Fixed version (ground truth):
void onNativeConnect(final String macAddress,final boolean explicit){
  m_clientMngr.onConnected(macAddress);
  final ChangeIntent intent=explicit ? ChangeIntent.INTENTIONAL : ChangeIntent.UNINTENTIONAL;
  final BleServerState previousState=explicit ? BleServerState.DISCONNECTED : BleServerState.CONNECTING;
  m_stateTracker.doStateTransition(macAddress,previousState,BleServerState.CONNECTED,intent,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
}
Program: 93997
Project: 93997
Buggy source:
/** 
 * Returns service conforming to the "Current Time Service" specificiation.
 */
public static BleService currentTime(){
  final BleDescriptor descriptor=new BleDescriptor(Uuids.CLIENT_CHARACTERISTIC_CONFIGURATION_DESCRIPTOR_UUID,BleDescriptorPermission.READ,BleDescriptorPermission.WRITE);
  final BleCharacteristic characteristic_currentTime=new BleCharacteristic(Uuids.CURRENT_TIME_SERVICE__CURRENT_TIME,descriptor,BleCharacteristicPermission.READ,BleCharacteristicProperty.READ,BleCharacteristicProperty.NOTIFY);
  final BleCharacteristic characteristic_localTime=new BleCharacteristic(Uuids.CURRENT_TIME_SERVICE__LOCAL_TIME_INFO,BleCharacteristicPermission.READ,BleCharacteristicProperty.READ);
  final BleService currentTimeService=new BleService(Uuids.CURRENT_TIME_SERVICE,characteristic_currentTime,characteristic_localTime);
  return currentTimeService;
}

Fixed version (ground truth):
/** 
 * Returns a new service conforming to the "Current Time Service" specification.
 */
public static BleService currentTime(){
  final BleDescriptor descriptor=new BleDescriptor(Uuids.CLIENT_CHARACTERISTIC_CONFIGURATION_DESCRIPTOR_UUID,BleDescriptorPermission.READ,BleDescriptorPermission.WRITE);
  final BleCharacteristic characteristic_currentTime=new BleCharacteristic(Uuids.CURRENT_TIME_SERVICE__CURRENT_TIME,descriptor,BleCharacteristicPermission.READ,BleCharacteristicProperty.READ,BleCharacteristicProperty.NOTIFY);
  final BleCharacteristic characteristic_localTime=new BleCharacteristic(Uuids.CURRENT_TIME_SERVICE__LOCAL_TIME_INFO,BleCharacteristicPermission.READ,BleCharacteristicProperty.READ);
  final BleService currentTimeService=new BleService(Uuids.CURRENT_TIME_SERVICE,characteristic_currentTime,characteristic_localTime);
  return currentTimeService;
}
Program: 93998
Project: 93998
Buggy source:
BleManagerConfig.ScanFilter.Please allow(P_Logger logger,BluetoothDevice nativeInstance,List<UUID> uuids,String deviceName,String normalizedDeviceName,byte[] scanRecord,int rssi,State.ChangeIntent lastDisconnectIntent){
  if (m_filters.size() == 0 && m_default == null)   return Please.acknowledge();
  ScanEvent result=null;
  if (m_default != null) {
    result=new ScanEvent(nativeInstance,uuids,deviceName,normalizedDeviceName,scanRecord,rssi,lastDisconnectIntent);
    final Please please=m_default.onEvent(result);
    logger.checkPlease(please,Please.class);
    if (please != null && please.ack()) {
      return please;
    }
  }
  for (int i=0; i < m_filters.size(); i++) {
    result=result != null ? result : new ScanEvent(nativeInstance,uuids,deviceName,normalizedDeviceName,scanRecord,rssi,lastDisconnectIntent);
    ScanFilter ithFilter=m_filters.get(i);
    final Please please=ithFilter.onEvent(result);
    logger.checkPlease(please,Please.class);
    if (please != null && please.ack()) {
      return please;
    }
  }
  return BleManagerConfig.ScanFilter.Please.ignore();
}

Fixed version (ground truth):
BleManagerConfig.ScanFilter.Please allow(P_Logger logger,BluetoothDevice nativeInstance,List<UUID> uuids,String deviceName,String normalizedDeviceName,byte[] scanRecord,int rssi,State.ChangeIntent lastDisconnectIntent){
  if (m_filters.size() == 0 && m_default == null)   return Please.acknowledge();
  ScanEvent result=null;
  if (m_default != null) {
    result=new ScanEvent(nativeInstance,uuids,deviceName,normalizedDeviceName,scanRecord,rssi,lastDisconnectIntent);
    final Please please=m_default.onEvent(result);
    logger.checkPlease(please,Please.class);
    stopScanningIfNeeded(m_default,please);
    if (please != null && please.ack()) {
      return please;
    }
  }
  for (int i=0; i < m_filters.size(); i++) {
    result=result != null ? result : new ScanEvent(nativeInstance,uuids,deviceName,normalizedDeviceName,scanRecord,rssi,lastDisconnectIntent);
    final ScanFilter ithFilter=m_filters.get(i);
    final Please please=ithFilter.onEvent(result);
    logger.checkPlease(please,Please.class);
    stopScanningIfNeeded(ithFilter,please);
    if (please != null && please.ack()) {
      return please;
    }
  }
  return BleManagerConfig.ScanFilter.Please.ignore();
}
Program: 93999
Project: 93999
Buggy source:
P_ScanFilterManager(ScanFilter defaultFilter){
  m_default=defaultFilter;
}

Fixed version (ground truth):
P_ScanFilterManager(final BleManager mngr,final ScanFilter defaultFilter){
  m_mngr=mngr;
  m_default=defaultFilter;
}
Program: 94000
Project: 94000
Buggy source:
public void onServiceAdded(final int gattStatus,final BluetoothGattService service){
  if (m_cancelledInTheMiddleOfExecuting) {
    final BluetoothGattServer server_native_nullable=getServer().getNative();
    if (server_native_nullable != null) {
      server_native_nullable.removeService(service);
    }
    fail();
  }
 else {
    if (Utils.isSuccess(gattStatus)) {
      succeed();
    }
 else {
      fail(BleServer.ServiceAddListener.Status.FAILED_EVENTUALLY,gattStatus);
    }
  }
}

Fixed version (ground truth):
public void onServiceAdded(final int gattStatus,final BluetoothGattService service){
  if (m_cancelledInTheMiddleOfExecuting) {
    final BluetoothGattServer server_native_nullable=getServer().getNative();
    if (server_native_nullable != null) {
      server_native_nullable.removeService(service);
    }
    fail();
  }
 else {
    if (Utils.isSuccess(gattStatus)) {
      succeed(gattStatus);
    }
 else {
      fail(BleServer.ServiceAddListener.Status.FAILED_EVENTUALLY,gattStatus);
    }
  }
}
Program: 94001
Project: 94001
Buggy source:
@Override protected void update(double timeStep){
  final double timeToSuccess=.5d;
  if (getTotalTimeExecuting() >= timeToSuccess) {
    succeed();
  }
}

Fixed version (ground truth):
@Override protected void update(double timeStep){
  final double timeToSuccess=.5d;
  if (getState() == PE_TaskState.EXECUTING && getTotalTimeExecuting() >= timeToSuccess) {
    succeed();
  }
}
Program: 94002
Project: 94002
Buggy source:
private void BleManager(Context context,BleManagerConfig config){
  m_context=context.getApplicationContext();
  m_config=config.clone();
  initLogger();
  m_historicalDatabase=PU_HistoricalData.newDatabase(context,this);
  m_diskOptionsMngr=new P_DiskOptionsManager(m_context);
  m_filterMngr=new P_ScanFilterManager(m_config.defaultScanFilter);
  m_btMngr=(BluetoothManager)m_context.getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE);
  BleManagerState nativeState;
  if (m_btMngr == null) {
    nativeState=BleManagerState.get(BluetoothAdapter.STATE_ON);
  }
 else {
    nativeState=BleManagerState.get(m_btMngr.getAdapter().getState());
  }
  m_stateTracker=new P_BleStateTracker(this);
  m_stateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_nativeStateTracker=new P_NativeBleStateTracker(this);
  m_nativeStateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_mainThreadHandler=new Handler(m_context.getMainLooper());
  m_taskQueue=new P_TaskQueue(this);
  m_crashResolver=new P_BluetoothCrashResolver(m_context);
  m_deviceMngr=new P_DeviceManager(this);
  m_serverMngr=new P_ServerManager(this);
  m_deviceMngr_cache=new P_DeviceManager(this);
  m_listeners=new P_BleManager_Listeners(this);
  initConfigDependentMembers();
  m_logger.printBuildInfo();
}

Fixed version (ground truth):
private void BleManager(Context context,BleManagerConfig config){
  m_context=context.getApplicationContext();
  m_config=config.clone();
  initLogger();
  m_historicalDatabase=PU_HistoricalData.newDatabase(context,this);
  m_diskOptionsMngr=new P_DiskOptionsManager(m_context);
  m_filterMngr=new P_ScanFilterManager(m_config.defaultScanFilter);
  m_btMngr=(BluetoothManager)m_context.getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE);
  BleManagerState nativeState;
  if (m_btMngr == null) {
    nativeState=BleManagerState.get(BluetoothAdapter.STATE_ON);
  }
 else {
    nativeState=BleManagerState.get(m_btMngr.getAdapter().getState());
  }
  m_stateTracker=new P_BleStateTracker(this);
  m_stateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_nativeStateTracker=new P_NativeBleStateTracker(this);
  m_nativeStateTracker.append(nativeState,E_Intent.UNINTENTIONAL,BleStatuses.GATT_STATUS_NOT_APPLICABLE);
  m_mainThreadHandler=new Handler(m_context.getMainLooper());
  m_taskQueue=new P_TaskQueue(this);
  m_crashResolver=new P_BluetoothCrashResolver(m_context);
  m_deviceMngr=new P_DeviceManager(this);
  m_deviceMngr_cache=new P_DeviceManager(this);
  m_listeners=new P_BleManager_Listeners(this);
  initConfigDependentMembers();
  m_logger.printBuildInfo();
}
Program: 94003
Project: 94003
Buggy source:
/** 
 */
public BleServer newServer(final IncomingListener incomingListener){
  BleServer bleServer=new BleServer(this);
  m_serverMngr.add(bleServer);
  return bleServer;
}

Fixed version (ground truth):
/** 
 */
public BleServer newServer(final BleServerConfig config,final IncomingListener incomingListener){
  final BleServer bleServer=new BleServer(this,false);
  bleServer.setConfig(config);
  bleServer.setListener_Incoming(incomingListener);
  return bleServer;
}
Program: 94004
Project: 94004
Buggy source:
/** 
 * Disconnects this server completely, disconnecting all connected clients and shutting things down. To disconnect individual clients use   {@link #disconnect(String)}.
 */
public void disconnect(){
  getClients(new ForEach_Void<String>(){
    @Override public void next(    final String next){
      disconnect(next);
    }
  }
,CONNECTING,CONNECTED);
  m_nativeWrapper.closeServer();
}

Fixed version (ground truth):
/** 
 * Disconnects this server completely, disconnecting all connected clients and shutting things down. To disconnect individual clients use   {@link #disconnect(String)}.
 */
public void disconnect(){
  getClients(new ForEach_Void<String>(){
    @Override public void next(    final String next){
      disconnect(next);
    }
  }
,CONNECTING,CONNECTED);
  m_nativeWrapper.closeServer();
  m_serviceMngr.removeAll(ServiceAddListener.Status.CANCELLED_FROM_DISCONNECT);
}
Program: 94005
Project: 94005
Buggy source:
/** 
 * Returns the native service for the given UUID. <br><br> WARNING: Please see the WARNING for   {@link #getNative()}.
 */
public @Nullable(Nullable.Prevalence.NORMAL) BluetoothGattService getNativeService(final UUID uuid){
  return m_serviceMngr.getService(uuid);
}

Fixed version (ground truth):
/** 
 * Returns the native service for the given UUID. <br><br> WARNING: Please see the WARNING for   {@link #getNative()}.
 */
public @Nullable(Nullable.Prevalence.NORMAL) BluetoothGattService getNativeService(final UUID uuid){
  return m_serviceMngr.getServiceDirectlyFromNativeServer(uuid);
}
Program: 94006
Project: 94006
Buggy source:
void BleServer(final BleManager mngr,final boolean isNull){
  m_mngr=mngr;
  m_isNull=isNull;
  if (isNull) {
    m_queue=null;
    m_logger=null;
    m_stateTracker=new P_ServerStateTracker(this);
    m_listeners=null;
    m_nativeWrapper=new P_NativeServerWrapper(this);
    m_connectionFailMngr=new P_ServerConnectionFailManager(this);
    m_clientMngr=new P_ClientManager(this);
    m_serviceMngr=new P_ServerServiceManager(this);
  }
 else {
    m_queue=m_mngr.getTaskQueue();
    m_logger=m_mngr.getLogger();
    m_stateTracker=new P_ServerStateTracker(this);
    m_listeners=new P_BleServer_Listeners(this);
    m_nativeWrapper=new P_NativeServerWrapper(this);
    m_connectionFailMngr=new P_ServerConnectionFailManager(this);
    m_clientMngr=new P_ClientManager(this);
    m_serviceMngr=new P_ServerServiceManager(this);
  }
}

Fixed version (ground truth):
void BleServer(final BleManager mngr,final boolean isNull){
  m_mngr=mngr;
  m_isNull=isNull;
  if (isNull) {
    m_queue=null;
    m_stateTracker=new P_ServerStateTracker(this);
    m_listeners=null;
    m_nativeWrapper=new P_NativeServerWrapper(this);
    m_connectionFailMngr=new P_ServerConnectionFailManager(this);
    m_clientMngr=new P_ClientManager(this);
    m_serviceMngr=new P_ServerServiceManager(this);
  }
 else {
    m_queue=m_mngr.getTaskQueue();
    m_stateTracker=new P_ServerStateTracker(this);
    m_listeners=new P_BleServer_Listeners(this);
    m_nativeWrapper=new P_NativeServerWrapper(this);
    m_connectionFailMngr=new P_ServerConnectionFailManager(this);
    m_clientMngr=new P_ClientManager(this);
    m_serviceMngr=new P_ServerServiceManager(this);
  }
}
Program: 94007
Project: 94007
Buggy source:
void invokeOutgoingListeners(final OutgoingListener.OutgoingEvent e,final OutgoingListener listener_specific_nullable){
  if (listener_specific_nullable != null) {
    listener_specific_nullable.onEvent(e);
  }
  if (m_outgoingListener_default != null) {
    m_outgoingListener_default.onEvent(e);
  }
  if (m_mngr.m_defaultServerOutgoingListener != null) {
    m_mngr.m_defaultServerOutgoingListener.onEvent(e);
  }
}

Fixed version (ground truth):
void invokeOutgoingListeners(final OutgoingListener.OutgoingEvent e,final OutgoingListener listener_specific_nullable){
  if (listener_specific_nullable != null) {
    listener_specific_nullable.onEvent(e);
  }
  if (m_outgoingListener_default != null) {
    m_outgoingListener_default.onEvent(e);
  }
  if (getManager().m_defaultServerOutgoingListener != null) {
    getManager().m_defaultServerOutgoingListener.onEvent(e);
  }
}
Program: 94008
Project: 94008
Buggy source:
protected final BleServer.OutgoingListener.Status getCancelStatusType(){
  BleManager mngr=this.getManager();
  if (mngr.is(BleManagerState.TURNING_OFF)) {
    return BleServer.OutgoingListener.Status.CANCELLED_FROM_BLE_TURNING_OFF;
  }
 else {
    return BleServer.OutgoingListener.Status.CANCELLED_FROM_DISCONNECT;
  }
}

Fixed version (ground truth):
protected final BleServer.OutgoingListener.Status getCancelStatusType(){
  BleManager mngr=this.getManager();
  if (mngr.isAny(BleManagerState.TURNING_OFF,BleManagerState.OFF)) {
    return BleServer.OutgoingListener.Status.CANCELLED_FROM_BLE_TURNING_OFF;
  }
 else {
    return BleServer.OutgoingListener.Status.CANCELLED_FROM_DISCONNECT;
  }
}
Program: 94009
Project: 94009
Buggy source:
protected final BleDevice.ReadWriteListener.Status getCancelType(){
  BleManager mngr=this.getManager();
  if (mngr.is(BleManagerState.TURNING_OFF)) {
    return BleDevice.ReadWriteListener.Status.CANCELLED_FROM_BLE_TURNING_OFF;
  }
 else {
    return BleDevice.ReadWriteListener.Status.CANCELLED_FROM_DISCONNECT;
  }
}

Fixed version (ground truth):
protected final BleDevice.ReadWriteListener.Status getCancelType(){
  BleManager mngr=this.getManager();
  if (mngr.isAny(BleManagerState.TURNING_OFF,BleManagerState.OFF)) {
    return BleDevice.ReadWriteListener.Status.CANCELLED_FROM_BLE_TURNING_OFF;
  }
 else {
    return BleDevice.ReadWriteListener.Status.CANCELLED_FROM_DISCONNECT;
  }
}