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

Handle nullabilty when converting LookupTable to DTO #3920

Merged

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Apr 13, 2023

Identify the Bug or Feature request

Fixes #3913

Description of the Change

Each reference field in LookupTable and LookupEntry is marked as @Nullable or @Nonnull for clarity. @Nonnull is enforced for deserialized fields in readResolve(), with corresponding null checks in accessors being removed. Several Boolean accessors have been changed to boolean since nullability for these fields in an internal detail.

In toDto()/fromDto(), all @Nullable fields are checked first whether a value exists prior to converting.

The visible and allowLookup flags are now included in the copy constructor so that copied tables have the same flags set.

Possible Drawbacks

None

Documentation Notes

N/A

Release Notes

  • Fixed a bug where duplicating tables would generate an error, and deleting duplicated tables would generate an error.

This change is Reviewable

Each reference field in `LookupTable` and `LookupEntry` is marked as `@Nullable` or `@Nonnull` for clarity. `@Nonnull`
is enforced for deserialized fields in `readResolve()`, with corresponding `null` checks in accessors being
removed. Several `Boolean` accessors have been changed to `boolean` since nullability for these fields in an internal
detail.

In `toDto()`/`fromDto()`, all `@Nullable` fields are checked first whether a value exists prior to converting.

The `visible` and `allowLookup` flags are now included in the copy constructor so that copied tables have the same flags
set.
@cwisniew cwisniew merged commit a035827 into RPTools:develop Apr 13, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/3913-npe-LookupTable-toDto branch April 13, 2023 17:15
@cwisniew cwisniew added the bug label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Copying table by copyTable() and deleting it spit errors
2 participants