@@ -14,20 +14,20 @@ * file. */ #include "config.h" +#include #include #include #import "OFMutableArray.h" #import "OFMutableArray_adjacent.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" @@ -144,13 +144,15 @@ { } - (void)dealloc { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; - [super dealloc]; /* Get rid of a stupid warning */ + [self doesNotRecognizeSelector: _cmd]; + abort(); + + /* Get rid of a stupid warning */ + [super dealloc]; } @end @implementation OFMutableArray + (void)initialize @@ -168,14 +170,17 @@ } - init { if (object_getClass(self) == [OFMutableArray class]) { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } return [super init]; } @@ -197,12 +202,12 @@ } - (void)insertObject: (id)object atIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)insertObjectsFromArray: (OFArray*)array atIndex: (size_t)index { @@ -223,12 +228,12 @@ } - (void)replaceObjectAtIndex: (size_t)index withObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)setObject: (id)object atIndexedSubscript: (size_t)index { @@ -277,12 +282,12 @@ } } - (void)removeObjectAtIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)removeObject: (id)object { size_t i, count;