Index: src/exceptions/OFAcceptFailedException.h ================================================================== --- src/exceptions/OFAcceptFailedException.h +++ src/exceptions/OFAcceptFailedException.h @@ -64,9 +64,9 @@ * @param socket The socket which could not accept a connection * @param errNo The errno for the error * @return An initialized accept failed exception */ - initWithSocket: (id)socket - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFAddressTranslationFailedException.h ================================================================== --- src/exceptions/OFAddressTranslationFailedException.h +++ src/exceptions/OFAddressTranslationFailedException.h @@ -46,23 +46,23 @@ * @param host The host for which translation was requested * @return A new, autoreleased address translation failed exception */ + (instancetype)exceptionWithHost: (nullable OFString *)host; ++ (instancetype)exceptionWithError: (int)error; + (instancetype)exceptionWithHost: (nullable OFString *)host error: (int)error; -+ (instancetype)exceptionWithError: (int)error; /*! * @brief Initializes an already allocated address translation failed exception. * * @param host The host for which translation was requested * @return An initialized address translation failed exception */ - initWithHost: (nullable OFString *)host; +- (instancetype)initWithError: (int)error; - (instancetype)initWithHost: (nullable OFString *)host - error: (int)error; -- (instancetype)initWithError: (int)error; + error: (int)error OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFAddressTranslationFailedException.m ================================================================== --- src/exceptions/OFAddressTranslationFailedException.m +++ src/exceptions/OFAddressTranslationFailedException.m @@ -48,35 +48,39 @@ + (instancetype)exceptionWithHost: (OFString *)host { return [[[self alloc] initWithHost: host] autorelease]; } + ++ (instancetype)exceptionWithError: (int)error +{ + return [[[self alloc] initWithError: error] autorelease]; +} + (instancetype)exceptionWithHost: (OFString *)host error: (int)error { return [[[self alloc] initWithHost: host error: error] autorelease]; } -+ (instancetype)exceptionWithError: (int)error +- init { - return [[[self alloc] initWithError: error] autorelease]; + return [self initWithHost: nil + error: 0]; } - initWithHost: (OFString *)host { - self = [super init]; - - @try { - _host = [host copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithHost: host + error: 0]; +} + +- (instancetype)initWithError: (int)error +{ + return [self initWithHost: nil + error: error]; } - (instancetype)initWithHost: (OFString *)host error: (int)error { @@ -88,19 +92,10 @@ } @catch (id e) { [self release]; @throw e; } - return self; -} - -- (instancetype)initWithError: (int)error -{ - self = [super init]; - - _error = error; - return self; } - (void)dealloc { Index: src/exceptions/OFAlreadyConnectedException.h ================================================================== --- src/exceptions/OFAlreadyConnectedException.h +++ src/exceptions/OFAlreadyConnectedException.h @@ -51,9 +51,9 @@ * @brief Initializes an already allocated already connected exception. * * @param socket The socket which is already connected * @return An initialized already connected exception */ -- initWithSocket: (nullable id)socket; +- initWithSocket: (nullable id)socket OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithSocket: (id)socket { return [[[self alloc] initWithSocket: socket] autorelease]; } + +- init +{ + return [self initWithSocket: nil]; +} - initWithSocket: (id)socket { self = [super init]; Index: src/exceptions/OFBindFailedException.h ================================================================== --- src/exceptions/OFBindFailedException.h +++ src/exceptions/OFBindFailedException.h @@ -84,9 +84,9 @@ * @return An initialized bind failed exception */ - initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangeCurrentDirectoryPathFailedException.h ================================================================== --- src/exceptions/OFChangeCurrentDirectoryPathFailedException.h +++ src/exceptions/OFChangeCurrentDirectoryPathFailedException.h @@ -65,9 +65,9 @@ * changed * @param errNo The errno of the error that occurred * @return An initialized change current directory path failed exception */ - initWithPath: (OFString *)path - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangeOwnerFailedException.h ================================================================== --- src/exceptions/OFChangeOwnerFailedException.h +++ src/exceptions/OFChangeOwnerFailedException.h @@ -78,9 +78,9 @@ * @return An initialized change owner failed exception */ - initWithPath: (OFString *)path owner: (nullable OFString *)owner group: (nullable OFString *)group - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangePermissionsFailedException.h ================================================================== --- src/exceptions/OFChangePermissionsFailedException.h +++ src/exceptions/OFChangePermissionsFailedException.h @@ -72,9 +72,9 @@ * @param errNo The errno of the error that occurred * @return An initialized change permissions failed exception */ - initWithPath: (OFString *)path permissions: (uint16_t)permissions - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionBroadcastFailedException.h ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.h +++ src/exceptions/OFConditionBroadcastFailedException.h @@ -53,9 +53,10 @@ * @brief Initializes an already allocated condition broadcast failed exception. * * @param condition The condition which could not be broadcasted * @return An initialized condition broadcast failed exception */ -- initWithCondition: (nullable OFCondition *)condition; +- initWithCondition: (nullable OFCondition *)condition + OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionBroadcastFailedException.m ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.m +++ src/exceptions/OFConditionBroadcastFailedException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } + +- init +{ + return [self initWithCondition: nil]; +} - initWithCondition: (OFCondition *)condition { self = [super init]; Index: src/exceptions/OFConditionSignalFailedException.h ================================================================== --- src/exceptions/OFConditionSignalFailedException.h +++ src/exceptions/OFConditionSignalFailedException.h @@ -53,9 +53,10 @@ * @brief Initializes an already allocated condition signal failed exception. * * @param condition The condition which could not be signaled * @return An initialized condition signal failed exception */ -- initWithCondition: (nullable OFCondition *)condition; +- initWithCondition: (nullable OFCondition *)condition + OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionSignalFailedException.m ================================================================== --- src/exceptions/OFConditionSignalFailedException.m +++ src/exceptions/OFConditionSignalFailedException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } + +- init +{ + return [self initWithCondition: nil]; +} - initWithCondition: (OFCondition *)condition { self = [super init]; Index: src/exceptions/OFConditionStillWaitingException.h ================================================================== --- src/exceptions/OFConditionStillWaitingException.h +++ src/exceptions/OFConditionStillWaitingException.h @@ -54,9 +54,10 @@ * @brief Initializes an already allocated condition still waiting exception. * * @param condition The condition for which is still being waited * @return An initialized condition still waiting exception */ -- initWithCondition: (nullable OFCondition *)condition; +- initWithCondition: (nullable OFCondition *)condition + OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionStillWaitingException.m ================================================================== --- src/exceptions/OFConditionStillWaitingException.m +++ src/exceptions/OFConditionStillWaitingException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } + +- init +{ + return [self initWithCondition: nil]; +} - initWithCondition: (OFCondition *)condition { self = [super init]; Index: src/exceptions/OFConditionWaitFailedException.h ================================================================== --- src/exceptions/OFConditionWaitFailedException.h +++ src/exceptions/OFConditionWaitFailedException.h @@ -53,9 +53,10 @@ * @brief Initializes an already allocated condition wait failed exception. * * @param condition The condition for which could not be waited * @return An initialized condition wait failed exception */ -- initWithCondition: (nullable OFCondition *)condition; +- initWithCondition: (nullable OFCondition *)condition + OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionWaitFailedException.m ================================================================== --- src/exceptions/OFConditionWaitFailedException.m +++ src/exceptions/OFConditionWaitFailedException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } + +- init +{ + return [self initWithCondition: nil]; +} - initWithCondition: (OFCondition *)condition { self = [super init]; Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -108,9 +108,9 @@ * @return An initialized connection failed exception */ - initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -56,22 +56,14 @@ - initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket { - self = [super init]; - - @try { - _host = [host copy]; - _socket = [socket retain]; - _port = port; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithHost: host + port: port + socket: socket + errNo: 0]; } - initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket Index: src/exceptions/OFCopyItemFailedException.h ================================================================== --- src/exceptions/OFCopyItemFailedException.h +++ src/exceptions/OFCopyItemFailedException.h @@ -69,9 +69,9 @@ * @param errNo The errno of the error that occurred * @return An initialized copy item failed exception */ - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCreateDirectoryFailedException.h ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.h +++ src/exceptions/OFCreateDirectoryFailedException.h @@ -63,9 +63,9 @@ * created * @param errNo The errno of the error that occurred * @return An initialized create directory failed exception */ - initWithPath: (OFString *)path - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCreateSymbolicLinkFailedException.h ================================================================== --- src/exceptions/OFCreateSymbolicLinkFailedException.h +++ src/exceptions/OFCreateSymbolicLinkFailedException.h @@ -92,9 +92,9 @@ * @param errNo The errno of the error that occurred * @return An initialized create symbolic link failed exception */ - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCreateSymbolicLinkFailedException.m ================================================================== --- src/exceptions/OFCreateSymbolicLinkFailedException.m +++ src/exceptions/OFCreateSymbolicLinkFailedException.m @@ -50,21 +50,13 @@ } - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath { - self = [super init]; - - @try { - _sourcePath = [sourcePath copy]; - _destinationPath = [destinationPath copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithSourcePath: sourcePath + destinationPath: destinationPath + errNo: 0]; } - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath errNo: (int)errNo Index: src/exceptions/OFEnumerationMutationException.h ================================================================== --- src/exceptions/OFEnumerationMutationException.h +++ src/exceptions/OFEnumerationMutationException.h @@ -52,9 +52,9 @@ * @brief Initializes an already allocated enumeration mutation exception. * * @param object The object which was mutated during enumeration * @return An initialized enumeration mutation exception */ -- initWithObject: (id)object; +- initWithObject: (id)object OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFGetOptionFailedException.h ================================================================== --- src/exceptions/OFGetOptionFailedException.h +++ src/exceptions/OFGetOptionFailedException.h @@ -62,9 +62,9 @@ * @param stream The stream for which the option could not be gotten * @param errNo The errno of the error that occurred * @return An initialized get option failed exception */ - initWithStream: (OFStream *)stream - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFHTTPRequestFailedException.h ================================================================== --- src/exceptions/OFHTTPRequestFailedException.h +++ src/exceptions/OFHTTPRequestFailedException.h @@ -68,9 +68,9 @@ * @param request The HTTP request which failed * @param response The response for the failed HTTP request * @return A new HTTP request failed exception */ - initWithRequest: (OFHTTPRequest *)request - response: (OFHTTPResponse *)response; + response: (OFHTTPResponse *)response OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFHashAlreadyCalculatedException.h ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.h +++ src/exceptions/OFHashAlreadyCalculatedException.h @@ -51,9 +51,9 @@ * @brief Initializes an already allocated hash already calculated exception. * * @param object The hash which has already been calculated * @return An initialized hash already calculated exception */ -- initWithObject: (id)object; +- initWithObject: (id)object OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFInitializationFailedException.h ================================================================== --- src/exceptions/OFInitializationFailedException.h +++ src/exceptions/OFInitializationFailedException.h @@ -47,9 +47,9 @@ * @brief Initializes an already allocated initialization failed exception. * * @param class_ The class for which initialization failed * @return An initialized initialization failed exception */ -- initWithClass: (nullable Class)class_; +- initWithClass: (nullable Class)class_ OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFInitializationFailedException.m ================================================================== --- src/exceptions/OFInitializationFailedException.m +++ src/exceptions/OFInitializationFailedException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } + +- init +{ + return [self initWithClass: Nil]; +} - initWithClass: (Class)class { self = [super init]; Index: src/exceptions/OFInvalidJSONException.h ================================================================== --- src/exceptions/OFInvalidJSONException.h +++ src/exceptions/OFInvalidJSONException.h @@ -60,9 +60,9 @@ * @param string The string containing the invalid JSON representation * @param line The line in which the parsing error was encountered * @return An initialized invalid JSON exception */ - initWithString: (nullable OFString *)string - line: (size_t)line; + line: (size_t)line OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLinkFailedException.h ================================================================== --- src/exceptions/OFLinkFailedException.h +++ src/exceptions/OFLinkFailedException.h @@ -89,9 +89,9 @@ * @param errNo The errno of the error that occurred * @return An initialized link failed exception */ - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -50,21 +50,13 @@ } - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath { - self = [super init]; - - @try { - _sourcePath = [sourcePath copy]; - _destinationPath = [destinationPath copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithSourcePath: sourcePath + destinationPath: destinationPath + errNo: 0]; } - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath errNo: (int)errNo Index: src/exceptions/OFListenFailedException.h ================================================================== --- src/exceptions/OFListenFailedException.h +++ src/exceptions/OFListenFailedException.h @@ -73,9 +73,9 @@ * @param errNo The errno of the error that occurred * @return An initialized listen failed exception */ - initWithSocket: (id)socket backLog: (int)backLog - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLockFailedException.h ================================================================== --- src/exceptions/OFLockFailedException.h +++ src/exceptions/OFLockFailedException.h @@ -47,9 +47,9 @@ * @brief Initializes an already allocated lock failed exception. * * @param lock The lock which could not be locked * @return An initialized lock failed exception */ -- initWithLock: (nullable id )lock; +- initWithLock: (nullable id )lock OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLockFailedException.m ================================================================== --- src/exceptions/OFLockFailedException.m +++ src/exceptions/OFLockFailedException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithLock: (id )lock { return [[[self alloc] initWithLock: lock] autorelease]; } + +- init +{ + return [self initWithLock: nil]; +} - initWithLock: (id )lock { self = [super init]; Index: src/exceptions/OFMalformedXMLException.h ================================================================== --- src/exceptions/OFMalformedXMLException.h +++ src/exceptions/OFMalformedXMLException.h @@ -48,9 +48,9 @@ * @brief Initializes an already allocated malformed XML exception. * * @param parser The parser which encountered malformed XML * @return An initialized malformed XML exception */ -- initWithParser: (nullable OFXMLParser *)parser; +- initWithParser: (nullable OFXMLParser *)parser OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithParser: (OFXMLParser *)parser { return [[[self alloc] initWithParser: parser] autorelease]; } + +- init +{ + return [self initWithParser: nil]; +} - initWithParser: (OFXMLParser *)parser { self = [super init]; Index: src/exceptions/OFMemoryNotPartOfObjectException.h ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.h +++ src/exceptions/OFMemoryNotPartOfObjectException.h @@ -61,9 +61,9 @@ * @param pointer A pointer to the memory that is not part of the object * @param object The object which the memory is not part of * @return An initialized memory not part of object exception */ - initWithPointer: (void *)pointer - object: (id)object; + object: (id)object OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFMoveItemFailedException.h ================================================================== --- src/exceptions/OFMoveItemFailedException.h +++ src/exceptions/OFMoveItemFailedException.h @@ -69,9 +69,9 @@ * @param errNo The errno of the error that occurred * @return An initialized move item failed exception */ - initWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFNotImplementedException.h ================================================================== --- src/exceptions/OFNotImplementedException.h +++ src/exceptions/OFNotImplementedException.h @@ -61,9 +61,9 @@ * @param selector The selector which is not or not fully implemented * @param object The object which does not (fully) implement the selector * @return An initialized not implemented exception */ - initWithSelector: (SEL)selector - object: (id)object; + object: (id)object OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFNotOpenException.h ================================================================== --- src/exceptions/OFNotOpenException.h +++ src/exceptions/OFNotOpenException.h @@ -49,9 +49,9 @@ * @brief Initializes an already allocated not open exception. * * @param object The object which is not open, connected or bound * @return An initialized not open exception */ -- initWithObject: (id)object; +- initWithObject: (id)object OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFObserveFailedException.h ================================================================== --- src/exceptions/OFObserveFailedException.h +++ src/exceptions/OFObserveFailedException.h @@ -62,9 +62,9 @@ * @param observer The observer which failed to observe * @param errNo The errno of the error that occurred * @return An initialized observe failed exception */ - initWithObserver: (OFKernelEventObserver *)observer - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFOpenItemFailedException.h ================================================================== --- src/exceptions/OFOpenItemFailedException.h +++ src/exceptions/OFOpenItemFailedException.h @@ -125,9 +125,9 @@ * @param errNo The errno of the error that occurred * @return An initialized open item failed exception */ - initWithPath: (OFString *)path mode: (nullable OFString *)mode - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFOpenItemFailedException.m ================================================================== --- src/exceptions/OFOpenItemFailedException.m +++ src/exceptions/OFOpenItemFailedException.m @@ -60,52 +60,29 @@ OF_INVALID_INIT_METHOD } - initWithPath: (OFString *)path { - self = [super init]; - - @try { - _path = [path copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithPath: path + mode: nil + errNo: 0]; } - initWithPath: (OFString *)path mode: (OFString *)mode { - self = [super init]; - - @try { - _path = [path copy]; - _mode = [mode copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithPath: path + mode: mode + errNo: 0]; } - initWithPath: (OFString *)path errNo: (int)errNo { - self = [super init]; - - @try { - _path = [path copy]; - _errNo = errNo; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithPath: path + mode: nil + errNo: errNo]; } - initWithPath: (OFString *)path mode: (OFString *)mode errNo: (int)errNo Index: src/exceptions/OFOutOfMemoryException.h ================================================================== --- src/exceptions/OFOutOfMemoryException.h +++ src/exceptions/OFOutOfMemoryException.h @@ -46,9 +46,9 @@ * @brief Initializes an already allocated no memory exception. * * @param requestedSize The size of the memory that could not be allocated * @return An initialized no memory exception */ -- initWithRequestedSize: (size_t)requestedSize; +- initWithRequestedSize: (size_t)requestedSize OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFOutOfMemoryException.m ================================================================== --- src/exceptions/OFOutOfMemoryException.m +++ src/exceptions/OFOutOfMemoryException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithRequestedSize: (size_t)requestedSize { return [[[self alloc] initWithRequestedSize: requestedSize] autorelease]; } + +- init +{ + return [self initWithRequestedSize: 0]; +} - initWithRequestedSize: (size_t)requestedSize { self = [super init]; Index: src/exceptions/OFReadOrWriteFailedException.h ================================================================== --- src/exceptions/OFReadOrWriteFailedException.h +++ src/exceptions/OFReadOrWriteFailedException.h @@ -95,9 +95,9 @@ * @param errNo The errno of the error that occurred * @return A new open file failed exception */ - initWithObject: (id)object requestedLength: (size_t)requestedLength - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -50,16 +50,13 @@ } - initWithObject: (id)object requestedLength: (size_t)requestedLength { - self = [super init]; - - _object = [object retain]; - _requestedLength = requestedLength; - - return self; + return [self initWithObject: object + requestedLength: requestedLength + errNo: 0]; } - initWithObject: (id)object requestedLength: (size_t)requestedLength errNo: (int)errNo Index: src/exceptions/OFRemoveItemFailedException.h ================================================================== --- src/exceptions/OFRemoveItemFailedException.h +++ src/exceptions/OFRemoveItemFailedException.h @@ -60,9 +60,9 @@ * @param path The path of the item which could not be removed * @param errNo The errno of the error that occurred * @return An initialized remove item failed exception */ - initWithPath: (OFString *)path - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSandboxActivationFailedException.h ================================================================== --- src/exceptions/OFSandboxActivationFailedException.h +++ src/exceptions/OFSandboxActivationFailedException.h @@ -63,9 +63,9 @@ * @param sandbox The sandbox which could not be activated * @param errNo The errno of the error that occurred * @return An initialized sandboxing failed exception */ - initWithSandbox: (OFSandbox *)sandbox - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSeekFailedException.h ================================================================== --- src/exceptions/OFSeekFailedException.h +++ src/exceptions/OFSeekFailedException.h @@ -104,9 +104,9 @@ * @return An initialized seek failed exception */ - initWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -56,17 +56,14 @@ - initWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence { - self = [super init]; - - _stream = [stream retain]; - _offset = offset; - _whence = whence; - - return self; + return [self initWithStream: stream + offset: offset + whence: whence + errNo: 0]; } - initWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence Index: src/exceptions/OFSetOptionFailedException.h ================================================================== --- src/exceptions/OFSetOptionFailedException.h +++ src/exceptions/OFSetOptionFailedException.h @@ -62,9 +62,9 @@ * @param stream The stream for which the option could not be set * @param errNo The errno of the error that occurred * @return An initialized set option failed exception */ - initWithStream: (OFStream *)stream - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFStatItemFailedException.h ================================================================== --- src/exceptions/OFStatItemFailedException.h +++ src/exceptions/OFStatItemFailedException.h @@ -80,9 +80,9 @@ * retrieved * @param errNo The errno of the error that occurred * @return An initialized stat item failed exception */ - initWithPath: (OFString *)path - errNo: (int)errNo; + errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFStatItemFailedException.m ================================================================== --- src/exceptions/OFStatItemFailedException.m +++ src/exceptions/OFStatItemFailedException.m @@ -44,20 +44,12 @@ OF_INVALID_INIT_METHOD } - initWithPath: (OFString *)path { - self = [super init]; - - @try { - _path = [path copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithPath: path + errNo: 0]; } - initWithPath: (OFString *)path errNo: (int)errNo { Index: src/exceptions/OFStillLockedException.h ================================================================== --- src/exceptions/OFStillLockedException.h +++ src/exceptions/OFStillLockedException.h @@ -47,9 +47,9 @@ * @brief Initializes an already allocated still locked exception. * * @param lock The lock which is still locked * @return An initialized still locked exception */ -- initWithLock: (nullable id )lock; +- initWithLock: (nullable id )lock OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFStillLockedException.m ================================================================== --- src/exceptions/OFStillLockedException.m +++ src/exceptions/OFStillLockedException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithLock: (id )lock { return [[[self alloc] initWithLock: lock] autorelease]; } + +- init +{ + return [self initWithLock: nil]; +} - initWithLock: (id )lock { self = [super init]; Index: src/exceptions/OFThreadJoinFailedException.h ================================================================== --- src/exceptions/OFThreadJoinFailedException.h +++ src/exceptions/OFThreadJoinFailedException.h @@ -52,9 +52,9 @@ * @brief Initializes an already allocated thread join failed exception. * * @param thread The thread which could not be joined * @return An initialized thread join failed exception */ -- initWithThread: (nullable OFThread *)thread; +- initWithThread: (nullable OFThread *)thread OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadJoinFailedException.m ================================================================== --- src/exceptions/OFThreadJoinFailedException.m +++ src/exceptions/OFThreadJoinFailedException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } + +- init +{ + return [self initWithThread: nil]; +} - initWithThread: (OFThread *)thread { self = [super init]; Index: src/exceptions/OFThreadStartFailedException.h ================================================================== --- src/exceptions/OFThreadStartFailedException.h +++ src/exceptions/OFThreadStartFailedException.h @@ -52,9 +52,9 @@ * @brief Initializes an already allocated thread start failed exception. * * @param thread The thread which could not be started * @return An initialized thread start failed exception */ -- initWithThread: (nullable OFThread *)thread; +- initWithThread: (nullable OFThread *)thread OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadStartFailedException.m ================================================================== --- src/exceptions/OFThreadStartFailedException.m +++ src/exceptions/OFThreadStartFailedException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } + +- init +{ + return [self initWithThread: nil]; +} - initWithThread: (OFThread *)thread { self = [super init]; Index: src/exceptions/OFThreadStillRunningException.h ================================================================== --- src/exceptions/OFThreadStillRunningException.h +++ src/exceptions/OFThreadStillRunningException.h @@ -52,9 +52,9 @@ * @brief Initializes an already allocated thread still running exception. * * @param thread The thread which is still running * @return An initialized thread still running exception */ -- initWithThread: (nullable OFThread *)thread; +- initWithThread: (nullable OFThread *)thread OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadStillRunningException.m ================================================================== --- src/exceptions/OFThreadStillRunningException.m +++ src/exceptions/OFThreadStillRunningException.m @@ -25,10 +25,15 @@ + (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } + +- init +{ + return [self initWithThread: nil]; +} - initWithThread: (OFThread *)thread { self = [super init]; Index: src/exceptions/OFUnboundNamespaceException.h ================================================================== --- src/exceptions/OFUnboundNamespaceException.h +++ src/exceptions/OFUnboundNamespaceException.h @@ -66,9 +66,9 @@ * @param namespace_ The namespace which is unbound * @param element The element in which the namespace was not bound * @return An initialized unbound namespace exception */ - initWithNamespace: (OFString *)namespace_ - element: (OFXMLElement *)element; + element: (OFXMLElement *)element OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnboundPrefixException.h ================================================================== --- src/exceptions/OFUnboundPrefixException.h +++ src/exceptions/OFUnboundPrefixException.h @@ -62,9 +62,9 @@ * @param prefix The prefix which is unbound * @param parser The parser which encountered the unbound prefix * @return An initialized unbound prefix exception */ - initWithPrefix: (OFString *)prefix - parser: (OFXMLParser *)parser; + parser: (OFXMLParser *)parser OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUndefinedKeyException.h ================================================================== --- src/exceptions/OFUndefinedKeyException.h +++ src/exceptions/OFUndefinedKeyException.h @@ -68,11 +68,11 @@ * * @return A new, autoreleased undefined key exception */ + (instancetype)exceptionWithObject: (id)object key: (OFString *)key - value: (id)value; + value: (nullable id)value; - init OF_UNAVAILABLE; /*! * @brief Initializes an already allocated undefined key exception. @@ -94,9 +94,9 @@ * * @return An initialized undefined key exception */ - initWithObject: (id)object key: (OFString *)key - value: (id)value; + value: (nullable id)value OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUndefinedKeyException.m ================================================================== --- src/exceptions/OFUndefinedKeyException.m +++ src/exceptions/OFUndefinedKeyException.m @@ -49,21 +49,13 @@ } - initWithObject: (id)object key: (OFString *)key { - self = [super init]; - - @try { - _object = [object retain]; - _key = [key copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithObject: object + key: key + value: nil]; } - initWithObject: (id)object key: (OFString *)key value: (id)value Index: src/exceptions/OFUnknownXMLEntityException.h ================================================================== --- src/exceptions/OFUnknownXMLEntityException.h +++ src/exceptions/OFUnknownXMLEntityException.h @@ -41,15 +41,17 @@ * @param entityName The name of the unknown XML entity * @return A new, autoreleased unknown XML entity exception */ + (instancetype)exceptionWithEntityName: (OFString *)entityName; +- init OF_UNAVAILABLE; + /*! * @brief Initializes an already allocated unknown XML entity exception. * * @param entityName The name of the unknown XML entity * @return An initialized unknown XML entity exception */ -- initWithEntityName: (OFString *)entityName; +- initWithEntityName: (OFString *)entityName OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnknownXMLEntityException.m ================================================================== --- src/exceptions/OFUnknownXMLEntityException.m +++ src/exceptions/OFUnknownXMLEntityException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithEntityName: (OFString *)entityName { return [[[self alloc] initWithEntityName: entityName] autorelease]; } + +- init +{ + OF_INVALID_INIT_METHOD +} - initWithEntityName: (OFString *)entityName { self = [super init]; Index: src/exceptions/OFUnlockFailedException.h ================================================================== --- src/exceptions/OFUnlockFailedException.h +++ src/exceptions/OFUnlockFailedException.h @@ -47,9 +47,9 @@ * @brief Initializes an already allocated unlock failed exception. * * @param lock The lock which could not be unlocked * @return An initialized unlock failed exception */ -- initWithLock: (nullable id )lock; +- initWithLock: (nullable id )lock OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnlockFailedException.m ================================================================== --- src/exceptions/OFUnlockFailedException.m +++ src/exceptions/OFUnlockFailedException.m @@ -24,10 +24,15 @@ + (instancetype)exceptionWithLock: (id )lock { return [[[self alloc] initWithLock: lock] autorelease]; } + +- init +{ + return [self initWithLock: nil]; +} - initWithLock: (id )lock { self = [super init]; Index: src/exceptions/OFUnsupportedProtocolException.h ================================================================== --- src/exceptions/OFUnsupportedProtocolException.h +++ src/exceptions/OFUnsupportedProtocolException.h @@ -54,9 +54,9 @@ * @brief Initializes an already allocated unsupported protocol exception * * @param URL The URL whose protocol is unsupported * @return An initialized unsupported protocol exception */ -- initWithURL: (OFURL*)URL; +- initWithURL: (OFURL*)URL OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnsupportedVersionException.h ================================================================== --- src/exceptions/OFUnsupportedVersionException.h +++ src/exceptions/OFUnsupportedVersionException.h @@ -51,9 +51,9 @@ * @brief Initializes an already allocated unsupported protocol exception. * * @param version The version which is unsupported * @return An initialized unsupported version exception */ -- initWithVersion: (OFString *)version; +- initWithVersion: (OFString *)version OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END