@@ -17,24 +17,21 @@ #include "config.h" #import "OFUnlockFailedException.h" #import "OFString.h" -#import "macros.h" +#import "common.h" @implementation OFUnlockFailedException -+ (instancetype)exceptionWithClass: (Class)class - lock: (id )lock ++ (instancetype)exceptionWithLock: (id )lock { - return [[[self alloc] initWithClass: class - lock: lock] autorelease]; + return [[[self alloc] initWithLock: lock] autorelease]; } -- initWithClass: (Class)class - lock: (id )lock +- initWithLock: (id )lock { - self = [super initWithClass: class]; + self = [super init]; _lock = [lock retain]; return self; } @@ -46,15 +43,17 @@ [super dealloc]; } - (OFString*)description { - return [OFString stringWithFormat: - @"A lock of class %@ could not be unlocked in class %@!", - [_lock class], _inClass]; + if (_lock != nil) + return [OFString stringWithFormat: + @"A lock of type %@ could not be unlocked!", [_lock class]]; + else + return @"A lock could not be unlocked!"; } - (id )lock { OF_GETTER(_lock, false) } @end