-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add serialVersionUID to MessageHistory #3738
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
Add serialVersionUID to MessageHistory #3738
Conversation
e11ebd9
to
633527f
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.
Yes, I agree it is pointless to waste our time figuring out how to test it in JUnit.
It is really would be enough to test it once.
We may just accept this PR and merge.
And then ask @german22 to test his project against latest 5.5.10-SNAPSHOT
.
Just check the project and other similar entities are OK, even if they just only have serialVersionUID = 1L
.
Although I feel as we have to add an explicit one to all the ApplicationEvent
impls, and exceptions, like ReplyRequiredException
...
WDYT?
...g-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java
Outdated
Show resolved
Hide resolved
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.
After removing that suppression we got now this:
/home/runner/work/spring-integration/spring-integration/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java:312: warning: [serial] serializable class Entry has no definition of serialVersionUID
public static class Entry extends Properties {
^
So, it has to be fixed with an explicit (extracted) serialVersionUID
as well.
We are not ready to merge this yet. We have to come up somehow with a solution which could deal with old and new class versions... |
fa9fde4
to
8d6068a
Compare
...java/org/springframework/integration/support/serializer/VersionTolerantJavaDeserializer.java
Outdated
Show resolved
Hide resolved
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's great, @onobc !
But I believe we should leave such a workaround outside of the framework code even for the current version we are going to fix it for.
Better to have a single workaround class (even with that VersionTolerantObjectInputStream
as nested) and show it in the issue for end-user.
The fix has to be like an explicit for the current MessageHistory
class version - serialVersionUID = -2340400235574314134L
.
So, it is not going to be a break point in the next 6.0
.
(I don't think we will migrate a MessageHistory
to the record
as IDE suggests...)
Sounds good @artembilan . Yep, I was not wanting to actually merge it in - but figure out where to put it. The docs idea in a single class sounds good. I will put it in a branch locally (just to keep around for later if needed), consolidate it into single class, and produce a HowTo in the issue w/ the code sample. I will close this PR once I update the issue w/ the sample code.
Yep, that was in the javadoc at the top of the deserializer on how to use. I will make it clear in the issue when I comment.
Yeh - no changes to framework should come out of this PR at all. |
I mean, Chris, that current |
2834e4e
to
7aefb05
Compare
Ahh yeh. Makes sense. Explicitly set the |
Ignore the latest commits. I intended those to a separate branch for safe-keeping. I will clean this up shortly. |
7aefb05
to
323c88a
Compare
public final class MessageHistory implements List<Properties>, Serializable { | ||
|
||
private static final long serialVersionUID = -2340400235574314134L; |
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.
cbono@cbono-a01 server-main % serialver -classpath spring-context-5.3.14.jar:spring-context-support-5.3.14.jar:spring-core-5.3.14.jar:spring-integration-core-5.5.8-SNAPSHOT.jar:spring-jcl-5.3.14.jar:spring-messaging-5.3.14.jar org.springframework.integration.history.MessageHistory
org.springframework.integration.history.MessageHistory: private static final long serialVersionUID = -2340400235574314134L;
/** | ||
* Inner class for each Entry in the history. | ||
*/ | ||
public static class Entry extends Properties { | ||
|
||
private static final long serialVersionUID = -8225834391885601079L; |
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.
cbono@cbono-a01 server-main % serialver -classpath spring-context-5.3.14.jar:spring-context-support-5.3.14.jar:spring-core-5.3.14.jar:spring-integration-core-5.5.8-SNAPSHOT.jar:spring-jcl-5.3.14.jar:spring-messaging-5.3.14.jar org.springframework.integration.history.MessageHistory.Entry
org.springframework.integration.history.MessageHistory.Entry: private static final long serialVersionUID = -8225834391885601079L;
323c88a
to
87b5c40
Compare
... and cherry-picked to Thanks, @onobc ; looking forward for more! |
@artembilan not sure what test to add for this one. We could do this:
test/resources
MessageHIistory
.I'm not sure if this is worth adding to automation though. It is somewhat a one-off and should not be an issue again in this class.
Fixes gh-3737