Fuel bug. Array class substitution is not working

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fuel bug. Array class substitution is not working

Denis Kudriashov
Hi.

I detect strange bug. Substitution Array class is not working. Try this:

s := ByteArray new writeStream.
serializer := FLSerializer newDefault.
serializer analyzer 
        when: [ :o | o==Array ] 
        substituteBy: [ :o |  #instead ].
   serializer serialize: {Array} on: s
.
s2 := s contents readStream.


object := (FLMaterializer newDefault materializeFrom: s2) root.


Interesting that other classes are working correctly.
I open issue 17669
Reply | Threaded
Open this post in threaded view
|

Re: Fuel bug. Array class substitution is not working

Denis Kudriashov
And maybe it is not issue and behaviour is correct.

We want to substitute class with some object but full object graph includes instance of that class. In such case Fuel will use substitution as reference to class of serializable instance. And on materialisation substitution can not understand #fuelNew: protocol.

2016-02-22 11:36 GMT+01:00 Denis Kudriashov <[hidden email]>:
Hi.

I detect strange bug. Substitution Array class is not working. Try this:

s := ByteArray new writeStream.
serializer := FLSerializer newDefault.
serializer analyzer 
        when: [ :o | o==Array ] 
        substituteBy: [ :o |  #instead ].
   serializer serialize: {Array} on: s
.
s2 := s contents readStream.


object := (FLMaterializer newDefault materializeFrom: s2) root.


Interesting that other classes are working correctly.
I open issue 17669

Reply | Threaded
Open this post in threaded view
|

Re: Fuel bug. Array class substitution is not working

Max Leske
No, this is definitely not intended to fail. We’ll take a look.

On 22 Feb 2016, at 13:07, Denis Kudriashov <[hidden email]> wrote:

And maybe it is not issue and behaviour is correct.

We want to substitute class with some object but full object graph includes instance of that class. In such case Fuel will use substitution as reference to class of serializable instance. And on materialisation substitution can not understand #fuelNew: protocol.

2016-02-22 11:36 GMT+01:00 Denis Kudriashov <[hidden email]>:
Hi.

I detect strange bug. Substitution Array class is not working. Try this:

s := ByteArray new writeStream.
serializer := FLSerializer newDefault.
serializer analyzer 
        when: [ :o | o==Array ] 
        substituteBy: [ :o |  #instead ].
   serializer serialize: {Array} on: s
.
s2 := s contents readStream.


object := (FLMaterializer newDefault materializeFrom: s2) root.


Interesting that other classes are working correctly.
I open issue 17669