Bug in Code

0 views
Skip to first unread message

williamc

unread,
Feb 9, 2009, 11:17:36 PM2/9/09
to ObjectiveResource
There's a bug in the code that results in certain class names not
being serialized properly when doing a findRemote call on the object
ID. This bug existed iin the object_resource zip file that I
downloaded:


FromXMLElementDelegate.m (Around line 52)
//Start of the root object
else if (parsedObject == nil && [elementName isEqualToString:
[self.targetClass xmlElementName]]) {
NSLog(@"starting on the root object");
self.parsedObject = [[[self.targetClass alloc] init] autorelease];
[self.unclosedProperties addObject:[NSArray arrayWithObjects:
[elementName camelize], self.parsedObject, nil]];
self.currentPropertyName = [elementName camelize];
}

elementName is not being camelized before being compared to
xmlElementName. To fix this elementname needs to be camelized:
else if (parsedObject == nil && [[elementName camelize]
isEqualToString:[self.targetClass xmlElementName]]) {


This is a pretty significant bug that prevents XML from serializing
properly.


Josh Vickery

unread,
Feb 10, 2009, 8:36:57 AM2/10/09
to objectiv...@googlegroups.com
This does look like a bug. I created a ticket to track this on
lighthouse: http://yfactorial.lighthouseapp.com/projects/18393/tickets/40-bug-in-deserializing-camelcase-in-fromxmldelegate

Thanks for the finding this williamc!

Josh
Reply all
Reply to author
Forward
0 new messages