ObjFW  Diff

Differences From Artifact [6c880cfe21]:

To Artifact [c96d938c3c]:


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

#include "config.h"

#include <stdlib.h>

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"
#import "OFHash.h"

#import "common.h"

@implementation OFHashAlreadyCalculatedException
+ (instancetype)exceptionWithClass: (Class)class
			      hash: (OFHash*)hash
{
	return [[[self alloc] initWithClass: class
				       hash: hash] autorelease];
}

- initWithClass: (Class)class
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithClass: (Class)class
	   hash: (OFHash*)hashObject
{
	self = [super initWithClass: class];

	_hashObject = [hashObject retain];

	return self;
}







<





|


















|







16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

#include "config.h"

#include <stdlib.h>

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"


#import "common.h"

@implementation OFHashAlreadyCalculatedException
+ (instancetype)exceptionWithClass: (Class)class
			      hash: (id <OFHash>)hash
{
	return [[[self alloc] initWithClass: class
				       hash: hash] autorelease];
}

- initWithClass: (Class)class
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithClass: (Class)class
	   hash: (id <OFHash>)hashObject
{
	self = [super initWithClass: class];

	_hashObject = [hashObject retain];

	return self;
}
64
65
66
67
68
69
70
71
72
73
74
75
- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The hash has already been calculated in class %@ and thus no new "
	    @"data can be added", _inClass];
}

- (OFHash*)hashObject
{
	OF_GETTER(_hashObject, NO)
}
@end







|




63
64
65
66
67
68
69
70
71
72
73
74
- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The hash has already been calculated in class %@ and thus no new "
	    @"data can be added", _inClass];
}

- (id <OFHash>)hashObject
{
	OF_GETTER(_hashObject, NO)
}
@end