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

Allow to fail on primitives in constructor with failOnNullForPrimitives=true #881

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

dstepanov
Copy link
Contributor

Fixes #880

@dstepanov dstepanov requested review from graemerocher and yawkat June 26, 2024 07:58
@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label Jun 26, 2024
@@ -803,6 +817,7 @@ public static final class DerProperty<B, P> {
.orElse(null);
this.explicitlyRequired = annotationMetadata.booleanValue(SerdeConfig.class, SerdeConfig.REQUIRED)
.orElse(false);
this.explicitlyRequiredForConstructor = explicitlyRequired || argument.isPrimitive() && failOnNullForPrimitives;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.explicitlyRequiredForConstructor = explicitlyRequired || argument.isPrimitive() && failOnNullForPrimitives;
this.explicitlyRequiredForConstructor = explicitlyRequired || (argument.isPrimitive() && failOnNullForPrimitives);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? Having trouble reading it?

Copy link
Member

Choose a reason for hiding this comment

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

yes, no idea about the precedence rules for the logical operators

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just like in math * / AND has a priority :D

…ionConfiguration.java

Co-authored-by: Jonas Konrad <jonas.konrad@oracle.com>
Copy link

@dstepanov dstepanov merged commit b948b55 into 2.10.x Jun 27, 2024
17 checks passed
@dstepanov dstepanov deleted the kotlinnul branch June 27, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants