Program: 182495
Project: 182495
Buggy source:
/** 
 * Asks the user to add an account of a specified type.  The authenticator for this account type processes this request with the appropriate user interface.  If the user does elect to create a new account, the account name is returned. <p>This method may be called from any thread, but the returned  {@link AccountManagerFuture} must not be used on the main thread.<p>This method requires the caller to hold the permission {@link android.Manifest.permission#MANAGE_ACCOUNTS}.
 * @param accountType The type of account to add; must not be null
 * @param authTokenType The type of auth token (see {@link #getAuthToken}) this account will need to be able to generate, null for none
 * @param requiredFeatures The features (see {@link #hasFeatures}) this account must have, null for none
 * @param addAccountOptions Authenticator-specific options for the request,may be null or empty
 * @param activity The {@link Activity} context to use for launching a newauthenticator-defined sub-Activity to prompt the user to create an account; used only to call startActivity(); if null, the prompt will not be launched directly, but the necessary  {@link Intent}will be returned to the caller instead
 * @param callback Callback to invoke when the request completes,null for no callback
 * @param handler {@link Handler} identifying the callback thread,null for the main thread
 * @return An {@link AccountManagerFeature} which resolves to a Bundle withthese fields if activity was specified and an account was created: <ul> <li>  {@link #KEY_ACCOUNT_NAME} - the name of the account created<li>  {@link #KEY_ACCOUNT_TYPE} - the type of the account</ul> If no activity was specified, the returned Bundle contains only {@link #KEY_INTENT} with the {@link Intent} needed to launch theactual account creation process. <p>If an error occurred,  {@link AccountManagerFuture#getResult()} throws:<ul> <li>  {@link AuthenticatorException} if no authenticator was registered forthis account type or the authenticator failed to respond <li>  {@link OperationCanceledException} if the operation was canceled forany reason, including the user canceling the creation process <li>  {@link IOException} if the authenticator experienced an I/O problemcreating a new account, usually because of network trouble </ul>
 */
public AccountManagerFuture<Bundle> addAccount(final String accountType,final String authTokenType,final String[] requiredFeatures,final Bundle addAccountOptions,final Activity activity,AccountManagerCallback<Bundle> callback,Handler handler){
  return new AmsTask(activity,handler,callback){
    public void doWork() throws RemoteException {
      if (accountType == null) {
        Log.e(TAG,"String_Node_Str");
        set(new Bundle());
        return;
      }
      mService.addAcount(mResponse,accountType,authTokenType,requiredFeatures,activity != null,addAccountOptions);
    }
  }
.start();
}

Fixed version (ground truth):
/** 
 * Asks the user to add an account of a specified type.  The authenticator for this account type processes this request with the appropriate user interface.  If the user does elect to create a new account, the account name is returned. <p>This method may be called from any thread, but the returned  {@link AccountManagerFuture} must not be used on the main thread.<p>This method requires the caller to hold the permission {@link android.Manifest.permission#MANAGE_ACCOUNTS}.
 * @param accountType The type of account to add; must not be null
 * @param authTokenType The type of auth token (see {@link #getAuthToken}) this account will need to be able to generate, null for none
 * @param requiredFeatures The features (see {@link #hasFeatures}) this account must have, null for none
 * @param addAccountOptions Authenticator-specific options for the request,may be null or empty
 * @param activity The {@link Activity} context to use for launching a newauthenticator-defined sub-Activity to prompt the user to create an account; used only to call startActivity(); if null, the prompt will not be launched directly, but the necessary  {@link Intent}will be returned to the caller instead
 * @param callback Callback to invoke when the request completes,null for no callback
 * @param handler {@link Handler} identifying the callback thread,null for the main thread
 * @return An {@link AccountManagerFuture} which resolves to a Bundle withthese fields if activity was specified and an account was created: <ul> <li>  {@link #KEY_ACCOUNT_NAME} - the name of the account created<li>  {@link #KEY_ACCOUNT_TYPE} - the type of the account</ul> If no activity was specified, the returned Bundle contains only {@link #KEY_INTENT} with the {@link Intent} needed to launch theactual account creation process. <p>If an error occurred,  {@link AccountManagerFuture#getResult()} throws:<ul> <li>  {@link AuthenticatorException} if no authenticator was registered forthis account type or the authenticator failed to respond <li>  {@link OperationCanceledException} if the operation was canceled forany reason, including the user canceling the creation process <li>  {@link IOException} if the authenticator experienced an I/O problemcreating a new account, usually because of network trouble </ul>
 */
public AccountManagerFuture<Bundle> addAccount(final String accountType,final String authTokenType,final String[] requiredFeatures,final Bundle addAccountOptions,final Activity activity,AccountManagerCallback<Bundle> callback,Handler handler){
  return new AmsTask(activity,handler,callback){
    public void doWork() throws RemoteException {
      if (accountType == null) {
        Log.e(TAG,"String_Node_Str");
        set(new Bundle());
        return;
      }
      mService.addAcount(mResponse,accountType,authTokenType,requiredFeatures,activity != null,addAccountOptions);
    }
  }
.start();
}