NSString *r;
if (_key == nil) {
- r = [NSString stringWithFormat:@"nil key to be added in HashMap with object %@",
- _object ? _object : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil key to be added in HashMap with object %@",
+ (_object != nil ? _object : (id)@"<nil>")];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [r release]; r = nil;
+ [ui release]; ui = nil;
[exc raise];
}
if (_object == nil) {
- r = [NSString stringWithFormat:
- @"nil object to be added in HashMap for key %@",
- _key ? _key : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil object to be added in HashMap for key %@",
+ _key ? _key : (id)@"<nil>"];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [r release]; r = nil;
+ [ui release]; ui = nil;
[exc raise];
}
}
if (_object != nil && _key != nil)
return;
- r = [NSString stringWithFormat:
- @"nil object to be removed in HashMap for key %@",
- _key ? _key : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil object to be removed in HashMap for key %@",
+ _key ? _key : (id)@"<nil>"];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [ui release]; ui = nil;
+ [r release]; r = nil;
[exc raise];
}
if ((root = [self __structForKey:_key]) == NULL) {
if (_index > 0) {
[NSException raise:NSRangeException
- format:@"index %d out of range in map 0x%08X",
+ format:@"index %d out of range in map 0x%p",
_index, self];
return;
}
else {
if (!(_index < root->count)) {
[NSException raise:NSRangeException
- format:@"index %d out of range in map 0x%08X length %d",
+ format:@"index %d out of range in map 0x%p length %d",
_index, self, root->count];
return;
}