ObjFW  Diff

Differences From Artifact [65bfd85485]:

  • File src/OFDictionary.m — part of check-in [3d16a30f41] at 2013-06-22 12:12:36 on branch trunk — Rework exceptions.

    This mostly removes the argument for the class in which the exception
    occurred. As backtraces were recently added for all platforms, the
    passed class does not give any extra information on where the exception
    occurred anymore.

    This also removes a few other arguments which were not too helpful. In
    the past, the idea was to pass as many arguments as possible so that it
    is easier to find the origin of the exception. However, as backtraces
    are a much better way to find the origin, those are not useful anymore
    and just make the exception more cumbersome to use. The rule is now to
    only pass arguments that might help in recovering from the exception or
    provide information that is otherwise not easily accessible. (user: js, size: 14079) [annotate] [blame] [check-ins using]

To Artifact [03af4f840a]:


200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
	}

	return [super init];
}

- initWithDictionary: (OFDictionary*)dictionary
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithObject: (id)object
	  forKey: (id)key
{
	if (key == nil || object == nil)
		@throw [OFInvalidArgumentException exception];







<
<
<
<
<
<
|
<







200
201
202
203
204
205
206






207

208
209
210
211
212
213
214
	}

	return [super init];
}

- initWithDictionary: (OFDictionary*)dictionary
{






	OF_INVALID_INIT_METHOD

}

- initWithObject: (id)object
	  forKey: (id)key
{
	if (key == nil || object == nil)
		@throw [OFInvalidArgumentException exception];
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
			       count: count];
}

- initWithObjects: (id const*)objects
	  forKeys: (id const*)keys
	    count: (size_t)count
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithKeysAndObjects: (id)firstKey, ...
{
	id ret;
	va_list arguments;

	va_start(arguments, firstKey);
	ret = [self initWithKey: firstKey
		      arguments: arguments];
	va_end(arguments);

	return ret;
}

- initWithKey: (id)firstKey
    arguments: (va_list)arguments
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithSerialization: (OFXMLElement*)element
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- (id)objectForKey: (id)key
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}







<
<
<
<
<
<
|
<


















<
<
<
<
<
<
|
<




<
<
<
<
<
<
|
<







240
241
242
243
244
245
246






247

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265






266

267
268
269
270






271

272
273
274
275
276
277
278
			       count: count];
}

- initWithObjects: (id const*)objects
	  forKeys: (id const*)keys
	    count: (size_t)count
{






	OF_INVALID_INIT_METHOD

}

- initWithKeysAndObjects: (id)firstKey, ...
{
	id ret;
	va_list arguments;

	va_start(arguments, firstKey);
	ret = [self initWithKey: firstKey
		      arguments: arguments];
	va_end(arguments);

	return ret;
}

- initWithKey: (id)firstKey
    arguments: (va_list)arguments
{






	OF_INVALID_INIT_METHOD

}

- initWithSerialization: (OFXMLElement*)element
{






	OF_INVALID_INIT_METHOD

}

- (id)objectForKey: (id)key
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}