@@ -22,18 +22,16 @@ #import "OFString.h" #import "common.h" @implementation OFHashAlreadyCalculatedException -+ (instancetype)exceptionWithClass: (Class)class - hash: (id )hash ++ (instancetype)exceptionWithHash: (id )hash { - return [[[self alloc] initWithClass: class - hash: hash] autorelease]; + return [[[self alloc] initWithHash: hash] autorelease]; } -- initWithClass: (Class)class +- init { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @@ -41,14 +39,13 @@ } abort(); } -- initWithClass: (Class)class - hash: (id )hashObject +- initWithHash: (id )hashObject { - self = [super initWithClass: class]; + self = [super init]; _hashObject = [hashObject retain]; return self; } @@ -61,14 +58,14 @@ } - (OFString*)description { return [OFString stringWithFormat: - @"The hash has already been calculated in class %@ and thus no new " - @"data can be added", _inClass]; + @"The hash of type %@ has already been calculated and thus no new " + @"data can be added!", [_hashObject class]]; } - (id )hashObject { OF_GETTER(_hashObject, false) } @end