@@ -270,9 +270,7 @@ public int compare(final Field a, final Field b) {
270
270
Object value ;
271
271
try {
272
272
value = getOptionalValue (f .get (obj ));
273
- } catch (final IllegalArgumentException e ) {
274
- throw new IllegalArgumentException ("Could not read value of field " + f .getName (), e );
275
- } catch (final IllegalAccessException e ) {
273
+ } catch (final IllegalArgumentException | IllegalAccessException e ) {
276
274
throw new IllegalArgumentException ("Could not read value of field " + f .getName (), e );
277
275
}
278
276
@@ -419,17 +417,7 @@ private static Object applyTransformer(final Field f, final DatabaseFieldDescrip
419
417
420
418
// transform the value by the transformer into a database value:
421
419
value = transformer .marshalToDb (value );
422
- } catch (final InstantiationException e ) {
423
- throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
424
- } catch (final IllegalAccessException e ) {
425
- throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
426
- } catch (final InvocationTargetException e ) {
427
- throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
428
- } catch (IllegalArgumentException e ) {
429
- throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
430
- } catch (NoSuchMethodException e ) {
431
- throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
432
- } catch (SecurityException e ) {
420
+ } catch (final InstantiationException | IllegalAccessException | InvocationTargetException | IllegalArgumentException | NoSuchMethodException | SecurityException e ) {
433
421
throw new IllegalArgumentException ("Could not instantiate transformer of field " + f .getName (), e );
434
422
}
435
423
}
@@ -441,17 +429,7 @@ private static Object applyTransformer(final Field f, final DatabaseFieldDescrip
441
429
ObjectMapper <Object > mapper = (ObjectMapper <Object >) mapperClass .getDeclaredConstructor ().newInstance ();
442
430
443
431
value = mapper .marshalToDb (value );
444
- } catch (InstantiationException e ) {
445
- throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
446
- } catch (IllegalAccessException e ) {
447
- throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
448
- } catch (IllegalArgumentException e ) {
449
- throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
450
- } catch (InvocationTargetException e ) {
451
- throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
452
- } catch (NoSuchMethodException e ) {
453
- throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
454
- } catch (SecurityException e ) {
432
+ } catch (final InstantiationException | IllegalAccessException | InvocationTargetException | IllegalArgumentException | NoSuchMethodException | SecurityException e ) {
455
433
throw new IllegalArgumentException ("Could not instantiate mapper of field " + f .getName (), e );
456
434
}
457
435
}
0 commit comments