Skip to content

[Documentation][Fix] Streamable example using RequiredArgConstructor#2397

Closed
cailliaud wants to merge 1 commit into
spring-projects:mainfrom
cailliaud:patch-1
Closed

[Documentation][Fix] Streamable example using RequiredArgConstructor#2397
cailliaud wants to merge 1 commit into
spring-projects:mainfrom
cailliaud:patch-1

Conversation

@cailliaud

@cailliaud cailliaud commented Jun 29, 2021

Copy link
Copy Markdown

Example of Streamable using @RequiredArgConstructor(staticName = "of") won't generate a static "of" waiting a Streamable if the field is not final or at least with @lombok.NonNull.
Based on Lombok documentation : https://projectlombok.org/features/constructor

Without a static constructor "of" containing the Streamable it will throw an :

java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class [...] Products
  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Example of Streamable using @RequiredArgConstructor(staticName = "of") won't generate a static "of" if the field streamable is not final or at least with @nonnull.

It will generate an java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class [...] Products
@pivotal-cla

Copy link
Copy Markdown

@cailliaud Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 29, 2021
@pivotal-cla

Copy link
Copy Markdown

@cailliaud Thank you for signing the Contributor License Agreement!

@cailliaud cailliaud changed the title [Lombok] RequiredArgConstructor : private or @NonNull fields [Documentation]FIx example using RequiredArgConstructor : private or @NonNull fields Jun 29, 2021
@cailliaud cailliaud changed the title [Documentation]FIx example using RequiredArgConstructor : private or @NonNull fields [Documentation][Fix] Streamable example using RequiredArgConstructor Jun 29, 2021
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 12, 2021
@mp911de

mp911de commented Jul 12, 2021

Copy link
Copy Markdown
Member

Thanks for your contribution. That was already fixed with #2391

@mp911de mp911de closed this Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: duplicate A duplicate of another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants