diff options
author | Lars Vogel | 2015-12-01 16:39:34 +0000 |
---|---|---|
committer | Lars Vogel | 2015-12-04 07:20:49 +0000 |
commit | 6e371324d410f123b9b7ad2443795c6ccfe3e8a9 (patch) | |
tree | eb00beb68354cd71d22f23ec90fb21914d021840 | |
parent | b8958f9f6f5173a671082b062179dd3d0a90f4eb (diff) | |
download | eclipse.platform.runtime-6e371324d410f123b9b7ad2443795c6ccfe3e8a9.tar.gz eclipse.platform.runtime-6e371324d410f123b9b7ad2443795c6ccfe3e8a9.tar.xz eclipse.platform.runtime-6e371324d410f123b9b7ad2443795c6ccfe3e8a9.zip |
Bug 483393 - Use multi-catch in org.eclipse.e4.core.diI20151213-2000I20151209-2300I20151209-2000I20151209-0800I20151208-2000I20151208-0800I20151207-2000I20151207-0800I20151206-2000
Change-Id: I089d54f439ad1392b01ecc345ed306586f967056
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
4 files changed, 5 insertions, 15 deletions
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java index d57d7dd62..7f2ddc991 100644 --- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java +++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java @@ -40,12 +40,10 @@ public class ConstructorRequestor extends Requestor<Constructor<?>> { } try { result = location.newInstance(actualArgs); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { throw new InjectionException(e); } catch (InstantiationException e) { throw new InjectionException("Unable to instantiate " + location, e); //$NON-NLS-1$ - } catch (IllegalAccessException e) { - throw new InjectionException(e); } catch (InvocationTargetException e) { Throwable originalException = e.getCause(); // Errors such as ThreadDeath or OutOfMemoryError should not be trapped diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java index 14e002b3d..ed83aadb3 100644 --- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java +++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java @@ -48,9 +48,7 @@ public class FieldRequestor extends Requestor<Field> { } try { field.set(userObject, value); - } catch (IllegalArgumentException e) { - throw new InjectionException(e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { throw new InjectionException(e); } finally { if (!wasAccessible) diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java index 25b211245..e1f1265bf 100644 --- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java +++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java @@ -116,9 +116,7 @@ public class InjectorImpl implements IInjector { public void inject(Object object, PrimaryObjectSupplier objectSupplier) { try { inject(object, objectSupplier, null); - } catch (NoClassDefFoundError e) { - throw new InjectionException(e); - } catch (NoSuchMethodError e) { + } catch (NoClassDefFoundError | NoSuchMethodError e) { throw new InjectionException(e); } } @@ -384,9 +382,7 @@ public class InjectorImpl implements IInjector { } } throw new InjectionException("Could not find satisfiable constructor in " + clazz.getName()); //$NON-NLS-1$ - } catch (NoClassDefFoundError e) { - throw new InjectionException(e); - } catch (NoSuchMethodError e) { + } catch (NoClassDefFoundError | NoSuchMethodError e) { throw new InjectionException(e); } finally { if (shouldDebug) diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java index 075b788d7..98ab42dcf 100644 --- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java +++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java @@ -54,9 +54,7 @@ public class MethodRequestor extends Requestor<Method> { } try { result = location.invoke(userObject, actualArgs); - } catch (IllegalArgumentException e) { - throw new InjectionException(e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { throw new InjectionException(e); } catch (InvocationTargetException e) { Throwable originalException = e.getCause(); |