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

FMWK-467 Issue using refs with yaml file #161

Merged
merged 2 commits into from
Jul 4, 2024
Merged

FMWK-467 Issue using refs with yaml file #161

merged 2 commits into from
Jul 4, 2024

Conversation

roimenashe
Copy link
Contributor

Tim: "Fixed a null pointer exception when using refs via the YAML file, caused by BatchLoad being null and reading code incorrectly assuming a valid value."

@roimenashe roimenashe added the bug Something isn't working label Jun 18, 2024
@roimenashe roimenashe self-assigned this Jun 18, 2024
@roimenashe roimenashe changed the title FMWK-467 FMWK-467 Issue using refs with yaml file Jun 18, 2024
@roimenashe roimenashe removed their assignment Jun 18, 2024
typeMapper = new ObjectReferenceMapper(ClassCache.getInstance().loadClass(clazz, mapper), ref.getLazy(), ref.getBatchLoad(), ref.getType(), mapper);
typeMapper = new ObjectReferenceMapper(
ClassCache.getInstance().loadClass(clazz, mapper),
ref.getLazy() == null ? false : ref.getLazy(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we assign defaults for lazy and batchLoad in ReferenceConfig class? that way if another place requires defaults it will be taken from a single point of truth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After consulting with Tim, we can improve it but at some point we will need a refactor of yaml/annotation config reading which will affect this place as well - I'm ok with the scope of this PR just because its only a single place of null check but later we will probably want to refactor/improve/clean some areas of the Java Object Mapper including this specific flow

# Conflicts:
#	src/main/java/com/aerospike/mapper/tools/configuration/ClassConfig.java
@tim-aero tim-aero merged commit 47b9952 into main Jul 4, 2024
6 checks passed
@tim-aero tim-aero deleted the FMWK-467 branch July 4, 2024 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants