@@ -14,20 +14,21 @@ * file. */ #include "config.h" +#include + #include #import "OFDictionary.h" #import "OFDictionary_hashtable.h" #import "OFArray.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" static struct { Class isa; @@ -111,13 +112,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 OFDictionary + (void)initialize @@ -181,25 +184,31 @@ } - init { if (object_getClass(self) == [OFDictionary 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]; } - initWithDictionary: (OFDictionary*)dictionary { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithObject: (id)object forKey: (id)key { @@ -237,14 +246,17 @@ - initWithObjects: (id const*)objects forKeys: (id const*)keys 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; + } } - initWithKeysAndObjects: (id)firstKey, ... { id ret; @@ -259,39 +271,45 @@ } - initWithKey: (id)firstKey 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; + } } - 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; + } } - (id)objectForKey: (id)key { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (id)objectForKeyedSubscript: (id)key { return [self objectForKey: key]; } - (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - copy { return [self retain]; @@ -439,26 +457,26 @@ return ret; } - (OFEnumerator*)objectEnumerator { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (OFEnumerator*)keyEnumerator { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state objects: (id*)objects count: (int)count_ { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } #if defined(OF_HAVE_BLOCKS) && defined(OF_HAVE_FAST_ENUMERATION) - (void)enumerateKeysAndObjectsUsingBlock: (of_dictionary_enumeration_block_t)block