Index: src/exceptions/OFChangeCurrentDirectoryPathFailedException.m ================================================================== --- src/exceptions/OFChangeCurrentDirectoryPathFailedException.m +++ src/exceptions/OFChangeCurrentDirectoryPathFailedException.m @@ -19,23 +19,18 @@ #import "OFString.h" @implementation OFChangeCurrentDirectoryPathFailedException @synthesize path = _path, errNo = _errNo; -+ (instancetype)exception -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } -- (instancetype)init ++ (instancetype)exception { - OF_INVALID_INIT_METHOD + OF_UNRECOGNIZED_SELECTOR } - (instancetype)initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @@ -48,10 +43,15 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (void)dealloc { [_path release]; Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -73,12 +73,10 @@ /** * @brief The errno of the error that occurred. */ @property (readonly, nonatomic) int errNo; -+ (instancetype)exception OF_UNAVAILABLE; - /** * @brief Creates a new, autoreleased connection failed exception. * * @param host The host to which the connection failed * @param port The port on the host to which the connection failed @@ -117,11 +115,11 @@ */ + (instancetype)exceptionWithPath: (OFString *)path socket: (id)socket errNo: (int)errNo; -- (instancetype)init OF_UNAVAILABLE; ++ (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated connection failed exception. * * @param host The host to which the connection failed @@ -160,8 +158,10 @@ * @return An initialized connection failed exception */ - (instancetype)initWithPath: (OFString *)path socket: (id)socket errNo: (int)errNo; + +- (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -20,15 +20,10 @@ @implementation OFConnectionFailedException @synthesize host = _host, port = _port, network = _network, path = _path; @synthesize socket = _socket, errNo = _errNo; -+ (instancetype)exception -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)sock errNo: (int)errNo { @@ -35,10 +30,15 @@ return [[[self alloc] initWithHost: host port: port socket: sock errNo: errNo] autorelease]; } + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithNode: (unsigned char [IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port socket: (id)sock @@ -58,15 +58,10 @@ return [[[self alloc] initWithPath: path socket: sock errNo: errNo] autorelease]; } -- (instancetype)init -{ - OF_INVALID_INIT_METHOD -} - - (instancetype)initWithHost: (OFString *)host port: (uint16_t)port socket: (id)sock errNo: (int)errNo { @@ -122,10 +117,15 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (void)dealloc { [_host release]; [_path release]; Index: src/exceptions/OFGetCurrentDirectoryPathFailedException.m ================================================================== --- src/exceptions/OFGetCurrentDirectoryPathFailedException.m +++ src/exceptions/OFGetCurrentDirectoryPathFailedException.m @@ -19,23 +19,18 @@ #import "OFString.h" @implementation OFGetCurrentDirectoryPathFailedException @synthesize errNo = _errNo; -+ (instancetype)exception -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)exceptionWithErrNo: (int)errNo { return [[[self alloc] initWithErrNo: errNo] autorelease]; } -- (instancetype)init ++ (instancetype)exception { - OF_INVALID_INIT_METHOD + OF_UNRECOGNIZED_SELECTOR } - (instancetype)initWithErrNo: (int)errNo { self = [super init]; @@ -42,13 +37,18 @@ _errNo = errNo; return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (OFString *)description { return [OFString stringWithFormat: @"Getting the current directory path failed: %@", OFStrError(_errNo)]; } @end Index: src/exceptions/OFGetWindowsRegistryValueFailedException.h ================================================================== --- src/exceptions/OFGetWindowsRegistryValueFailedException.h +++ src/exceptions/OFGetWindowsRegistryValueFailedException.h @@ -62,11 +62,11 @@ */ + (instancetype)exceptionWithRegistryKey: (OFWindowsRegistryKey *)registryKey valueName: (nullable OFString *)valueName status: (LSTATUS)status; -- (instancetype)init OF_UNAVAILABLE; ++ (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated get Windows registry value failed * exception. * @@ -77,8 +77,10 @@ * @return An initialized get Windows registry value failed exception */ - (instancetype)initWithRegistryKey: (OFWindowsRegistryKey *)registryKey valueName: (nullable OFString *)valueName status: (LSTATUS)status OF_DESIGNATED_INITIALIZER; + +- (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFGetWindowsRegistryValueFailedException.m ================================================================== --- src/exceptions/OFGetWindowsRegistryValueFailedException.m +++ src/exceptions/OFGetWindowsRegistryValueFailedException.m @@ -28,13 +28,13 @@ return [[[self alloc] initWithRegistryKey: registryKey valueName: valueName status: status] autorelease]; } -- (instancetype)init ++ (instancetype)exception { - OF_INVALID_INIT_METHOD + OF_UNRECOGNIZED_SELECTOR } - (instancetype)initWithRegistryKey: (OFWindowsRegistryKey *)registryKey valueName: (OFString *)valueName status: (LSTATUS)status @@ -50,10 +50,15 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (void)dealloc { [_registryKey release]; [_valueName release]; Index: src/exceptions/OFLoadPluginFailedException.h ================================================================== --- src/exceptions/OFLoadPluginFailedException.h +++ src/exceptions/OFLoadPluginFailedException.h @@ -36,12 +36,10 @@ /** * @brief The error why the plugin could not be loaded, as a string */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *error; -+ (instancetype)exception OF_UNAVAILABLE; - /** * @brief Creates a new, autoreleased load plugin failed exception. * * @param path The path of the plugin which could not be loaded * @param error The error why the plugin could not be loaded, as a string @@ -48,11 +46,11 @@ * @return A new, autoreleased load plugin failed exception */ + (instancetype)exceptionWithPath: (OFString *)path error: (nullable OFString *)error; -- (instancetype)init OF_UNAVAILABLE; ++ (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated load plugin failed exception. * * @param path The path of the plugin which could not be loaded @@ -60,8 +58,10 @@ * @return An initialized load plugin failed exception */ - (instancetype)initWithPath: (OFString *)path error: (nullable OFString *)error OF_DESIGNATED_INITIALIZER; + +- (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLoadPluginFailedException.m ================================================================== --- src/exceptions/OFLoadPluginFailedException.m +++ src/exceptions/OFLoadPluginFailedException.m @@ -19,23 +19,18 @@ #import "OFString.h" @implementation OFLoadPluginFailedException @synthesize path = _path, error = _error; -+ (instancetype)exception -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)exceptionWithPath: (OFString *)path error: (OFString *)error { return [[[self alloc] initWithPath: path error: error] autorelease]; } -- (instancetype)init ++ (instancetype)exception { - OF_INVALID_INIT_METHOD + OF_UNRECOGNIZED_SELECTOR } - (instancetype)initWithPath: (OFString *)path error: (OFString *)error { self = [super init]; @@ -48,10 +43,15 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (void)dealloc { [_path release]; [_error release]; Index: src/exceptions/OFOpenWindowsRegistryKeyFailedException.h ================================================================== --- src/exceptions/OFOpenWindowsRegistryKeyFailedException.h +++ src/exceptions/OFOpenWindowsRegistryKeyFailedException.h @@ -80,11 +80,11 @@ path: (OFString *)path options: (DWORD)options securityAndAccessRights: (REGSAM)securityAndAccessRights status: (LSTATUS)status; -- (instancetype)init OF_UNAVAILABLE; ++ (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated open Windows registry key failed * exception. * @@ -100,8 +100,10 @@ initWithRegistryKey: (OFWindowsRegistryKey *)registryKey path: (OFString *)path options: (DWORD)options securityAndAccessRights: (REGSAM)securityAndAccessRights status: (LSTATUS)status OF_DESIGNATED_INITIALIZER; + +- (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFOpenWindowsRegistryKeyFailedException.m ================================================================== --- src/exceptions/OFOpenWindowsRegistryKeyFailedException.m +++ src/exceptions/OFOpenWindowsRegistryKeyFailedException.m @@ -34,13 +34,13 @@ options: options securityAndAccessRights: securityAndAccessRights status: status] autorelease]; } -- (instancetype)init ++ (instancetype)exception { - OF_INVALID_INIT_METHOD + OF_UNRECOGNIZED_SELECTOR } - (instancetype) initWithRegistryKey: (OFWindowsRegistryKey *)registryKey path: (OFString *)path @@ -61,10 +61,15 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (void)dealloc { [_registryKey release]; [_path release];