Skip to content

FMWK-467 Issue using refs with yaml file#161

Merged
tim-aero merged 2 commits intomainfrom
FMWK-467
Jul 4, 2024
Merged

FMWK-467 Issue using refs with yaml file#161
tim-aero merged 2 commits intomainfrom
FMWK-467

Conversation

@roimenashe
Copy link
Member

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 requested review from reugn and tim-aero June 18, 2024 09:39
@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
Member 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
Member 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
@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.

3 participants