nus-yam/ex-repair huggingface dataset:
Program: 32056
Project: 32056
Buggy source:
/** 
 * Shorthand for   {@link #startEventStream(org.matrix.androidsdk.sync.EventsThreadListener)} with no eventListenerusing a DataHandler and no specific failure callback.
 * @param initialToken the initial sync token (null to sync from scratch).
 */
public void startEventStream(String initialToken){
  checkIfAlive();
  startEventStream(null,this.mNetworkConnectivityReceiver,initialToken);
}

Fixed version (ground truth):
/** 
 * Shorthand for   {@link #startEventStream(EventsThreadListener,NetworkConnectivityReceiver,String)} with no eventListenerusing a DataHandler and no specific failure callback.
 * @param initialToken the initial sync token (null to sync from scratch).
 */
public void startEventStream(String initialToken){
  checkIfAlive();
  startEventStream(null,this.mNetworkConnectivityReceiver,initialToken);
}
Program: 32057
Project: 32057
Buggy source:
/** 
 * @return the direct chat room ids list
 */
public List<String> getDirectChatRoomIdsList(){
  IMXStore store=getDataHandler().getStore();
  ArrayList<String> directChatRoomIdsList=new ArrayList<>();
  Collection<List<String>> listOfList=store.getDirectChatRoomsDict().values();
  if (null != listOfList) {
    for (    List<String> list : listOfList) {
      for (      String roomId : list) {
        if ((directChatRoomIdsList.indexOf(roomId) < 0) && (null != store.getRoom(roomId))) {
          directChatRoomIdsList.add(roomId);
        }
      }
    }
  }
 else {
    ArrayList<Room> rooms=new ArrayList<>(store.getRooms());
    for (    Room r : rooms) {
      if ((r.getMembers().size() == 2) && (null != r.getAccountData()) && (!r.getAccountData().hasTags())) {
        RoomMember roomMember=r.getMember(getMyUserId());
        if (null != roomMember) {
          String membership=roomMember.membership;
          if (TextUtils.equals(membership,RoomMember.MEMBERSHIP_JOIN) || TextUtils.equals(membership,RoomMember.MEMBERSHIP_BAN) || TextUtils.equals(membership,RoomMember.MEMBERSHIP_LEAVE)) {
            directChatRoomIdsList.add(r.getRoomId());
          }
        }
      }
    }
  }
  return directChatRoomIdsList;
}

Fixed version (ground truth):
/** 
 * Return the list of the direct chat room IDs for the user given in parameter.<br> Based on the account_data map content, the entry associated with aSearchedUserId is returned.
 * @param aSearchedUserId user ID
 * @return the list of the direct chat room Id
 */
public List<String> getDirectChatRoomIdsList(String aSearchedUserId){
  ArrayList<String> directChatRoomIdsList=new ArrayList<>();
  IMXStore store=getDataHandler().getStore();
  Room room;
  HashMap<String,List<String>> params;
  if (null != (params=new HashMap<>(store.getDirectChatRoomsDict()))) {
    if (params.containsKey(aSearchedUserId)) {
      directChatRoomIdsList=new ArrayList<>();
      for (      String roomId : params.get(aSearchedUserId)) {
        room=store.getRoom(roomId);
        if (null != room) {
          directChatRoomIdsList.add(roomId);
        }
      }
    }
 else {
      Log.w(LOG_TAG,"String_Node_Str" + aSearchedUserId + "String_Node_Str");
    }
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str");
  }
  return directChatRoomIdsList;
}
Program: 32058
Project: 32058
Buggy source:
/** 
 * Initialize the jingle globals
 */
private static void initializeAndroidGlobals(Context context){
  if (!mIsInitialized) {
    try {
      mIsInitialized=PeerConnectionFactory.initializeAndroidGlobals(context,true,true,true,VideoRendererGui.getEGLContext());
      PeerConnectionFactory.initializeFieldTrials(null);
      mIsSupported=true;
      Log.d(LOG_TAG,"String_Node_Str" + mIsInitialized);
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      mIsInitialized=true;
      mIsSupported=false;
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize the jingle globals
 */
private static void initializeAndroidGlobals(Context context){
  if (!mIsInitialized) {
    try {
      mIsInitialized=PeerConnectionFactory.initializeAndroidGlobals(context,true,true,true,VideoRendererGui.getEGLContext());
      PeerConnectionFactory.initializeFieldTrials(null);
      mIsSupported=true;
      Log.d(LOG_TAG,"String_Node_Str" + mIsInitialized);
    }
 catch (    UnsatisfiedLinkError e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      mIsInitialized=true;
      mIsSupported=false;
    }
catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      mIsInitialized=true;
      mIsSupported=false;
    }
  }
}
Program: 32060
Project: 32060
Buggy source:
/** 
 * Search a call from its dedicated room id.
 * @param roomId the room id
 * @return the IMXCall if it exists
 */
public IMXCall getCallWithRoomId(String roomId){
  Collection<IMXCall> calls;
synchronized (this) {
    calls=mCallsByCallId.values();
  }
  for (  IMXCall call : calls) {
    if (TextUtils.equals(roomId,call.getRoom().getRoomId())) {
      if (TextUtils.equals(call.getCallState(),IMXCall.CALL_STATE_ENDED)) {
        Log.d(LOG_TAG,"String_Node_Str" + call.getCallId() + "String_Node_Str");
synchronized (this) {
          mCallsByCallId.remove(call.getCallId());
        }
      }
 else {
        return call;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Search a call from its dedicated room id.
 * @param roomId the room id
 * @return the IMXCall if it exists
 */
public IMXCall getCallWithRoomId(String roomId){
  ArrayList<IMXCall> calls;
synchronized (this) {
    calls=new ArrayList<>(mCallsByCallId.values());
  }
  for (  IMXCall call : calls) {
    if (TextUtils.equals(roomId,call.getRoom().getRoomId())) {
      if (TextUtils.equals(call.getCallState(),IMXCall.CALL_STATE_ENDED)) {
        Log.d(LOG_TAG,"String_Node_Str" + call.getCallId() + "String_Node_Str");
synchronized (this) {
          mCallsByCallId.remove(call.getCallId());
        }
      }
 else {
        return call;
      }
    }
  }
  return null;
}
Program: 32061
Project: 32061
Buggy source:
/** 
 * The connection is terminated
 * @param endCallReasonId the reason of the call ending
 */
private void terminate(final int endCallReasonId){
  Log.d(LOG_TAG,"String_Node_Str" + endCallReasonId);
  if (isCallEnded()) {
    return;
  }
  dispatchOnStateDidChange(CALL_STATE_ENDED);
  boolean isPeerConnectionFactoryAllowed=false;
  if (null != mPeerConnection) {
    mPeerConnection.dispose();
    mPeerConnection=null;
    isPeerConnectionFactoryAllowed=true;
  }
  if (null != mVideoSource) {
    mVideoSource.dispose();
    mVideoSource=null;
  }
  if (null != mAudioSource) {
    mAudioSource.dispose();
    mAudioSource=null;
  }
  if (isPeerConnectionFactoryAllowed && (null != mPeerConnectionFactory)) {
    mPeerConnectionFactory.dispose();
    mPeerConnectionFactory=null;
  }
  if (null != mCallView) {
    mCallView.setVisibility(View.GONE);
    mCallView=null;
  }
  mUIThreadHandler.post(new Runnable(){
    @Override public void run(){
      dispatchOnCallEnd(endCallReasonId);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * The connection is terminated
 * @param endCallReasonId the reason of the call ending
 */
private void terminate(final int endCallReasonId){
  Log.d(LOG_TAG,"String_Node_Str" + endCallReasonId);
  if (isCallEnded()) {
    return;
  }
  dispatchOnStateDidChange(CALL_STATE_ENDED);
  boolean isPeerConnectionFactoryAllowed=false;
  if (null != mPeerConnection) {
    mPeerConnection.dispose();
    mPeerConnection=null;
    isPeerConnectionFactoryAllowed=true;
  }
  if (null != mVideoSource) {
    mVideoSource.dispose();
    mVideoSource=null;
  }
  if (null != mAudioSource) {
    mAudioSource.dispose();
    mAudioSource=null;
  }
  if (isPeerConnectionFactoryAllowed && (null != mPeerConnectionFactory)) {
    mPeerConnectionFactory.dispose();
    mPeerConnectionFactory=null;
  }
  if (null != mCallView) {
    final View fCallView=mCallView;
    fCallView.post(new Runnable(){
      @Override public void run(){
        fCallView.setVisibility(View.GONE);
      }
    }
);
    mCallView=null;
  }
  mUIThreadHandler.post(new Runnable(){
    @Override public void run(){
      dispatchOnCallEnd(endCallReasonId);
    }
  }
);
}
Program: 32062
Project: 32062
Buggy source:
@Override public void success(T t,Response response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  if ((null != mUnsentEventsManager) && !mUnsentEventsManager.getNetworkConnectivityReceiver().isConnected()) {
    Log.d(LOG_TAG,"String_Node_Str");
    mUnsentEventsManager.getNetworkConnectivityReceiver().checkNetworkConnection(mUnsentEventsManager.getContext());
  }
  try {
    if (null != mUnsentEventsManager) {
      try {
        mUnsentEventsManager.onEventSent(mApiCallback);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void success(T t,Response response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  try {
    onEventSent();
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}
Program: 32063
Project: 32063
Buggy source:
public RestAdapterCallback(String description,UnsentEventsManager unsentEventsManager,boolean ignoreEventTimeLifeOffline,ApiCallback apiCallback,RequestRetryCallBack requestRetryCallBack){
  if (null != description) {
    Log.d(LOG_TAG,"String_Node_Str" + description + "String_Node_Str");
  }
  this.mEventDescription=description;
  this.mIgnoreEventTimeLifeInOffline=ignoreEventTimeLifeOffline;
  this.mApiCallback=apiCallback;
  this.mRequestRetryCallBack=requestRetryCallBack;
  this.mUnsentEventsManager=unsentEventsManager;
}

Fixed version (ground truth):
/** 
 * Constructor with unsent events management
 * @param description the event description
 * @param ignoreEventTimeLifeOffline true to ignore the event time when resending the event.
 * @param unsentEventsManager the unsent events manager
 * @param apiCallback the callback
 * @param requestRetryCallBack the retry callback
 */
public RestAdapterCallback(String description,UnsentEventsManager unsentEventsManager,boolean ignoreEventTimeLifeOffline,ApiCallback apiCallback,RequestRetryCallBack requestRetryCallBack){
  if (null != description) {
    Log.d(LOG_TAG,"String_Node_Str" + description + "String_Node_Str");
  }
  this.mEventDescription=description;
  this.mIgnoreEventTimeLifeInOffline=ignoreEventTimeLifeOffline;
  this.mApiCallback=apiCallback;
  this.mRequestRetryCallBack=requestRetryCallBack;
  this.mUnsentEventsManager=unsentEventsManager;
}
Program: 32065
Project: 32065
Buggy source:
@Override public void success(PublicRoomsResponse publicRoomsResponse,Response response){
  callback.onSuccess(publicRoomsResponse.total_room_count_estimate);
}

Fixed version (ground truth):
@Override public void success(PublicRoomsResponse publicRoomsResponse,Response response){
  onEventSent();
  callback.onSuccess(publicRoomsResponse.total_room_count_estimate);
}
Program: 32066
Project: 32066
Buggy source:
/** 
 * Get the public rooms count. The count can be null.
 * @param callback the public rooms count callbacks
 */
public void getPublicRoomsCount(final ApiCallback<Integer> callback){
  final String description="String_Node_Str";
  PublicRoomsParams publicRoomsParams=new PublicRoomsParams();
  publicRoomsParams.server=null;
  publicRoomsParams.limit=0;
  publicRoomsParams.since=null;
  mApi.publicRooms(publicRoomsParams,new RestAdapterCallback<PublicRoomsResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getPublicRoomsCount(callback);
    }
  }
){
    @Override public void success(    PublicRoomsResponse publicRoomsResponse,    Response response){
      callback.onSuccess(publicRoomsResponse.total_room_count_estimate);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get the public rooms count. The count can be null.
 * @param callback the public rooms count callbacks
 */
public void getPublicRoomsCount(final ApiCallback<Integer> callback){
  final String description="String_Node_Str";
  PublicRoomsParams publicRoomsParams=new PublicRoomsParams();
  publicRoomsParams.server=null;
  publicRoomsParams.limit=0;
  publicRoomsParams.since=null;
  mApi.publicRooms(publicRoomsParams,new RestAdapterCallback<PublicRoomsResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getPublicRoomsCount(callback);
    }
  }
){
    @Override public void success(    PublicRoomsResponse publicRoomsResponse,    Response response){
      onEventSent();
      callback.onSuccess(publicRoomsResponse.total_room_count_estimate);
    }
  }
);
}
Program: 32067
Project: 32067
Buggy source:
/** 
 * Attempt a user/password log in.
 * @param user the user name
 * @param password the password
 * @param callback the callback success and failure callback
 */
public void loginWithPassword(final String user,final String password,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str" + user;
  PasswordLoginParams params=new PasswordLoginParams();
  params.type="String_Node_Str";
  if (android.util.Patterns.EMAIL_ADDRESS.matcher(user).matches()) {
    params.address=user;
    params.medium="String_Node_Str";
  }
 else {
    params.user=user;
  }
  params.password=password;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithPassword(user,password,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/password log in.
 * @param user the user name
 * @param password the password
 * @param callback the callback success and failure callback
 */
public void loginWithPassword(final String user,final String password,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str" + user;
  PasswordLoginParams params=new PasswordLoginParams();
  params.type="String_Node_Str";
  if (android.util.Patterns.EMAIL_ADDRESS.matcher(user).matches()) {
    params.address=user;
    params.medium="String_Node_Str";
  }
 else {
    params.user=user;
  }
  params.password=password;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithPassword(user,password,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32068
Project: 32068
Buggy source:
@Override public void success(JsonObject jsonObject,Response response){
  mCredentials=gson.fromJson(jsonObject,Credentials.class);
  callback.onSuccess(mCredentials);
}

Fixed version (ground truth):
@Override public void success(JsonObject jsonObject,Response response){
  onEventSent();
  mCredentials=gson.fromJson(jsonObject,Credentials.class);
  callback.onSuccess(mCredentials);
}
Program: 32069
Project: 32069
Buggy source:
/** 
 * Attempt a user/token log in.
 * @param user the user name
 * @param token the token
 * @param txn_id the client transactio id to include in the request
 * @param callback the callback success and failure callback
 */
public void loginWithToken(final String user,final String token,final String txn_id,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenLoginParams params=new TokenLoginParams();
  params.user=user;
  params.token=token;
  params.txn_id=txn_id;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithToken(user,token,txn_id,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/token log in.
 * @param user the user name
 * @param token the token
 * @param txn_id the client transactio id to include in the request
 * @param callback the callback success and failure callback
 */
public void loginWithToken(final String user,final String token,final String txn_id,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenLoginParams params=new TokenLoginParams();
  params.user=user;
  params.token=token;
  params.txn_id=txn_id;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithToken(user,token,txn_id,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32070
Project: 32070
Buggy source:
/** 
 * Retrieve the login supported flows. It should be done to check before displaying a default login form.
 * @param callback the callback success and failure callback
 */
public void getSupportedLoginFlows(final ApiCallback<List<LoginFlow>> callback){
  final String description="String_Node_Str";
  mApi.login(new RestAdapterCallback<LoginFlowResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getSupportedLoginFlows(callback);
    }
  }
){
    @Override public void success(    LoginFlowResponse loginFlowResponse,    Response response){
      callback.onSuccess(loginFlowResponse.flows);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Retrieve the login supported flows. It should be done to check before displaying a default login form.
 * @param callback the callback success and failure callback
 */
public void getSupportedLoginFlows(final ApiCallback<List<LoginFlow>> callback){
  final String description="String_Node_Str";
  mApi.login(new RestAdapterCallback<LoginFlowResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getSupportedLoginFlows(callback);
    }
  }
){
    @Override public void success(    LoginFlowResponse loginFlowResponse,    Response response){
      onEventSent();
      callback.onSuccess(loginFlowResponse.flows);
    }
  }
);
}
Program: 32071
Project: 32071
Buggy source:
/** 
 * Request an account creation
 * @param params the registration parameters
 * @param callback the callbacks
 */
public void register(final RegistrationParams params,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  mApi.register(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      register(params,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Request an account creation
 * @param params the registration parameters
 * @param callback the callbacks
 */
public void register(final RegistrationParams params,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  mApi.register(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      register(params,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32072
Project: 32072
Buggy source:
/** 
 * Attempt a user/password registration.
 * @param callback the callback success and failure callback
 */
public void refreshTokens(final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenRefreshParams params=new TokenRefreshParams();
  params.refresh_token=mCredentials.refreshToken;
  mApi.tokenrefresh(params,new RestAdapterCallback<TokenRefreshResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    TokenRefreshResponse tokenreponse,    Response response){
      mCredentials.refreshToken=tokenreponse.refresh_token;
      mCredentials.accessToken=tokenreponse.access_token;
      if (null != callback) {
        callback.onSuccess(mCredentials);
      }
    }
    /** 
 * Called if there is a network error.
 * @param e the exception
 */
    public void onNetworkError(    Exception e){
      if (null != callback) {
        callback.onNetworkError(e);
      }
    }
    /** 
 * Called in case of a Matrix error.
 * @param e the Matrix error
 */
    public void onMatrixError(    MatrixError e){
      if (null != callback) {
        callback.onMatrixError(e);
      }
    }
    /** 
 * Called for some other type of error.
 * @param e the exception
 */
    public void onUnexpectedError(    Exception e){
      if (null != callback) {
        callback.onUnexpectedError(e);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/password registration.
 * @param callback the callback success and failure callback
 */
public void refreshTokens(final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenRefreshParams params=new TokenRefreshParams();
  params.refresh_token=mCredentials.refreshToken;
  mApi.tokenrefresh(params,new RestAdapterCallback<TokenRefreshResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    TokenRefreshResponse tokenreponse,    Response response){
      onEventSent();
      mCredentials.refreshToken=tokenreponse.refresh_token;
      mCredentials.accessToken=tokenreponse.access_token;
      if (null != callback) {
        callback.onSuccess(mCredentials);
      }
    }
  }
);
}
Program: 32073
Project: 32073
Buggy source:
/** 
 * Get the user's avatar URL.
 * @param userId the user id
 * @param callback the callback to return the URL on success
 */
public void avatarUrl(final String userId,final ApiCallback<String> callback){
  final String description="String_Node_Str" + userId;
  mApi.avatarUrl(userId,new RestAdapterCallback<User>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      avatarUrl(userId,callback);
    }
  }
){
    @Override public void success(    User user,    Response response){
      callback.onSuccess(user.getAvatarUrl());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get the user's avatar URL.
 * @param userId the user id
 * @param callback the callback to return the URL on success
 */
public void avatarUrl(final String userId,final ApiCallback<String> callback){
  final String description="String_Node_Str" + userId;
  mApi.avatarUrl(userId,new RestAdapterCallback<User>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      avatarUrl(userId,callback);
    }
  }
){
    @Override public void success(    User user,    Response response){
      onEventSent();
      callback.onSuccess(user.getAvatarUrl());
    }
  }
);
}
Program: 32074
Project: 32074
Buggy source:
@Override public void success(ThreePidsResponse threePidsResponse,Response response){
  if (null != callback) {
    callback.onSuccess(threePidsResponse.threepids);
  }
}

Fixed version (ground truth):
@Override public void success(ThreePidsResponse threePidsResponse,Response response){
  onEventSent();
  if (null != callback) {
    callback.onSuccess(threePidsResponse.threepids);
  }
}
Program: 32075
Project: 32075
Buggy source:
/** 
 * Get the user's display name.
 * @param userId the user id
 * @param callback the callback to return the name on success
 */
public void displayname(final String userId,final ApiCallback<String> callback){
  final String description="String_Node_Str" + userId;
  mApi.displayname(userId,new RestAdapterCallback<User>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      displayname(userId,callback);
    }
  }
){
    @Override public void success(    User user,    Response response){
      callback.onSuccess(user.displayname);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get the user's display name.
 * @param userId the user id
 * @param callback the callback to return the name on success
 */
public void displayname(final String userId,final ApiCallback<String> callback){
  final String description="String_Node_Str" + userId;
  mApi.displayname(userId,new RestAdapterCallback<User>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      displayname(userId,callback);
    }
  }
){
    @Override public void success(    User user,    Response response){
      onEventSent();
      callback.onSuccess(user.displayname);
    }
  }
);
}
Program: 32076
Project: 32076
Buggy source:
/** 
 * List all 3PIDs linked to the Matrix user account.
 * @param callback the asynchronous callback called with the response
 */
public void threePIDs(final ApiCallback<List<ThirdPartyIdentifier>> callback){
  final String description="String_Node_Str";
  mApi.threePIDs(new RestAdapterCallback<ThreePidsResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    ThreePidsResponse threePidsResponse,    Response response){
      if (null != callback) {
        callback.onSuccess(threePidsResponse.threepids);
      }
    }
    /** 
 * Called if there is a network error.
 * @param e the exception
 */
    public void onNetworkError(    Exception e){
      if (null != callback) {
        callback.onNetworkError(e);
      }
    }
    /** 
 * Called in case of a Matrix error.
 * @param e the Matrix error
 */
    public void onMatrixError(    MatrixError e){
      if (null != callback) {
        callback.onMatrixError(e);
      }
    }
    /** 
 * Called for some other type of error.
 * @param e the exception
 */
    public void onUnexpectedError(    Exception e){
      if (null != callback) {
        callback.onUnexpectedError(e);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * List all 3PIDs linked to the Matrix user account.
 * @param callback the asynchronous callback called with the response
 */
public void threePIDs(final ApiCallback<List<ThirdPartyIdentifier>> callback){
  final String description="String_Node_Str";
  mApi.threePIDs(new RestAdapterCallback<ThreePidsResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    ThreePidsResponse threePidsResponse,    Response response){
      onEventSent();
      if (null != callback) {
        callback.onSuccess(threePidsResponse.threepids);
      }
    }
  }
);
}
Program: 32077
Project: 32077
Buggy source:
/** 
 * Request an email validation token.
 * @param address the email address
 * @param clientSecret the client secret number
 * @param attempt the attemp count
 * @param nextLink the next link.
 * @param callback the callback.
 */
public void requestValidationToken(final String address,final String clientSecret,final int attempt,final String nextLink,final ApiCallback<RequestEmailValidationResponse> callback){
  final String description="String_Node_Str";
  mApi.requestEmailValidation(clientSecret,address,new Integer(attempt),nextLink,new RestAdapterCallback<RequestEmailValidationResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      requestValidationToken(address,clientSecret,attempt,nextLink,callback);
    }
  }
){
    @Override public void success(    RequestEmailValidationResponse requestEmailValidationResponse,    Response response){
      requestEmailValidationResponse.email=address;
      requestEmailValidationResponse.clientSecret=clientSecret;
      requestEmailValidationResponse.sendAttempt=attempt;
      callback.onSuccess(requestEmailValidationResponse);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Request an email validation token.
 * @param address the email address
 * @param clientSecret the client secret number
 * @param attempt the attemp count
 * @param nextLink the next link.
 * @param callback the callback.
 */
public void requestValidationToken(final String address,final String clientSecret,final int attempt,final String nextLink,final ApiCallback<RequestEmailValidationResponse> callback){
  final String description="String_Node_Str";
  mApi.requestEmailValidation(clientSecret,address,new Integer(attempt),nextLink,new RestAdapterCallback<RequestEmailValidationResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      requestValidationToken(address,clientSecret,attempt,nextLink,callback);
    }
  }
){
    @Override public void success(    RequestEmailValidationResponse requestEmailValidationResponse,    Response response){
      onEventSent();
      requestEmailValidationResponse.email=address;
      requestEmailValidationResponse.clientSecret=clientSecret;
      requestEmailValidationResponse.sendAttempt=attempt;
      callback.onSuccess(requestEmailValidationResponse);
    }
  }
);
}
Program: 32079
Project: 32079
Buggy source:
/** 
 * A network connection has been retrieved.
 */
public void onNetworkAvailable(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (mIsNetworkSuspended) {
    mIsNetworkSuspended=false;
    if (mPaused) {
      Log.d(LOG_TAG,"String_Node_Str");
    }
 else {
      Log.d(LOG_TAG,"String_Node_Str");
      mIsCatchingUp=false;
synchronized (mSyncObject) {
        mSyncObject.notify();
      }
    }
  }
 else {
    Log.d(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * A network connection has been retrieved.
 */
private void onNetworkAvailable(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (mIsNetworkSuspended) {
    mIsNetworkSuspended=false;
    if (mPaused) {
      Log.d(LOG_TAG,"String_Node_Str");
    }
 else {
      Log.d(LOG_TAG,"String_Node_Str");
      mIsCatchingUp=false;
synchronized (mSyncObject) {
        mSyncObject.notify();
      }
    }
  }
 else {
    Log.d(LOG_TAG,"String_Node_Str");
  }
}
Program: 32081
Project: 32081
Buggy source:
/** 
 * The connection is terminated
 * @param endCallReasonId the reason of the call ending
 */
private void terminate(final int endCallReasonId){
  Log.d(LOG_TAG,"String_Node_Str" + endCallReasonId);
  if (isCallEnded()) {
    return;
  }
  dispatchOnStateDidChange(CALL_STATE_ENDED);
  boolean isPeerConnectionFactoryAllowed=false;
  if (null != mPeerConnection) {
    mPeerConnection.dispose();
    mPeerConnection=null;
    isPeerConnectionFactoryAllowed=true;
  }
  if (null != mVideoSource) {
    mVideoSource.dispose();
    mVideoSource=null;
  }
  if (null != mAudioSource) {
    mAudioSource.dispose();
    mAudioSource=null;
  }
  if (isPeerConnectionFactoryAllowed && (null != mPeerConnectionFactory)) {
    mPeerConnectionFactory.dispose();
    mPeerConnectionFactory=null;
  }
  if (null != mCallView) {
    mCallView.setVisibility(View.GONE);
    mCallView=null;
  }
  mUIThreadHandler.post(new Runnable(){
    @Override public void run(){
      dispatchOnCallEnd(endCallReasonId);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * The connection is terminated
 * @param endCallReasonId the reason of the call ending
 */
private void terminate(final int endCallReasonId){
  Log.d(LOG_TAG,"String_Node_Str" + endCallReasonId);
  if (isCallEnded()) {
    return;
  }
  dispatchOnStateDidChange(CALL_STATE_ENDED);
  boolean isPeerConnectionFactoryAllowed=false;
  if (null != mPeerConnection) {
    mPeerConnection.dispose();
    mPeerConnection=null;
    isPeerConnectionFactoryAllowed=true;
  }
  if (null != mVideoSource) {
    mVideoSource.dispose();
    mVideoSource=null;
  }
  if (null != mAudioSource) {
    mAudioSource.dispose();
    mAudioSource=null;
  }
  if (isPeerConnectionFactoryAllowed && (null != mPeerConnectionFactory)) {
    mPeerConnectionFactory.dispose();
    mPeerConnectionFactory=null;
  }
  if (null != mCallView) {
    final View fCallView=mCallView;
    fCallView.post(new Runnable(){
      @Override public void run(){
        fCallView.setVisibility(View.GONE);
      }
    }
);
    mCallView=null;
  }
  mUIThreadHandler.post(new Runnable(){
    @Override public void run(){
      dispatchOnCallEnd(endCallReasonId);
    }
  }
);
}
Program: 32083
Project: 32083
Buggy source:
@Override public void success(T t,Response response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  if ((null != mUnsentEventsManager) && !mUnsentEventsManager.getNetworkConnectivityReceiver().isConnected()) {
    Log.d(LOG_TAG,"String_Node_Str");
    mUnsentEventsManager.getNetworkConnectivityReceiver().checkNetworkConnection(mUnsentEventsManager.getContext());
  }
  try {
    if (null != mUnsentEventsManager) {
      try {
        mUnsentEventsManager.onEventSent(mApiCallback);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void success(T t,Response response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  try {
    onEventSent();
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}
Program: 32084
Project: 32084
Buggy source:
public RestAdapterCallback(String description,UnsentEventsManager unsentEventsManager,boolean ignoreEventTimeLifeOffline,ApiCallback apiCallback,RequestRetryCallBack requestRetryCallBack){
  if (null != description) {
    Log.d(LOG_TAG,"String_Node_Str" + description + "String_Node_Str");
  }
  this.mEventDescription=description;
  this.mIgnoreEventTimeLifeInOffline=ignoreEventTimeLifeOffline;
  this.mApiCallback=apiCallback;
  this.mRequestRetryCallBack=requestRetryCallBack;
  this.mUnsentEventsManager=unsentEventsManager;
}

Fixed version (ground truth):
/** 
 * Constructor with unsent events management
 * @param description the event description
 * @param ignoreEventTimeLifeOffline true to ignore the event time when resending the event.
 * @param unsentEventsManager the unsent events manager
 * @param apiCallback the callback
 * @param requestRetryCallBack the retry callback
 */
public RestAdapterCallback(String description,UnsentEventsManager unsentEventsManager,boolean ignoreEventTimeLifeOffline,ApiCallback apiCallback,RequestRetryCallBack requestRetryCallBack){
  if (null != description) {
    Log.d(LOG_TAG,"String_Node_Str" + description + "String_Node_Str");
  }
  this.mEventDescription=description;
  this.mIgnoreEventTimeLifeInOffline=ignoreEventTimeLifeOffline;
  this.mApiCallback=apiCallback;
  this.mRequestRetryCallBack=requestRetryCallBack;
  this.mUnsentEventsManager=unsentEventsManager;
}
Program: 32086
Project: 32086
Buggy source:
@Override public void success(TokensChunkResponse<PublicRoom> typedResponse,Response response){
  callback.onSuccess(typedResponse.chunk);
}

Fixed version (ground truth):
@Override public void success(TokensChunkResponse<PublicRoom> typedResponse,Response response){
  onEventSent();
  callback.onSuccess(typedResponse.chunk);
}
Program: 32087
Project: 32087
Buggy source:
/** 
 * Get the list of the home server's public rooms.
 * @param callback callback to provide the list of public rooms on success
 */
public void loadPublicRooms(final ApiCallback<List<PublicRoom>> callback){
  final String description="String_Node_Str";
  mApi.publicRooms(new RestAdapterCallback<TokensChunkResponse<PublicRoom>>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loadPublicRooms(callback);
    }
  }
){
    @Override public void success(    TokensChunkResponse<PublicRoom> typedResponse,    Response response){
      callback.onSuccess(typedResponse.chunk);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get the list of the home server's public rooms.
 * @param callback callback to provide the list of public rooms on success
 */
public void loadPublicRooms(final ApiCallback<List<PublicRoom>> callback){
  final String description="String_Node_Str";
  mApi.publicRooms(new RestAdapterCallback<TokensChunkResponse<PublicRoom>>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loadPublicRooms(callback);
    }
  }
){
    @Override public void success(    TokensChunkResponse<PublicRoom> typedResponse,    Response response){
      onEventSent();
      callback.onSuccess(typedResponse.chunk);
    }
  }
);
}
Program: 32088
Project: 32088
Buggy source:
/** 
 * Attempt a user/password log in.
 * @param user the user name
 * @param password the password
 * @param callback the callback success and failure callback
 */
public void loginWithPassword(final String user,final String password,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str" + user;
  PasswordLoginParams params=new PasswordLoginParams();
  params.type="String_Node_Str";
  if (android.util.Patterns.EMAIL_ADDRESS.matcher(user).matches()) {
    params.address=user;
    params.medium="String_Node_Str";
  }
 else {
    params.user=user;
  }
  params.password=password;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithPassword(user,password,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/password log in.
 * @param user the user name
 * @param password the password
 * @param callback the callback success and failure callback
 */
public void loginWithPassword(final String user,final String password,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str" + user;
  PasswordLoginParams params=new PasswordLoginParams();
  params.type="String_Node_Str";
  if (android.util.Patterns.EMAIL_ADDRESS.matcher(user).matches()) {
    params.address=user;
    params.medium="String_Node_Str";
  }
 else {
    params.user=user;
  }
  params.password=password;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithPassword(user,password,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32089
Project: 32089
Buggy source:
@Override public void success(JsonObject jsonObject,Response response){
  mCredentials=gson.fromJson(jsonObject,Credentials.class);
  callback.onSuccess(mCredentials);
}

Fixed version (ground truth):
@Override public void success(JsonObject jsonObject,Response response){
  onEventSent();
  mCredentials=gson.fromJson(jsonObject,Credentials.class);
  callback.onSuccess(mCredentials);
}
Program: 32090
Project: 32090
Buggy source:
/** 
 * Attempt a user/token log in.
 * @param user the user name
 * @param token the token
 * @param txn_id the client transactio id to include in the request
 * @param callback the callback success and failure callback
 */
public void loginWithToken(final String user,final String token,final String txn_id,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenLoginParams params=new TokenLoginParams();
  params.user=user;
  params.token=token;
  params.txn_id=txn_id;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithToken(user,token,txn_id,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/token log in.
 * @param user the user name
 * @param token the token
 * @param txn_id the client transactio id to include in the request
 * @param callback the callback success and failure callback
 */
public void loginWithToken(final String user,final String token,final String txn_id,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenLoginParams params=new TokenLoginParams();
  params.user=user;
  params.token=token;
  params.txn_id=txn_id;
  mApi.login(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      loginWithToken(user,token,txn_id,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32091
Project: 32091
Buggy source:
/** 
 * Retrieve the login supported flows. It should be done to check before displaying a default login form.
 * @param callback the callback success and failure callback
 */
public void getSupportedLoginFlows(final ApiCallback<List<LoginFlow>> callback){
  final String description="String_Node_Str";
  mApi.login(new RestAdapterCallback<LoginFlowResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getSupportedLoginFlows(callback);
    }
  }
){
    @Override public void success(    LoginFlowResponse loginFlowResponse,    Response response){
      callback.onSuccess(loginFlowResponse.flows);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Retrieve the login supported flows. It should be done to check before displaying a default login form.
 * @param callback the callback success and failure callback
 */
public void getSupportedLoginFlows(final ApiCallback<List<LoginFlow>> callback){
  final String description="String_Node_Str";
  mApi.login(new RestAdapterCallback<LoginFlowResponse>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      getSupportedLoginFlows(callback);
    }
  }
){
    @Override public void success(    LoginFlowResponse loginFlowResponse,    Response response){
      onEventSent();
      callback.onSuccess(loginFlowResponse.flows);
    }
  }
);
}
Program: 32092
Project: 32092
Buggy source:
/** 
 * Request an account creation
 * @param params the registration parameters
 * @param callback the callbacks
 */
public void register(final RegistrationParams params,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  mApi.register(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      register(params,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Request an account creation
 * @param params the registration parameters
 * @param callback the callbacks
 */
public void register(final RegistrationParams params,final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  mApi.register(params,new RestAdapterCallback<JsonObject>(description,mUnsentEventsManager,callback,new RestAdapterCallback.RequestRetryCallBack(){
    @Override public void onRetry(){
      register(params,callback);
    }
  }
){
    @Override public void success(    JsonObject jsonObject,    Response response){
      onEventSent();
      mCredentials=gson.fromJson(jsonObject,Credentials.class);
      callback.onSuccess(mCredentials);
    }
  }
);
}
Program: 32093
Project: 32093
Buggy source:
/** 
 * Attempt a user/password registration.
 * @param callback the callback success and failure callback
 */
public void refreshTokens(final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenRefreshParams params=new TokenRefreshParams();
  params.refresh_token=mCredentials.refreshToken;
  mApi.tokenrefresh(params,new RestAdapterCallback<TokenRefreshResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    TokenRefreshResponse tokenreponse,    Response response){
      mCredentials.refreshToken=tokenreponse.refresh_token;
      mCredentials.accessToken=tokenreponse.access_token;
      if (null != callback) {
        callback.onSuccess(mCredentials);
      }
    }
    /** 
 * Called if there is a network error.
 * @param e the exception
 */
    public void onNetworkError(    Exception e){
      if (null != callback) {
        callback.onNetworkError(e);
      }
    }
    /** 
 * Called in case of a Matrix error.
 * @param e the Matrix error
 */
    public void onMatrixError(    MatrixError e){
      if (null != callback) {
        callback.onMatrixError(e);
      }
    }
    /** 
 * Called for some other type of error.
 * @param e the exception
 */
    public void onUnexpectedError(    Exception e){
      if (null != callback) {
        callback.onUnexpectedError(e);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attempt a user/password registration.
 * @param callback the callback success and failure callback
 */
public void refreshTokens(final ApiCallback<Credentials> callback){
  final String description="String_Node_Str";
  TokenRefreshParams params=new TokenRefreshParams();
  params.refresh_token=mCredentials.refreshToken;
  mApi.tokenrefresh(params,new RestAdapterCallback<TokenRefreshResponse>(description,mUnsentEventsManager,callback,null){
    @Override public void success(    TokenRefreshResponse tokenreponse,    Response response){
      onEventSent();
      mCredentials.refreshToken=tokenreponse.refresh_token;
      mCredentials.accessToken=tokenreponse.access_token;
      if (null != callback) {
        callback.onSuccess(mCredentials);
      }
    }
  }
);
}