No. This requires case by case analysis

On Tuesday 22 December 2015, Raquel Pau Fernández <[email protected]>
wrote:

> @Stephen,
>
> Thank you for your answer. Could you write a test to validate if a class
> that is Serializable provokes an undesired behavior?
>
>
>
> El lunes, 21 de diciembre de 2015, 22:34:53 (UTC+1), Stephen Connolly
> escribió:
>>
>> I would rather they all be Serializable so it really needs a case by case
>> evaluation
>>
>> On Monday 21 December 2015, Baptiste Mathus <[email protected]> wrote:
>>
>>> @Stephen: then wouldn't at least a PR to add a comment to the
>>> readResolve() like
>>> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/ListView.java#L112
>>> be beneficial both for the common knowledge and for you not to have to
>>> repeat yourself every few weeks? :-)
>>>
>>> Something short like:
>>>
>>> /**
>>>  * DO NOT REMOVE: see
>>> wiki.jenkins-ci.org/display/JENKINS/XStream-Why-Keep-Blah
>>>  */
>>>
>>> (Note: I can prepare that PR if so, or I wouldn't propose it).
>>>
>>> 2015-12-21 15:58 GMT+01:00 Stephen Connolly <
>>> [email protected]>:
>>>
>>>>
>>>>
>>>> On Monday 21 December 2015, Raquel Pau Fernández <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have sent a PR that removes dead code (
>>>>> https://github.com/jenkinsci/jenkins/pull/1957). Some of the
>>>>> suggested changes are to remove readResolve methods because the classes
>>>>> that contain those methods do not implement java.io.Serializable.
>>>>>
>>>>>
>>>> -1000
>>>>
>>>> Those readResolve methods are critical for XStream
>>>>
>>>>
>>>>>  XStream, as far as I know, uses the readResolve when it is dealing
>>>>> with the ObjectOutputStream and according the official Java documentation,
>>>>> just Serialiable and Externalizable elements can use readResolve.
>>>>>
>>>>>
>>>>> Then, my question is if these classes:
>>>>>
>>>>>
>>>>>    - hudson.model.ListView
>>>>>    - hudson.model.PaneStatusProperties
>>>>>    - hudson.model.ParametersAction
>>>>>    - hudson.model.Queue
>>>>>    - hudson.security.csrf.DefaultCrumbIssuer
>>>>>    - hudson.tasks.BatchFile
>>>>>    - hudson.tasks.BuildTrigger
>>>>>    - hudson.tasks.Shell
>>>>>    - hudson.tools.BatchCommandInstaller
>>>>>    - hudson.tools.CommandInstaller
>>>>>    - hudson.util.RobustReflectionConverter
>>>>>    - jenkins.model.ArtifactManagerConfiguration
>>>>>    - jenkins.security.QueueItemAuthenticatorConfiguration
>>>>>
>>>>> should be java.io.Serializable or the methods need to be removed?
>>>>>
>>>>
>>>> Neither.
>>>>
>>>> It might be beneficial to make them Serializable, but there is no
>>>> requirement to do so. XStream.toXML doesn't need to take a Serializable and
>>>> will use writeReplace methods if present... Vice versa for fromXML and
>>>> readResolve
>>>>
>>>> In general these classes may not be Serializable as they are not viewed
>>>> safe for sending over remoting (which uses ObectOutputStream) so there are
>>>> two different needs and hence 4 different scenarios, only one of which
>>>> doesn't need readResolve
>>>>
>>>>
>>>>>
>>>>> Thank you in advance
>>>>>
>>>>>
>>>>
>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Jenkins Developers" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jenkinsci-dev/d670360c-93f8-4382-84f4-694039a02f8f%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/d670360c-93f8-4382-84f4-694039a02f8f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>> --
>>>> Sent from my phone
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Jenkins Developers" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMwt5Co3qBe55Mv1YbazWydjW7vqf5Ph4bs1g-UtmNubGQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMwt5Co3qBe55Mv1YbazWydjW7vqf5Ph4bs1g-UtmNubGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>> Sauvez un arbre,
>>> Mangez un castor !
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS6Hjo8o2OEv6H7Z1%3DrgYogFRWRnMMZsQNAdb9HBrJnVMA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS6Hjo8o2OEv6H7Z1%3DrgYogFRWRnMMZsQNAdb9HBrJnVMA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Sent from my phone
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','jenkinsci-dev%[email protected]');>
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/29bc768d-b55b-482a-a0f6-479dd537e6cb%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/29bc768d-b55b-482a-a0f6-479dd537e6cb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMxM1Zo_qqt%2BPL22gfYFU0eL_E_Z9-3dE%3DGLQKnRwsWwQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to