-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: Remove usage of Guava #206
Conversation
858c196
to
78d3b96
Compare
Concerning MessageHelperTest: there is no garantuee, which of message2,message3 won the deduplication, so I suggest this assertion:
BTW: MessageHelper#toMessageObjectOrComposition expects a Set of Messages, but Message does not implement equals/hashcode. So the Set Sematics are not used and the Set is defacto a List of Messages. Internally, duplicates are removed via a special stream using a messageSupplier which in turn uses a TreeSet which in turn is configured with a Comparator which compares the name of the message. |
Concerning Async*AnnotationScannerTest: The order of entries in map is not garantueed, so it should be:
instead of |
78d3b96
to
d174127
Compare
@tvahrst Thanks for the suggestions. They work like a charm 😄 Regarding the Is the I would say that this is the point that should be discussed. Are 2 Messages with same name, but different description equals? If that's the case, then we could probably modify the @timonback @tvahrst what do you think? |
@ctasada That is a good question, whether a message is equal or not. At this point, Springwolf only uses the name of the message - as the name is used in the ui through the schema name. As soon as we have methods which get detected multiple times (i.e. KafkaListener and AsyncSubscriber annotation together), we find the same message payload class twice, but only want to show it once - first one wins. I am fine to continue to use only the name for checking the equality of a message. When looking at the spec, there is the option to use Message#messageId for a unique name. Feel free to look into it. |
@timonback I think this PR is ready for merge. I don't think this PR introduces any behavioral change. The suggested change regarding Message comparison I think should be attacked in it's own PR. I can take a look later |
The Guava library is really convenient, but over time, most of its features became part of the vanilla Java. This PR removes the usage of Guava, replacing it by Java equivalents.
The 'javax.annotation.Nullable' was, in fact, imported from 'com.google.code.findbugs:jsr305' which was a transitive Guava dependency. We replace this annotation by the SpringFramework equivalent.
d174127
to
7aba4db
Compare
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.
Thank you very much to go through all these occurrences and replacing them with the latest Java features in order to remove the guava dependency!
The Guava library is really convenient, but over time, most of its features became part
of the vanilla Java.
This PR removes the usage of Guava, replacing it by Java equivalents.