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

docs: replace com.vaadin.hilla.Nonnull usages #4155

Open
wants to merge 13 commits into
base: latest
Choose a base branch
from

Conversation

sissbruecker
Copy link
Contributor

@sissbruecker sissbruecker commented Feb 27, 2025

Fixes #4156
Fixes vaadin/hilla#3350

Replaces usages of the deprecated com.vaadin.hilla.Nonnull annotation in examples with the jspecify variant.

@sissbruecker sissbruecker requested a review from taefi February 27, 2025 10:01
@github-actions github-actions bot added the Language unchecked English language and AsciiDoc formatting checks haven't been done label Feb 27, 2025
@sissbruecker sissbruecker removed the Language unchecked English language and AsciiDoc formatting checks haven't been done label Feb 27, 2025
Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

LGTM, but also updated the recommendation of Vaadin about using JSpecify NonNull and Nullable annotations. Asking @cromoteca for a second review.

@taefi taefi requested a review from cromoteca February 27, 2025 18:12

You can use any annotation that has the name `nonnull` (case-insensitive). Below are examples of this:
While the usage of any annotation that has the name `nonnull` (case-insensitive) is supported, Vaadin recommends using the `org.jspecify.annotations.NonNull`. Below are some examples of other supported `nonnull` annotations:

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also remove the bullet list below. It's not up-to-date and brings more confusion than value.

Copy link
Contributor

Choose a reason for hiding this comment

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

I addressed this a while ago, so it could get merged IMO, unless there's something more to address.

@platosha platosha added the hilla label Mar 4, 2025
@taefi taefi requested a review from platosha March 6, 2025 21:44
Copy link
Contributor

@cromoteca cromoteca left a comment

Choose a reason for hiding this comment

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

I think it's a bit better like this

@@ -15,16 +15,12 @@ Types that are set as _non_nullable_ are in essence required. Whereas types that
- A collection accepts `null`, unless the collection item type is primitive.
- A map accepts `null`, unless the collection item type is primitive.

Any of these nullable types can be made non-nullable by applying a `@Nonnull` annotation.
Any of these nullable types can be made non-nullable by applying a `@NonNull` annotation. Vaadin recommends using the `@org.jspecify.annotations.NonNull`. However, the list of all supported annotations is as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Any of these nullable types can be made non-nullable by applying a `@NonNull` annotation. Vaadin recommends using the `@org.jspecify.annotations.NonNull`. However, the list of all supported annotations is as follows:
Any of these nullable types can be made non-nullable by applying a `@NonNull` annotation. Vaadin recommends using `@org.jspecify.annotations.NonNull`. The full list of supported annotations is as follows:


By default, the following annotation is supported: `org.springframework.lang.NonNullApi`.

To make any type nullable, you must add `@Nullable` annotation to it.
To make any type nullable, you must add `@Nullable` annotation to it. Vaadin recommends using the `@org.jspecify.annotations.Nullable`. However, the list of all supported annotations is as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To make any type nullable, you must add `@Nullable` annotation to it. Vaadin recommends using the `@org.jspecify.annotations.Nullable`. However, the list of all supported annotations is as follows:
To make any type nullable, you must add a `@Nullable` annotation to it. Vaadin recommends using `@org.jspecify.annotations.Nullable`. The full list of supported annotations is as follows:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants