@Override /* package */ void validateDelete() { synchronized (mutex) { super.validateDelete(); if (!isAuthenticated() && isDirty()) { throw new IllegalArgumentException("Cannot delete a ParseUser that is not authenticated."); } } }
@Override /* package */ void validateSave() { synchronized (mutex) { if (getObjectId() == null) { throw new IllegalArgumentException( "Cannot save a ParseUser until it has been signed up. Call signUp first."); } if (isAuthenticated() || !isDirty() || isCurrentUser()) { return; } } if (!Parse.isLocalDatastoreEnabled()) { // This might be a different of instance of the currentUser, so we need to check objectIds ParseUser current = ParseUser.getCurrentUser(); //TODO (grantland): possible blocking disk i/o if (current != null && getObjectId().equals(current.getObjectId())) { return; } } throw new IllegalArgumentException("Cannot save a ParseUser that is not authenticated."); }