@@ -15,20 +15,20 @@ */ #include "config.h" #include +#include #import "OFArray.h" #import "OFArray_subarray.h" #import "OFArray_adjacent.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" @@ -101,13 +101,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 OFArray + (void)initialize @@ -160,14 +162,17 @@ } - init { if (object_getClass(self) == [OFArray 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]; } @@ -196,45 +201,57 @@ } - initWithObject: (id)firstObject arguments: (va_list)arguments { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithArray: (OFArray*)array { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithObjects: (id const*)objects count: (size_t)count { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithSerialization: (OFXMLElement*)element { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)getObjects: (id*)buffer inRange: (of_range_t)range { @@ -271,12 +288,12 @@ return [[OFMutableArray alloc] initWithArray: self]; } - (id)objectAtIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (id)objectAtIndexedSubscript: (size_t)index { return [self objectAtIndex: index];