Skip to content

Cc parent optionals fix#143

Merged
sabomichal merged 5 commits intosabomichal:masterfrom
jecede:cc-parent-optionals-fix
Dec 10, 2024
Merged

Cc parent optionals fix#143
sabomichal merged 5 commits intosabomichal:masterfrom
jecede:cc-parent-optionals-fix

Conversation

@jecede
Copy link
Copy Markdown
Contributor

@jecede jecede commented Dec 6, 2024

supports optional fields in parent classes when using the copy constructors and optional getters.

assigns a property with this.prop1 = other.getProp1().orElse(null) instead of the optional returned by the getter.

@sabomichal
Copy link
Copy Markdown
Owner

It doesn't compile. I will try to fix it.

edited the wrong part in the web editor
@jecede
Copy link
Copy Markdown
Contributor Author

jecede commented Dec 9, 2024

Sorry, i copy pasted my change in the web editor, and did this incorrectly. I moved it to the correct part of the code

@sabomichal
Copy link
Copy Markdown
Owner

The tests seems not correct, the one you modified wasn't using the getter method (no inheritance and it actually compiles ok (you have to use maven profile selftest)), so I have change it, however it is still not correct when some other options are turned on. I have pushed a branch with your fix and my modifications in this repo.

@jecede
Copy link
Copy Markdown
Contributor Author

jecede commented Dec 10, 2024

I hadn't noticed the selftest profile. Updated my change to make your tests succeed, but I do not have the oversight to see if the current testcases cover everything.

@sabomichal
Copy link
Copy Markdown
Owner

Unfortunately they do not cover everything, but this something I can not fix right away.

@sabomichal sabomichal merged commit d6ef4a3 into sabomichal:master Dec 10, 2024
@sabomichal
Copy link
Copy Markdown
Owner

closes #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants