-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[MNG-8024] Make WrapperProperties and WrapperList serizalizable. #1388
Conversation
This solves the two, but there are more... --- https://issues.apache.org/jira/browse/MNG-8024
We need to extend the unit test https://github.com/apache/maven/blob/master/maven-model/src/test/java/org/apache/maven/model/SerializationTest.java to exercise the actual problem. |
@@ -27,16 +27,21 @@ | |||
import java.util.function.Supplier; | |||
|
|||
class WrapperList<T, U> extends AbstractList<T> { |
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.
What's the point is the WrapperList
itself does not implement Serializable
?
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.
We need a clear unit test. Basic serialisation is already supported, so something's wrong...
The WrapperList
and WrapperProperties
should not actually be used during serialisation, as those objects are not present in fields.
I wonder if the problem is when serializing part of the model instead of the whole |
Yes, that is exactly what is happening, the incremental build basically taks "bits" of model and would like to serialize those with DataOutputStream... |
I'm not sure we should support this use case, as I think the whole model will be serialised anyway. The lambdas in the list/properties objects do retain a reference to the parent up to the Model. This is needed in order to implement the modification methods while keeping the original reference. So while this may actually make things work, I'm not completely sure we should do it... It may be easier to simplify check if there's a |
Another way would be to generate writeObject / readObject methods that will actually delegate to... the delegates from the v4 model. |
Superseded by #1433 |
This solves the two, but there are more...
https://issues.apache.org/jira/browse/MNG-8024