Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -27,12 +27,10 @@ #import "OFArray.h" #import "OFDictionary.h" #import "OFThread.h" #import "OFRunLoop.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" #if defined(__MACH__) && !defined(OF_IOS) # include #elif !defined(OF_IOS) Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -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]; Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -19,12 +19,10 @@ #include #import "OFAutoreleasePool.h" #import "OFArray.h" -#import "OFNotImplementedException.h" - #import "macros.h" #ifndef OF_COMPILER_TLS # import "threading.h" # import "OFInitializationFailedException.h" @@ -159,15 +157,15 @@ [super dealloc]; } - retain { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - autorelease { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } @end Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -28,11 +28,10 @@ #import "OFBlock.h" #import "OFAllocFailedException.h" #import "OFInitializationFailedException.h" -#import "OFNotImplementedException.h" #import "macros.h" #ifdef OF_ATOMIC_OPS # import "atomic.h" #endif @@ -387,52 +386,57 @@ } #endif + alloc { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - init { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr size: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr size: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)freeMemory: (void*)ptr { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - retain { if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) @@ -469,10 +473,12 @@ Block_release(self); } - (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 Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -24,11 +24,10 @@ #import "OFConstantString.h" #import "OFString_UTF8.h" #import "OFInitializationFailedException.h" #import "OFInvalidEncodingException.h" -#import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__) # import @@ -49,47 +48,47 @@ @end @implementation OFString_const + alloc { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryWithSize: (size_t)itemSize count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr size: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)freeMemory: (void*)ptr { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - retain { return self; @@ -109,13 +108,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 OFConstantString + (void)load @@ -170,46 +171,46 @@ object_setClass(self, [OFString_const class]); } + alloc { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr size: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr size: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)freeMemory: (void*)ptr { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - retain { return self; @@ -229,13 +230,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]; } /* * In all following methods, the constant string is converted to an * OFString_UTF8 and the message sent again. Index: src/OFCountedSet.m ================================================================== --- src/OFCountedSet.m +++ src/OFCountedSet.m @@ -13,19 +13,19 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFCountedSet.h" #import "OFCountedSet_hashtable.h" #import "OFNumber.h" #import "OFString.h" #import "OFXMLElement.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" static struct { Class isa; } placeholder; @@ -96,13 +96,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 OFCountedSet + (void)initialize @@ -120,23 +122,26 @@ } - init { if (object_getClass(self) == [OFCountedSet 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]; } - (size_t)countForObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (OFString*)description { OFMutableString *ret; Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -29,11 +29,10 @@ #import "OFXMLElement.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "base64.h" @@ -557,13 +556,12 @@ { void *pool; OFXMLElement *element; if (itemSize != 1) - @throw [OFNotImplementedException - exceptionWithClass: [self class] - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class]]; pool = objc_autoreleasePoolPush(); element = [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -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 Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -26,11 +26,10 @@ #import "OFXMLElement.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" static void* copy(void *value) Index: src/OFEnumerator.m ================================================================== --- src/OFEnumerator.m +++ src/OFEnumerator.m @@ -14,34 +14,37 @@ * file. */ #include "config.h" -#import "OFEnumerator.h" +#include -#import "OFNotImplementedException.h" +#import "OFEnumerator.h" @implementation OFEnumerator - init { if (object_getClass(self) == [OFEnumerator 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]; } - (id)nextObject { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)reset { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } @end Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -57,11 +57,10 @@ #import "OFDeleteFileFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFLinkFailedException.h" #import "OFLockFailedException.h" -#import "OFNotImplementedException.h" #import "OFOpenFileFailedException.h" #import "OFOutOfMemoryException.h" #import "OFReadFailedException.h" #import "OFRenameFileFailedException.h" #import "OFSeekFailedException.h" @@ -636,14 +635,17 @@ } #endif - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithPath: (OFString*)path mode: (OFString*)mode { @@ -762,14 +764,17 @@ } - initWithPath: (OFString*)path mode: (OFString*)mode { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - autorelease { return self; @@ -789,17 +794,19 @@ return OF_RETAIN_COUNT_MAX; } - (void)dealloc { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; - [super dealloc]; /* Get rid of stupid warning */ + [self doesNotRecognizeSelector: _cmd]; + abort(); + + /* Get rid of stupid warning */ + [super dealloc]; } - (void)lowlevelSeekToOffset: (off_t)offset whence: (int)whence { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } @end Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -29,11 +29,10 @@ #import "OFTimer.h" #import "OFAlreadyConnectedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFWriteFailedException.h" #import "macros.h" Index: src/OFHash.m ================================================================== --- src/OFHash.m +++ src/OFHash.m @@ -14,45 +14,45 @@ * file. */ #include "config.h" -#import "OFHash.h" +#include -#import "OFNotImplementedException.h" +#import "OFHash.h" @implementation OFHash + (instancetype)hash { return [[[self alloc] init] autorelease]; } + (size_t)digestSize { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + (size_t)blockSize { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)updateWithBuffer: (const void*)buffer length: (size_t)length { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (uint8_t*)digest { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (BOOL)isCalculated { return calculated; } @end Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -14,20 +14,20 @@ * file. */ #include "config.h" +#include #include #include #import "OFMapTable.h" #import "OFEnumerator.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "macros.h" #define MIN_CAPACITY 16 @@ -88,14 +88,17 @@ capacity: capacity] autorelease]; } - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithKeyFunctions: (of_map_table_functions_t)keyFunctions_ valueFunctions: (of_map_table_functions_t)valueFunctions_ { @@ -622,14 +625,17 @@ @end @implementation OFMapTableEnumerator - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - OF_initWithMapTable: (OFMapTable*)mapTable_ buckets: (struct of_map_table_bucket**)buckets_ capacity: (uint32_t)capacity_ @@ -653,12 +659,12 @@ [super dealloc]; } - (void*)nextValue { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)reset { if (*mutationsPtr != mutations) Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -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; Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -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]; Index: src/OFMutableSet.m ================================================================== --- src/OFMutableSet.m +++ src/OFMutableSet.m @@ -14,17 +14,17 @@ * file. */ #include "config.h" +#include + #include #import "OFMutableSet.h" #import "OFMutableSet_hashtable.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" static struct { Class isa; } placeholder; @@ -95,13 +95,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 OFMutableSet + (void)initialize @@ -119,29 +121,32 @@ } - init { if (object_getClass(self) == [OFMutableSet 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)addObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)removeObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)minusSet: (OFSet*)set { void *pool = objc_autoreleasePoolPush(); Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -25,11 +25,10 @@ #import "OFString.h" #import "OFMutableString_UTF8.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" @@ -231,13 +230,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 OFMutableString + (void)initialize @@ -298,12 +299,12 @@ } - (void)setCharacter: (of_unichar_t)character atIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)appendUTF8String: (const char*)UTF8String { void *pool = objc_autoreleasePoolPush(); @@ -432,18 +433,18 @@ } - (void)insertString: (OFString*)string atIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)deleteCharactersInRange: (of_range_t)range { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)replaceCharactersInRange: (of_range_t)range withString: (OFString*)replacement { Index: src/OFNull.m ================================================================== --- src/OFNull.m +++ src/OFNull.m @@ -14,16 +14,17 @@ * file. */ #include "config.h" +#include + #import "OFNull.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" static OFNull *null = nil; @@ -106,10 +107,12 @@ return OF_RETAIN_COUNT_MAX; } - (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 Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -14,20 +14,21 @@ * file. */ #include "config.h" +#include + #include #import "OFNumber.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFXMLAttribute.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" #import "macros.h" #define RETURN_AS(t) \ @@ -246,11 +247,11 @@ case OF_NUMBER_UINTPTR: \ return [OFNumber numberWithUIntPtr: \ value.uintptr o [n uIntPtrValue]]; \ case OF_NUMBER_FLOAT: \ case OF_NUMBER_DOUBLE: \ - @throw [OFNotImplementedException \ + @throw [OFInvalidArgumentException \ exceptionWithClass: [self class] \ selector: _cmd]; \ default: \ @throw [OFInvalidFormatException \ exceptionWithClass: [self class]]; \ @@ -448,12 +449,17 @@ return [[[self alloc] initWithDouble: double_] autorelease]; } - init { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithBool: (BOOL)bool_ { self = [super init]; Index: src/OFObject+Serialization.m ================================================================== --- src/OFObject+Serialization.m +++ src/OFObject+Serialization.m @@ -13,19 +13,19 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFObject.h" #import "OFObject+Serialization.h" #import "OFSerialization.h" #import "OFString.h" #import "OFXMLElement.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" int _OFObject_Serialization_reference; @implementation OFObject (Serialization) @@ -34,14 +34,14 @@ void *pool; OFXMLElement *element; OFXMLElement *root; OFString *ret; - if (![self conformsToProtocol: @protocol(OFSerialization)]) - @throw [OFNotImplementedException - exceptionWithClass: [self class] - selector: @selector(stringBySerializing)]; + if (![self conformsToProtocol: @protocol(OFSerialization)]) { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } pool = objc_autoreleasePoolPush(); element = [(id)self XMLElementBySerializing]; root = [OFXMLElement elementWithName: @"serialization" Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -820,10 +820,20 @@ * but instead return the result of the superclass! * * @return The target to forward the message to */ - (id)forwardingTargetForSelector: (SEL)selector; + +/*! + * @brief Handles messages which are not understood by the receiver. + * + * @warning If you override this method, you must make sure that it never + * returns. + * + * @param selector The selector not understood by the receiver + */ +- (void)doesNotRecognizeSelector: (SEL)selector; @end /*! * @brief A protocol for the creation of copies. */ Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -122,13 +122,16 @@ } void of_method_not_found(id obj, SEL sel) { - fprintf(stderr, "Runtime error: Selector %s is not implemented in " - "class %s!\n", sel_getName(sel), - class_getName(object_getClass(obj))); + [obj doesNotRecognizeSelector: sel]; + + /* + * Just in case doesNotRecognizeSelector: returned, even though it must + * never return. + */ abort(); } #ifdef OF_OBJFW_RUNTIME static IMP @@ -974,10 +977,16 @@ - (id)forwardingTargetForSelector: (SEL)selector { return nil; } + +- (void)doesNotRecognizeSelector: (SEL)selector +{ + @throw [OFNotImplementedException exceptionWithClass: [self class] + selector: selector]; +} - retain { #if defined(OF_ATOMIC_OPS) of_atomic_inc_32(&PRE_IVARS->retainCount); @@ -1059,24 +1068,24 @@ } /* Required to use properties with the Apple runtime */ - copyWithZone: (void*)zone { - if OF_UNLIKELY (zone != NULL) - @throw [OFNotImplementedException - exceptionWithClass: [self class] - selector: _cmd]; + if OF_UNLIKELY (zone != NULL) { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } return [(id)self copy]; } - mutableCopyWithZone: (void*)zone { - if OF_UNLIKELY (zone != NULL) - @throw [OFNotImplementedException - exceptionWithClass: [self class] - selector: _cmd]; + if OF_UNLIKELY (zone != NULL) { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } return [(id)self mutableCopy]; } /* @@ -1083,40 +1092,40 @@ * Those are needed as the root class is the superclass of the root class's * metaclass and thus instance methods can be sent to class objects as well. */ + (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + (void*)resizeMemory: (void*)pointer size: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + (void*)resizeMemory: (void*)pointer size: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + (void)freeMemory: (void*)pointer { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + retain { return self; @@ -1136,21 +1145,21 @@ { } + (void)dealloc { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + copyWithZone: (void*)zone { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } + mutableCopyWithZone: (void*)zone { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } @end Index: src/OFPlugin.m ================================================================== --- src/OFPlugin.m +++ src/OFPlugin.m @@ -25,11 +25,10 @@ #import "OFPlugin.h" #import "OFString.h" #import "OFInitializationFailedException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" #ifdef _WIN32 # define dlopen(file, mode) LoadLibrary(file) @@ -68,14 +67,17 @@ } - init { if (object_getClass(self) == [OFPlugin 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]; } Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -26,11 +26,10 @@ #import "OFProcess.h" #import "OFString.h" #import "OFArray.h" #import "OFInitializationFailedException.h" -#import "OFNotImplementedException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef _WIN32 # include @@ -298,22 +297,22 @@ - (int)fileDescriptorForReading { #ifndef _WIN32 return readPipe[0]; #else - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); #endif } - (int)fileDescriptorForWriting { #ifndef _WIN32 return writePipe[1]; #else - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); #endif } - (void)closeForWriting { Index: src/OFSeekableStream.m ================================================================== --- src/OFSeekableStream.m +++ src/OFSeekableStream.m @@ -12,20 +12,22 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#import "OFSeekableStream.h" +#include "config.h" + +#include -#import "OFNotImplementedException.h" +#import "OFSeekableStream.h" @implementation OFSeekableStream - (void)lowlevelSeekToOffset: (off_t)offset whence: (int)whence { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)seekToOffset: (off_t)offset whence: (int)whence { Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -14,17 +14,17 @@ * file. */ #include "config.h" +#include + #import "OFSet.h" #import "OFSet_hashtable.h" #import "OFString.h" #import "OFXMLElement.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" static struct { Class isa; } placeholder; @@ -94,13 +94,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 OFSet + (void)initialize @@ -153,33 +155,54 @@ } - init { if (object_getClass(self) == [OFSet 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]; } - initWithSet: (OFSet*)set { - 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 +{ + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - (id)initWithObjects: (id)firstObject, ... { id ret; @@ -191,60 +214,57 @@ va_end(arguments); return ret; } -- initWithObjects: (id const*)objects - count: (size_t)count -{ - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; -} - - 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; + } } - 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(); } - (BOOL)containsObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (OFEnumerator*)objectEnumerator { - @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(); } - (BOOL)isEqual: (id)object { OFSet *otherSet; Index: src/OFSortedList.m ================================================================== --- src/OFSortedList.m +++ src/OFSortedList.m @@ -14,39 +14,39 @@ * file. */ #include "config.h" -#import "OFSortedList.h" +#include -#import "OFNotImplementedException.h" +#import "OFSortedList.h" @implementation OFSortedList - (of_list_object_t*)appendObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (of_list_object_t*)prependObject: (id)object { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (of_list_object_t*)insertObject: (id)object beforeListObject: (of_list_object_t*)listObject { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (of_list_object_t*)insertObject: (id)object afterListObject: (of_list_object_t*)listObject { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (of_list_object_t*)insertObject: (id )object { of_list_object_t *iter; Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -36,11 +36,10 @@ #import "OFDataArray.h" #import "OFRunLoop.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "OFSetOptionFailedException.h" #import "macros.h" #import "of_asprintf.h" @@ -54,14 +53,17 @@ #endif - init { if (object_getClass(self) == [OFStream 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; + } } self = [super init]; cache = NULL; @@ -71,26 +73,26 @@ return self; } - (BOOL)lowlevelIsAtEndOfStream { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (size_t)lowlevelReadIntoBuffer: (void*)buffer length: (size_t)length { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)lowlevelWriteBuffer: (const void*)buffer length: (size_t)length { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - copy { return [self retain]; @@ -1481,38 +1483,38 @@ fcntl([self fileDescriptorForWriting], F_SETFL, writeFlags) == -1) @throw [OFSetOptionFailedException exceptionWithClass: [self class] stream: self]; #else - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); #endif } - (int)fileDescriptorForReading { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (int)fileDescriptorForWriting { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)cancelAsyncRequests { [OFRunLoop OF_cancelAsyncRequestsForStream: self]; } - (void)close { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (BOOL)OF_isWaitingForDelimiter { return waitingForDelimiter; } @end Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -16,10 +16,12 @@ #include "config.h" #define __NO_EXT_QNX +#include + #include #include #import "OFStreamObserver.h" @@ -43,11 +45,10 @@ #if defined(HAVE_SYS_SELECT_H) || defined(_WIN32) # import "OFStreamObserver_select.h" #endif #import "OFInitializationFailedException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" @@ -263,30 +264,30 @@ #endif } - (void)OF_addFileDescriptorForReading: (int)fd { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)OF_addFileDescriptorForWriting: (int)fd { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)OF_removeFileDescriptorForReading: (int)fd { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)OF_removeFileDescriptorForWriting: (int)fd { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)OF_processQueue { [mutex lock]; @@ -361,12 +362,12 @@ [self observeWithTimeout: -1]; } - (BOOL)observeWithTimeout: (double)timeout { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)cancel { #ifndef _WIN32 Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -330,13 +330,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 OFString + (void)initialize @@ -507,14 +509,17 @@ } - init { if (object_getClass(self) == [OFString 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]; } @@ -549,22 +554,28 @@ - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithString: (OFString*)string { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithUnicodeString: (const of_unichar_t*)string { return [self initWithUnicodeString: string @@ -590,14 +601,17 @@ - initWithUnicodeString: (const of_unichar_t*)string byteOrder: (of_byte_order_t)byteOrder length: (size_t)length { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithUTF16String: (const uint16_t*)string { return [self initWithUTF16String: string @@ -623,14 +637,17 @@ - initWithUTF16String: (const uint16_t*)string byteOrder: (of_byte_order_t)byteOrder length: (size_t)length { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithFormat: (OFConstantString*)format, ... { id ret; @@ -645,14 +662,17 @@ } - initWithFormat: (OFConstantString*)format 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; + } } - initWithPath: (OFString*)firstComponent, ... { id ret; @@ -667,14 +687,17 @@ } - initWithPath: (OFString*)firstComponent 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; + } } - initWithContentsOfFile: (OFString*)path { return [self initWithContentsOfFile: path @@ -926,12 +949,12 @@ return [self cStringUsingEncoding: OF_STRING_ENCODING_UTF_8]; } - (size_t)length { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (size_t)lengthOfBytesUsingEncoding: (of_string_encoding_t)encoding { switch (encoding) { @@ -970,12 +993,12 @@ return [self lengthOfBytesUsingEncoding: OF_STRING_ENCODING_UTF_8]; } - (of_unichar_t)characterAtIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)getCharacters: (of_unichar_t*)buffer inRange: (of_range_t)range { Index: src/OFString_UTF8.m ================================================================== --- src/OFString_UTF8.m +++ src/OFString_UTF8.m @@ -29,11 +29,10 @@ #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" -#import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -42,11 +42,10 @@ # include #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "OFThreadJoinFailedException.h" #import "OFThreadStartFailedException.h" #import "OFThreadStillRunningException.h" Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -14,19 +14,20 @@ * file. */ #include "config.h" +#include + #include #import "OFTimer.h" #import "OFDate.h" #import "OFRunLoop.h" #import "OFCondition.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" #import "macros.h" @implementation OFTimer @@ -202,14 +203,17 @@ } #endif - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - OF_initWithFireDate: (OFDate*)fireDate_ interval: (double)interval_ target: (id)target_ Index: src/OFXMLElement+Serialization.m ================================================================== --- src/OFXMLElement+Serialization.m +++ src/OFXMLElement+Serialization.m @@ -20,11 +20,10 @@ #import "OFXMLElement+Serialization.h" #import "OFSerialization.h" #import "OFString.h" #import "OFInvalidArgumentException.h" -#import "OFNotImplementedException.h" #import "autorelease.h" #import "macros.h" int _OFXMLElement_Serialization_reference; @@ -36,19 +35,19 @@ Class class; id object; if ((class = objc_getClass([name cStringUsingEncoding: OF_STRING_ENCODING_ASCII])) == Nil) - @throw [OFNotImplementedException exceptionWithClass: Nil]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class]]; if (![class conformsToProtocol: @protocol(OFSerialization)]) - @throw [OFNotImplementedException - exceptionWithClass: class - selector: @selector(initWithSerialization:)]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class]]; object = [[class alloc] initWithSerialization: self]; objc_autoreleasePoolPop(pool); return [object autorelease]; } @end Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -14,11 +14,13 @@ * file. */ #include "config.h" +#include #include + #include #import "OFXMLElement.h" #import "OFString.h" #import "OFArray.h" @@ -31,11 +33,10 @@ #import "OFXMLElementBuilder.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFMalformedXMLException.h" -#import "OFNotImplementedException.h" #import "OFUnboundNamespaceException.h" #import "autorelease.h" #import "macros.h" @@ -123,14 +124,17 @@ return [[[self alloc] initWithFile: path] autorelease]; } - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithName: (OFString*)name_ { return [self initWithName: name_ Index: src/OFXMLNode.m ================================================================== --- src/OFXMLNode.m +++ src/OFXMLNode.m @@ -13,29 +13,32 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFXMLNode.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFXMLNode - 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; + } } - (OFString*)stringValue { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (intmax_t)decimalValue { return [[self stringValue] decimalValue]; @@ -69,25 +72,25 @@ } - (OFString*)XMLStringWithIndentation: (unsigned int)indentation level: (unsigned int)level { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (OFString*)description { return [self XMLStringWithIndentation: 2]; } - (OFXMLElement*)XMLElementBySerializing { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - copy { return [self retain]; } @end Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFAcceptFailedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFAcceptFailedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket @@ -32,14 +32,17 @@ socket: socket] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket_ { Index: src/exceptions/OFAllocFailedException.m ================================================================== --- src/exceptions/OFAllocFailedException.m +++ src/exceptions/OFAllocFailedException.m @@ -13,61 +13,66 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFAllocFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFAllocFailedException + alloc { - @throw [OFNotImplementedException exceptionWithClass: self - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - init { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)allocMemoryForNItems: (size_t)nitems withSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr toSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void*)resizeMemory: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - (void)freeMemory: (void*)ptr { - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; + [self doesNotRecognizeSelector: _cmd]; + abort(); } - retain { return self; @@ -87,15 +92,17 @@ { } - (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]; } - (OFString*)description { return @"Allocating an object failed!"; } @end Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFAlreadyConnectedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFAlreadyConnectedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket @@ -32,14 +32,17 @@ socket: socket] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket_ { Index: src/exceptions/OFBindFailedException.m ================================================================== --- src/exceptions/OFBindFailedException.m +++ src/exceptions/OFBindFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFBindFailedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFBindFailedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket @@ -36,14 +36,17 @@ port: port] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket_ host: (OFString*)host_ Index: src/exceptions/OFChangeDirectoryFailedException.m ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.m +++ src/exceptions/OFChangeDirectoryFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFChangeDirectoryFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFChangeDirectoryFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path_ @@ -31,14 +31,17 @@ path: path_] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ { Index: src/exceptions/OFChangeFileModeFailedException.m ================================================================== --- src/exceptions/OFChangeFileModeFailedException.m +++ src/exceptions/OFChangeFileModeFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFChangeFileModeFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFChangeFileModeFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path @@ -33,14 +33,17 @@ mode: mode] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ mode: (mode_t)mode_ Index: src/exceptions/OFChangeFileOwnerFailedException.m ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.m +++ src/exceptions/OFChangeFileOwnerFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFChangeFileOwnerFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" #ifndef _WIN32 @implementation OFChangeFileOwnerFailedException + (instancetype)exceptionWithClass: (Class)class_ @@ -36,14 +36,17 @@ group: group] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ owner: (OFString*)owner_ Index: src/exceptions/OFConditionBroadcastFailedException.m ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.m +++ src/exceptions/OFConditionBroadcastFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFConditionBroadcastFailedException.h" #import "OFString.h" #import "OFCondition.h" -#import "OFNotImplementedException.h" - @implementation OFConditionBroadcastFailedException + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ condition: condition] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ condition: (OFCondition*)condition_ { Index: src/exceptions/OFConditionSignalFailedException.m ================================================================== --- src/exceptions/OFConditionSignalFailedException.m +++ src/exceptions/OFConditionSignalFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFConditionSignalFailedException.h" #import "OFString.h" #import "OFCondition.h" -#import "OFNotImplementedException.h" - @implementation OFConditionSignalFailedException + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ condition: condition] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ condition: (OFCondition*)condition_ { Index: src/exceptions/OFConditionStillWaitingException.m ================================================================== --- src/exceptions/OFConditionStillWaitingException.m +++ src/exceptions/OFConditionStillWaitingException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFConditionStillWaitingException.h" #import "OFString.h" #import "OFCondition.h" -#import "OFNotImplementedException.h" - @implementation OFConditionStillWaitingException + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ condition: condition] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ condition: (OFCondition*)condition_ { Index: src/exceptions/OFConditionWaitFailedException.m ================================================================== --- src/exceptions/OFConditionWaitFailedException.m +++ src/exceptions/OFConditionWaitFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFConditionWaitFailedException.h" #import "OFString.h" #import "OFCondition.h" -#import "OFNotImplementedException.h" - @implementation OFConditionWaitFailedException + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ condition: condition] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ condition: (OFCondition*)condition_ { Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFConnectionFailedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFConnectionFailedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket @@ -36,14 +36,17 @@ port: port] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket_ host: (OFString*)host_ Index: src/exceptions/OFCopyFileFailedException.m ================================================================== --- src/exceptions/OFCopyFileFailedException.m +++ src/exceptions/OFCopyFileFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFCopyFileFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFCopyFileFailedException + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source @@ -33,14 +33,17 @@ destinationPath: destination] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination Index: src/exceptions/OFCreateDirectoryFailedException.m ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.m +++ src/exceptions/OFCreateDirectoryFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFCreateDirectoryFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFCreateDirectoryFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path_ @@ -31,14 +31,17 @@ path: path_] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ { Index: src/exceptions/OFDeleteDirectoryFailedException.m ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.m +++ src/exceptions/OFDeleteDirectoryFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFDeleteDirectoryFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFDeleteDirectoryFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path_ @@ -31,14 +31,17 @@ path: path_] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ { Index: src/exceptions/OFDeleteFileFailedException.m ================================================================== --- src/exceptions/OFDeleteFileFailedException.m +++ src/exceptions/OFDeleteFileFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFDeleteFileFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFDeleteFileFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path_ @@ -31,14 +31,17 @@ path: path_] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ { Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFEnumerationMutationException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFEnumerationMutationException + (instancetype)exceptionWithClass: (Class)class_ object: (id)object @@ -31,14 +31,17 @@ object: object] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ object: (id)object_ { Index: src/exceptions/OFException.m ================================================================== --- src/exceptions/OFException.m +++ src/exceptions/OFException.m @@ -13,28 +13,31 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFException + (instancetype)exceptionWithClass: (Class)class_ { return [[[self alloc] initWithClass: class_] autorelease]; } - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithClass: (Class)class_ { self = [super init]; Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFHTTPRequestFailedException.h" #import "OFString.h" #import "OFHTTPRequest.h" -#import "OFNotImplementedException.h" - #import "autorelease.h" #import "common.h" @implementation OFHTTPRequestFailedException + (instancetype)exceptionWithClass: (Class)class_ @@ -35,14 +35,17 @@ result: result] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ request: (OFHTTPRequest*)request_ result: (OFHTTPRequestResult*)result_ Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFHashAlreadyCalculatedException.h" #import "OFString.h" #import "OFHash.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFHashAlreadyCalculatedException + (instancetype)exceptionWithClass: (Class)class_ hash: (OFHash*)hash @@ -32,14 +32,17 @@ hash: hash] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ hash: (OFHash*)hash { Index: src/exceptions/OFInvalidArgumentException.m ================================================================== --- src/exceptions/OFInvalidArgumentException.m +++ src/exceptions/OFInvalidArgumentException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFInvalidArgumentException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFInvalidArgumentException + (instancetype)exceptionWithClass: (Class)class_ selector: (SEL)selector_ @@ -31,14 +31,17 @@ selector: selector_] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ selector: (SEL)selector_ { Index: src/exceptions/OFInvalidJSONException.m ================================================================== --- src/exceptions/OFInvalidJSONException.m +++ src/exceptions/OFInvalidJSONException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFInvalidJSONException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFInvalidJSONException + (instancetype)exceptionWithClass: (Class)class_ line: (size_t)line { return [[[self alloc] initWithClass: class_ @@ -29,14 +29,17 @@ line: line] autorelease]; } - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithClass: (Class)class_ line: (size_t)line_ { Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFLinkFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" #ifndef _WIN32 @implementation OFLinkFailedException + (instancetype)exceptionWithClass: (Class)class_ @@ -34,14 +34,17 @@ destinationPath: destination] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFListenFailedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFListenFailedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket @@ -34,14 +34,17 @@ backLog: backlog] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket_ backLog: (int)backlog Index: src/exceptions/OFLockFailedException.m ================================================================== --- src/exceptions/OFLockFailedException.m +++ src/exceptions/OFLockFailedException.m @@ -17,12 +17,10 @@ #include "config.h" #import "OFLockFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "macros.h" @implementation OFLockFailedException + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -18,12 +18,10 @@ #import "OFMalformedXMLException.h" #import "OFString.h" #import "OFXMLParser.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFMalformedXMLException + (instancetype)exceptionWithClass: (Class)class_ parser: (OFXMLParser*)parser Index: src/exceptions/OFMemoryNotPartOfObjectException.m ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.m +++ src/exceptions/OFMemoryNotPartOfObjectException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFMemoryNotPartOfObjectException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFMemoryNotPartOfObjectException + (instancetype)exceptionWithClass: (Class)class_ pointer: (void*)ptr { return [[[self alloc] initWithClass: class_ @@ -29,14 +29,17 @@ pointer: ptr] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ pointer: (void*)ptr { Index: src/exceptions/OFNotConnectedException.m ================================================================== --- src/exceptions/OFNotConnectedException.m +++ src/exceptions/OFNotConnectedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFNotConnectedException.h" #import "OFString.h" #import "OFTCPSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFNotConnectedException + (instancetype)exceptionWithClass: (Class)class_ socket: (OFStreamSocket*)socket @@ -32,14 +32,17 @@ socket: socket] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ socket: (OFStreamSocket*)socket_ { Index: src/exceptions/OFNotImplementedException.m ================================================================== --- src/exceptions/OFNotImplementedException.m +++ src/exceptions/OFNotImplementedException.m @@ -13,10 +13,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFNotImplementedException.h" #import "OFString.h" #import "common.h" @@ -29,14 +31,17 @@ selector: selector] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ selector: (SEL)selector_ { @@ -51,16 +56,16 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"The method %s of class %@ is not or not fully implemented!", - sel_getName(selector), inClass]; + @"The selector %s is not understood by class %@ or not (fully) " + @"implemented!", sel_getName(selector), inClass]; return description; } - (SEL)selector { return selector; } @end Index: src/exceptions/OFOpenFileFailedException.m ================================================================== --- src/exceptions/OFOpenFileFailedException.m +++ src/exceptions/OFOpenFileFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFOpenFileFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFOpenFileFailedException + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path @@ -33,14 +33,17 @@ mode: mode] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ path: (OFString*)path_ mode: (OFString*)mode_ Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFReadOrWriteFailedException.h" #import "OFString.h" #import "OFStreamSocket.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFReadOrWriteFailedException + (instancetype)exceptionWithClass: (Class)class_ stream: (OFStream*)stream @@ -34,14 +34,17 @@ requestedLength: length] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ stream: (OFStream*)stream_ requestedLength: (size_t)length Index: src/exceptions/OFRenameFileFailedException.m ================================================================== --- src/exceptions/OFRenameFileFailedException.m +++ src/exceptions/OFRenameFileFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFRenameFileFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFRenameFileFailedException + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source @@ -33,14 +33,17 @@ destinationPath: destination] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFSeekFailedException.h" #import "OFString.h" #import "OFSeekableStream.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFSeekFailedException + (instancetype)exceptionWithClass: (Class)class_ stream: (OFSeekableStream*)stream @@ -36,14 +36,17 @@ whence: whence] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ stream: (OFSeekableStream*)stream_ offset: (off_t)offset_ Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFSetOptionFailedException.h" #import "OFString.h" #import "OFStream.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFSetOptionFailedException + (instancetype)exceptionWithClass: (Class)class_ stream: (OFStream*)stream @@ -32,14 +32,17 @@ stream: stream] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ stream: (OFStream*)stream_ { Index: src/exceptions/OFStillLockedException.m ================================================================== --- src/exceptions/OFStillLockedException.m +++ src/exceptions/OFStillLockedException.m @@ -17,12 +17,10 @@ #include "config.h" #import "OFStillLockedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "macros.h" @implementation OFStillLockedException + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock Index: src/exceptions/OFSymlinkFailedException.m ================================================================== --- src/exceptions/OFSymlinkFailedException.m +++ src/exceptions/OFSymlinkFailedException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFSymlinkFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" #ifndef _WIN32 @implementation OFSymlinkFailedException + (instancetype)exceptionWithClass: (Class)class_ @@ -34,14 +34,17 @@ destinationPath: destination] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination Index: src/exceptions/OFThreadJoinFailedException.m ================================================================== --- src/exceptions/OFThreadJoinFailedException.m +++ src/exceptions/OFThreadJoinFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFThreadJoinFailedException.h" #import "OFString.h" #import "OFThread.h" -#import "OFNotImplementedException.h" - @implementation OFThreadJoinFailedException + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ thread: thread] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ thread: (OFThread*)thread_ { Index: src/exceptions/OFThreadStartFailedException.m ================================================================== --- src/exceptions/OFThreadStartFailedException.m +++ src/exceptions/OFThreadStartFailedException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFThreadStartFailedException.h" #import "OFString.h" #import "OFThread.h" -#import "OFNotImplementedException.h" - @implementation OFThreadStartFailedException + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ thread: thread] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ thread: (OFThread*)thread_ { Index: src/exceptions/OFThreadStillRunningException.m ================================================================== --- src/exceptions/OFThreadStillRunningException.m +++ src/exceptions/OFThreadStillRunningException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFThreadStillRunningException.h" #import "OFString.h" #import "OFThread.h" -#import "OFNotImplementedException.h" - @implementation OFThreadStillRunningException + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ @@ -30,14 +30,17 @@ thread: thread] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ thread: (OFThread*)thread_ { Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFUnboundNamespaceException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFUnboundNamespaceException + (instancetype)exceptionWithClass: (Class)class_ namespace: (OFString*)ns @@ -38,14 +38,17 @@ prefix: prefix] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ namespace: (OFString*)ns_ { Index: src/exceptions/OFUnlockFailedException.m ================================================================== --- src/exceptions/OFUnlockFailedException.m +++ src/exceptions/OFUnlockFailedException.m @@ -17,12 +17,10 @@ #include "config.h" #import "OFUnlockFailedException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "macros.h" @implementation OFUnlockFailedException + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -13,17 +13,17 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFUnsupportedProtocolException.h" #import "OFString.h" #import "OFURL.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFUnsupportedProtocolException + (instancetype)exceptionWithClass: (Class)class_ URL: (OFURL*)url @@ -32,14 +32,17 @@ URL: url] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ URL: (OFURL*)url { Index: src/exceptions/OFUnsupportedVersionException.m ================================================================== --- src/exceptions/OFUnsupportedVersionException.m +++ src/exceptions/OFUnsupportedVersionException.m @@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFUnsupportedVersionException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - #import "common.h" @implementation OFUnsupportedVersionException + (instancetype)exceptionWithClass: (Class)class_ version: (OFString*)version @@ -31,14 +31,17 @@ version: version] autorelease]; } - initWithClass: (Class)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; + } } - initWithClass: (Class)class_ version: (OFString*)version_ {