@@ -14,13 +14,13 @@ * file. */ #include "config.h" -#import "OFMutableDictionary_hashtable.h" +#include -#import "OFNotImplementedException.h" +#import "OFMutableDictionary_hashtable.h" static struct { Class isa; } placeholder; @@ -106,13 +106,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 OFMutableDictionary + (void)initialize @@ -130,24 +132,27 @@ } - init { if (object_getClass(self) == [OFMutableDictionary 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]; } - (void)setObject: (id)object forKey: (id)key { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)setObject: (id)object forKeyedSubscript: (id)key { @@ -155,12 +160,12 @@ forKey: key]; } - (void)removeObjectForKey: (id)key { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - copy { return [[OFDictionary alloc] initWithDictionary: self];