Skip to content

Allow empty collection to insert/insertOrUpdate(Collection)#3106

Merged
zaki50 merged 4 commits intoreleasesfrom
my/fix_issue3103
Jul 5, 2016
Merged

Allow empty collection to insert/insertOrUpdate(Collection)#3106
zaki50 merged 4 commits intoreleasesfrom
my/fix_issue3103

Conversation

@zaki50
Copy link
Copy Markdown
Contributor

@zaki50 zaki50 commented Jul 1, 2016

fixes #3103

  • add tests
  • fix implementation
  • update changelog

@zaki50
Copy link
Copy Markdown
Contributor Author

zaki50 commented Jul 1, 2016

review this please @realm/java

}
});
assertEquals(0, realm.where(Cat.class).count());
} finally {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being called in tearDown() as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this Realm is opened in line 410.

@zaki50
Copy link
Copy Markdown
Contributor Author

zaki50 commented Jul 5, 2016

review this please @realm/java

@cmelchior
Copy link
Copy Markdown
Contributor

👍

@zaki50
Copy link
Copy Markdown
Contributor Author

zaki50 commented Jul 5, 2016

retest this please

*
* @param realm reference to the {@link Realm} where the objects will be inserted.
* @param objects Collection of {@link RealmObject} to insert or update.
* @param objects Collection of {@link RealmObject} to insert or update. This must not be empty.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that "must not" is a bit too strong. If objects is empty, it is a no-op (we don't throw an exception). Maybe "should not" is better.

Copy link
Copy Markdown
Contributor Author

@zaki50 zaki50 Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. If the objects is empty, some mediators actually throws an exception.

see #3106 (diff)

@kneth
Copy link
Copy Markdown
Contributor

kneth commented Jul 5, 2016

👍 with a minor comment on documentation.

@zaki50 zaki50 force-pushed the my/fix_issue3103 branch from 2ebb0f4 to e8f262b Compare July 5, 2016 10:56
@zaki50
Copy link
Copy Markdown
Contributor Author

zaki50 commented Jul 5, 2016

retest this please

@beeender
Copy link
Copy Markdown
Contributor

beeender commented Jul 5, 2016

👍

@zaki50
Copy link
Copy Markdown
Contributor Author

zaki50 commented Jul 5, 2016

retest this please

@zaki50 zaki50 merged commit 66536af into releases Jul 5, 2016
@zaki50 zaki50 deleted the my/fix_issue3103 branch July 5, 2016 12:39
@zaki50 zaki50 removed the S:Review label Jul 5, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants