Re: [Hessianobjc-user] solved - was Re: enum
Status: Alpha
Brought to you by:
cocoa_dood
|
From: Tore H. <ha...@pv...> - 2008-01-05 00:44:13
|
Hello.
Anyone able to take a look at this one? And perhaps commit an
acceptable fix?
- Tore.
On Dec 17, 2007, at 01:43, Tore Halset wrote:
> Hello.
>
> Okay, I found a solution. Looks like hessian serialize a enum variable
> as a Map with a single key, but no value. Here is a working patch that
> fixes my problem.
>
> Index: BBSHessianDecoder.m
> ===================================================================
> --- BBSHessianDecoder.m (revision 92)
> +++ BBSHessianDecoder.m (working copy)
> @@ -251,6 +251,11 @@
> //read the type
> id key = [self decodeObjectForCode:objectTag];
> [dataInputStream read:&objectTag maxLength:1];
> + if(objectTag == 'z') {
> + // java enum are serialized by hessian using a Map
> with a single key, but no value
> + [dict setObject:[NSNull null] forKey:key];
> + break;
> + }
> id value = [self decodeObjectForCode:objectTag];
> if(key != nil) {
> if(value == nil) {
>
>
> Regards,
> - Tore.
>
> On Dec 17, 2007, at 01:17, Tore Halset wrote:
>
>> Hello.
>>
>> Sorry, but the map is not related to TreeMap, but encoding a enum.
>> This enum is burryed far down in the object graph, but I have
>> isolated
>> this by trying everything with the transient-keyword.
>>
>> The problem is this instanse variable:
>> protected LifecycleEvent callbackType;
>>
>> This is how LifecycleEvent look like:
>> public enum LifecycleEvent {
>> PRE_PERSIST, PRE_REMOVE, PRE_UPDATE, POST_PERSIST, POST_REMOVE,
>> POST_UPDATE, POST_LOAD;
>> }
>>
>> Here is a output from tcpdump.
>>
>> 0x0410: 0000 074d 7400 296f 7267 2e61 7061
>> 6368 ...Mt.)org.apach
>> 0x0420: 652e 6361 7965 6e6e 652e 6d61 702e 4361
>> e.cayenne.map.Ca
>> 0x0430: 6c6c 6261 636b 4465 7363 7269 7074 6f72
>> llbackDescriptor
>> 0x0440: 5300 0c63 616c 6c62 6163 6b54 7970 654d
>> S..callbackTypeM
>> 0x0450: 7400 256f 7267 2e61 7061 6368 652e 6361 t.
>> %org.apache.ca
>> 0x0460: 7965 6e6e 652e 6d61 702e 4c69 6665 6379
>> yenne.map.Lifecy
>> 0x0470: 636c 6545 7665 6e74 5300 0b50 5245 5f50
>> cleEventS..PRE_P
>> 0x0480: 4552 5349 5354 7a53 000f 6361 6c6c 6261
>> ERSISTzS..callba
>> 0x0490: 636b 4d65 7468 6f64 7356 7400 176a 6176
>> ckMethodsVt..jav
>> 0x04a0: 612e 7574 696c 2e4c 696e 6b65 6448 6173
>> a.util.LinkedHas
>> 0x04b0: 6853 6574 6c00 0000 007a 7a4d 7400 296f
>> hSetl....zzMt.)o
>> 0x04c0: 7267 2e61 7061 6368 652e 6361 7965 6e6e
>> rg.apache.cayenn
>> 0x04d0: 652e 6d61 702e 4361 6c6c 6261 636b 4465
>> e.map.CallbackDe
>> 0x04e0: 7363 7269 7074 6f72 5300 0c63 616c 6c62
>> scriptorS..callb
>> 0x04f0: 6163 6b54 7970 654d 7400 256f 7267 2e61 ackTypeMt.
>> %org.a
>> 0x0500: 7061 6368 652e 6361 7965 6e6e 652e 6d61
>> pache.cayenne.ma
>> 0x0510: 702e 4c69 6665 6379 636c 6545 7665 6e74
>> p.LifecycleEvent
>> 0x0520: 5300 0a50 5245 5f52 454d 4f56 457a 5300
>> S..PRE_REMOVEzS.
>>
>> Anyone know where to start on the objc side of it?
>>
>> - Tore.
>>
>> On Dec 13, 2007, at 01:17, Tore Halset wrote:
>>
>>> Hello.
>>>
>>> I was able to decode java.util.TreeMap with HessianObjC before, but
>>> now (after leopard?), they are just decoded as null. The TreeMap
>>> is a
>>> member of a mapped class.
>>>
>>> Anyone else seen something like this?
>>>
>>> Regards,
>>> - Tore.
>>>
>>> -------------------------------------------------------------------------
>>> SF.Net email is sponsored by:
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services
>>> for just about anything Open Source.
>>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>>> _______________________________________________
>>> Hessianobjc-user mailing list
>>> Hes...@li...
>>> https://lists.sourceforge.net/lists/listinfo/hessianobjc-user
>>>
>>
>>
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by:
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services
>> for just about anything Open Source.
>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>> _______________________________________________
>> Hessianobjc-user mailing list
>> Hes...@li...
>> https://lists.sourceforge.net/lists/listinfo/hessianobjc-user
>>
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Hessianobjc-user mailing list
> Hes...@li...
> https://lists.sourceforge.net/lists/listinfo/hessianobjc-user
>
|