-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-10083: Apply Nullability to core events
, leader
, message
and resource
packages
#10320
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
GH-10083: Apply Nullability to core events
, leader
, message
and resource
packages
#10320
Conversation
leader
, message
and resource
packagesevents
, leader
, message
and resource
packages
Related to: spring-projects#10083 This commit applies Nullability to core `events`, `leader`, `leader.event`, `message` and `resource` packages Signed-off-by: Tran Ngoc Nhan <[email protected]>
6abb470
to
6a91a4a
Compare
Signed-off-by: Tran Ngoc Nhan <[email protected]>
private volatile ResourcePatternResolver patternResolver; | ||
|
||
private volatile CollectionFilter<Resource> filter; | ||
private volatile @Nullable CollectionFilter<Resource> filter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and remove volatile
on all the properties.
It is really an anti-pattern to change state of the component at runtime.
Therefore, we treat all of them as state fixed after initialization phase.
Therefore, no need in extra ticks over volatile
barrier.
} | ||
} | ||
else { | ||
inputMessage = MessageBuilder.withPayload(new byte[0]).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to throw an exception instead.
How that happened that AdviceMessage
was serialized without an inputMessage
?
So, the state is illegal.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I wasn’t sure about the behavior in this case, so I decided to initialize the value.
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Can we re-run the build? I haven’t touched the related context package. |
I know. Thank you! |
Related to: #10083