Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android/vf/3.1.6 vf001 #260

Closed
wants to merge 2 commits into from
Closed

Android/vf/3.1.6 vf001 #260

wants to merge 2 commits into from

Conversation

bmeike
Copy link
Contributor

@bmeike bmeike commented Mar 12, 2024

This is the VF for CBSE-16470
I would very much appreciate additional eyes on it. It does three things:

  1. Native JSONEncoder_finishJSON now throws a LiteCore exception instead of returning null. All of the methods that use it wrap the (checked) exception in (unchecked) IllegalStateException. No API change; Container toJSON methods cannot return null.
  2. The context object that becomes the parent of the tree of children belonging to a ResultSet, now holds a reference to the ResultSet. There will be references to the ResultSet until the last child goes away
  3. The close() method on ResultSet no longer does anything. Instead the Fleece object is freed by a finalizer. The finalizer code is insane because Android does not appear to handle the use of locks correctly.

@bmeike bmeike requested review from pasin and borrrden March 12, 2024 21:47
@bmeike bmeike self-assigned this Mar 12, 2024
Copy link
Member

@borrrden borrrden left a comment

Choose a reason for hiding this comment

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

I think the goal is accomplished, looks like one place now is somewhat of a no-op (marked with comment)

@@ -569,7 +574,7 @@ private void assertInBounds(int index) {
}

private void assertOpen() {
if (rs.isClosed()) {
if (context.getResultSet().isClosed()) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, is this ever going to be true? Doesn't the no-op close prevent this?

Copy link
Contributor Author

@bmeike bmeike Mar 13, 2024

Choose a reason for hiding this comment

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

yeah. good point.
I may leave it along because it doesn't hurt anything and messing with it is more changes...

@bmeike
Copy link
Contributor Author

bmeike commented Mar 13, 2024

Thanks for the review, Jim!

@bmeike bmeike closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants