@@ -181,13 +181,12 @@ } - initWithObject: (id)object { if (object == nil) { - Class c = [self class]; [self release]; - @throw [OFInvalidArgumentException exceptionWithClass: c]; + @throw [OFInvalidArgumentException exception]; } return [self initWithObjects: object, nil]; } @@ -372,11 +371,11 @@ OFArray *ret; id *buffer; if (range.length > SIZE_MAX - range.location || range.location + range.length < [self count]) - @throw [OFOutOfRangeException exceptionWithClass: [self class]]; + @throw [OFOutOfRangeException exception]; if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_subarray arrayWithArray: self range: range]; @@ -410,12 +409,11 @@ id *objects; size_t i, count; IMP append; if (separator == nil) - @throw [OFInvalidArgumentException - exceptionWithClass: [self class]]; + @throw [OFInvalidArgumentException exception]; count = [self count]; if (count == 0) return @""; @@ -590,11 +588,11 @@ [data addItem: &type]; [data addItems: &tmp count: sizeof(tmp)]; } else - @throw [OFOutOfRangeException exceptionWithClass: [self class]]; + @throw [OFOutOfRangeException exception]; pool = objc_autoreleasePoolPush(); i = 0; enumerator = [self objectEnumerator]; @@ -677,11 +675,11 @@ count: (int)count { of_range_t range = of_range(state->state, count); if (range.length > SIZE_MAX - range.location) - @throw [OFOutOfRangeException exceptionWithClass: [self class]]; + @throw [OFOutOfRangeException exception]; if (range.location + range.length > [self count]) range.length = [self count] - range.location; [self getObjects: objects @@ -718,12 +716,11 @@ - (OFArray*)arrayByAddingObject: (id)object { OFMutableArray *ret; if (object == nil) - @throw [OFInvalidArgumentException - exceptionWithClass: [self class]]; + @throw [OFInvalidArgumentException exception]; ret = [[self mutableCopy] autorelease]; [ret addObject: object]; [ret makeImmutable]; @@ -854,12 +851,11 @@ - (id)nextObject { if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException - exceptionWithClass: [self class] - object: array]; + exceptionWithObject: array]; if (position < count) return [array objectAtIndex: position++]; return nil; @@ -867,11 +863,10 @@ - (void)reset { if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException - exceptionWithClass: [self class] - object: array]; + exceptionWithObject: array]; position = 0; } @end