ObjFW  Diff

Differences From Artifact [4c5a03559b]:

To Artifact [07bbff71b3]:

  • File src/OFMutableDictionary.m — part of check-in [e1e7ffa903] at 2011-09-22 23:25:42 on branch trunk — Exceptions are now autoreleased.

    This is safe as an "exception loop" can't happen, since if allocating
    an exception fails, it throws an OFAllocFailedException which is
    preallocated and can always be thrown.

    So, the worst case would be that an autorelease of an exception fails,
    triggering an OFOutOfMemoryException for which there is no memory,
    resulting in an OFAllocFailedException to be thrown. (user: js, size: 3216) [annotate] [blame] [check-ins using]


92
93
94
95
96
97
98
99
100


101
102
103
104
105
106
107
92
93
94
95
96
97
98


99
100
101
102
103
104
105
106
107







-
-
+
+








- (void)release
{
}

- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
	[super dealloc];	/* Get rid of a stupid warning */
}
@end

@implementation OFMutableDictionary
+ (void)initialize
{
118
119
120
121
122
123
124
125
126


127
128
129
130
131
132
133
134
135
136


137
138
139
140
141
142


143
144
145
146
147
148
149
118
119
120
121
122
123
124


125
126
127
128
129
130
131
132
133
134


135
136
137
138
139
140


141
142
143
144
145
146
147
148
149







-
-
+
+








-
-
+
+




-
-
+
+







}

- init
{
	if (isa == [OFMutableDictionary class]) {
		Class c = isa;
		[self release];
		@throw [OFNotImplementedException newWithClass: c
						      selector: _cmd];
		@throw [OFNotImplementedException exceptionWithClass: c
							    selector: _cmd];
	}

	return [super init];
}

- (void)setObject: (id)object
	   forKey: (id)key
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (void)removeObjectForKey: (id)key
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- copy
{
	return [[OFDictionary alloc] initWithDictionary: self];
}