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

RealmList is null in Java17 #7885

Closed
ErnestoDavidOlivaPerez opened this issue Apr 18, 2024 · 2 comments
Closed

RealmList is null in Java17 #7885

ErnestoDavidOlivaPerez opened this issue Apr 18, 2024 · 2 comments

Comments

@ErnestoDavidOlivaPerez
Copy link

How frequently does the bug occur?

Always

Description

I have a two RealmObject's called ParentObject and ChildObject. ParentObject has a RealmList of type ChildObject. When I create a ParentOject and copy it to realm using Realm.createObject(), I expect the returned value to have an empty RealmList of type ChildObject, but I find that field is null. Investigating I looking that this happens when I use Java 17, with Java 11 does not return null.

I don't know why this is happening or if it is a deliberate behaviour. I would like to give answers to these doubts I have. To solve this problem I'm going to check if the RealmList field is null and if it is, create it, at least until I get an answer.

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

To reproduce the error you can change sourceCompatibility and targetCompatibility to Java 17 inside your build.gradle file at module level.

compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
}

Version

10.16.1

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 33

Build environment

No response

Copy link

sync-by-unito bot commented Apr 18, 2024

➤ PM Bot commented:

Jira ticket: RJAVA-1258

@ErnestoDavidOlivaPerez
Copy link
Author

The error has been fixed. The next day when I went to find the problem again, I tried to do more test to find a solution or better understand what is happening. But I found that the problem had been solved. The only thing that I think could fix the problem is to clean the project. In any case I close the issue and leave my experience in case anyone needs it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant