Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langer2017-01-24 11:25:46 -0500
committerAxel RICHARD2017-02-10 09:11:29 -0500
commite8071982936d413c1f5a408bff7912b46cc203f4 (patch)
treed78890dbc84c39b2fa349a6b6f785c138200a89b
parentd8af08b53762443f3d8d43306963014493a0c643 (diff)
downloadorg.eclipse.emf.compare-e8071982936d413c1f5a408bff7912b46cc203f4.tar.gz
org.eclipse.emf.compare-e8071982936d413c1f5a408bff7912b46cc203f4.tar.xz
org.eclipse.emf.compare-e8071982936d413c1f5a408bff7912b46cc203f4.zip
Take advantage of multiple type catch of Java 7
Change-Id: I5db80b37aeefa101beaad6515408b54a92342e1b Signed-off-by: Philip Langer <planger@eclipsesource.com>
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/ElementTypeSetConfigurationRegistryInitializingHook.java16
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.framework/src/org/eclipse/emf/compare/ide/ui/tests/framework/internal/CompareTestSupport.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RemoteMappingContextStorageAccessor.java9
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RenameDetector.java7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/StreamAccessorStorage.java9
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/SubscriberStorageAccessor.java11
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java12
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java4
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java8
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/AbstractInputData.java4
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/ConflictStatement.java10
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java8
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.edit/src/org/eclipse/emf/compare/uml2/internal/provider/decorator/StereotypedElementItemProviderDecorator.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/ProfileNamespaceURIPatternAPI.java36
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/StereotypeApplicationRepair.java43
19 files changed, 53 insertions, 154 deletions
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/ElementTypeSetConfigurationRegistryInitializingHook.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/ElementTypeSetConfigurationRegistryInitializingHook.java
index b239d99ed..7f3e75cb3 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/ElementTypeSetConfigurationRegistryInitializingHook.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/ElementTypeSetConfigurationRegistryInitializingHook.java
@@ -70,19 +70,9 @@ public class ElementTypeSetConfigurationRegistryInitializingHook extends Abstrac
}
Method getInstanceMethod = registryClass.getDeclaredMethod(GET_INSTANCE);
getInstanceMethod.invoke(null);
- } catch (ClassNotFoundException e) {
- logException(e);
- } catch (NoSuchMethodException e) {
- logException(e);
- } catch (SecurityException e) {
- logException(e);
- } catch (IllegalAccessException e) {
- logException(e);
- } catch (IllegalArgumentException e) {
- logException(e);
- } catch (InvocationTargetException e) {
- logException(e);
- } catch (NullPointerException e) {
+ } catch (ClassNotFoundException | NoSuchMethodException | SecurityException
+ | IllegalAccessException | IllegalArgumentException | InvocationTargetException
+ | NullPointerException e) {
logException(e);
}
}
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
index 0170eba31..9a62bd975 100644
--- a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
@@ -358,9 +358,7 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
// model. Fall back to default.
}
}
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- } catch (CoreException e) {
+ } catch (IOException | CoreException e) {
throw new InvocationTargetException(e);
}
return null;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/src/org/eclipse/emf/compare/ide/ui/tests/framework/internal/CompareTestSupport.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/src/org/eclipse/emf/compare/ide/ui/tests/framework/internal/CompareTestSupport.java
index bc37cd20d..d2f2a9cfd 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/src/org/eclipse/emf/compare/ide/ui/tests/framework/internal/CompareTestSupport.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/src/org/eclipse/emf/compare/ide/ui/tests/framework/internal/CompareTestSupport.java
@@ -228,9 +228,7 @@ public class CompareTestSupport {
resource = resourceSet.createResource(uri);
stream = fileURL.openStream();
resource.load(stream, Collections.emptyMap());
- } catch (final IOException e) {
- // return null
- } catch (final WrappedException e) {
+ } catch (final IOException | WrappedException e) {
// return null
} finally {
if (stream != null) {
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
index f15123e70..dde5e6d8a 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
@@ -330,12 +330,8 @@ public final class ComparisonScopeBuilder {
}
});
participant = (ISynchronizeParticipant)field.get(modelInput);
- } catch (NoSuchFieldException e) {
+ } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
// Swallow this, this private field was there at least from 3.5 to 4.3
- } catch (IllegalArgumentException e) {
- // Cannot happen
- } catch (IllegalAccessException e) {
- // "Should" not happen, but ignore it anyway
}
if (participant instanceof ModelSynchronizeParticipant
&& ((ModelSynchronizeParticipant)participant)
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RemoteMappingContextStorageAccessor.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RemoteMappingContextStorageAccessor.java
index 254ba5797..8575f239c 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RemoteMappingContextStorageAccessor.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RemoteMappingContextStorageAccessor.java
@@ -72,13 +72,8 @@ public class RemoteMappingContextStorageAccessor implements IStorageProviderAcce
field.setAccessible(true);
final Object subscriberValue = field.get(remoteResourceMappingContext);
return subscriberValue;
- } catch (NoSuchFieldException e) {
- // ignore and live without subscriber
- } catch (SecurityException e) {
- // ignore and live without subscriber
- } catch (IllegalArgumentException e) {
- // ignore and live without subscriber
- } catch (IllegalAccessException e) {
+ } catch (NoSuchFieldException | SecurityException | IllegalArgumentException
+ | IllegalAccessException e) {
// ignore and live without subscriber
}
return null;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RenameDetector.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RenameDetector.java
index c31ac3e01..7462ebedc 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RenameDetector.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/RenameDetector.java
@@ -388,9 +388,7 @@ public class RenameDetector {
if (origin != null && added != null) {
return SimilarityComputer.isSimilar(origin.getContents(), added.getContents());
}
- } catch (CoreException e) {
- // can't access a storage so ignore, fall through and return false
- } catch (IOException e) {
+ } catch (CoreException | IOException e) {
// can't access a storage so ignore, fall through and return false
}
return false;
@@ -411,9 +409,8 @@ public class RenameDetector {
allChildren.add(child).addAll(toAllChildren().apply(child));
}
}
- } catch (TeamException e) {
+ } catch (TeamException | NullPointerException e) {
// ignore and fall through
- } catch (NullPointerException e) {
// org.eclipse.egit.core.internal.merge.GitResourceVariantCache.members(IResource)
// throws NPE if base doesn't contain a folder that exists in source or remote
// so ignore and fall through
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/StreamAccessorStorage.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/StreamAccessorStorage.java
index 0fbd916ea..7026ddb37 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/StreamAccessorStorage.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/StreamAccessorStorage.java
@@ -313,13 +313,8 @@ public class StreamAccessorStorage implements IStorage, IStoragePathAdapterProvi
if (value instanceof IFileRevision) {
revision = (IFileRevision)value;
}
- } catch (NoSuchMethodException e) {
- // Ignore exceptions
- } catch (IllegalAccessException e) {
- // Ignore exceptions
- } catch (IllegalArgumentException e) {
- // Ignore exceptions
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
// Ignore exceptions
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/SubscriberStorageAccessor.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/SubscriberStorageAccessor.java
index 90ab1b20a..e6fdf6106 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/SubscriberStorageAccessor.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/SubscriberStorageAccessor.java
@@ -273,15 +273,8 @@ public final class SubscriberStorageAccessor implements IStorageProviderAccessor
}
method.setAccessible(true);
return method.invoke(teamSubscriber);
- } catch (SecurityException e) {
- // Swallow all this, don't use the variant tree.
- } catch (NoSuchMethodException e) {
- // Swallow all this, don't use the variant tree.
- } catch (IllegalArgumentException e) {
- // Swallow all this, don't use the variant tree.
- } catch (IllegalAccessException e) {
- // Swallow all this, don't use the variant tree.
- } catch (InvocationTargetException e) {
+ } catch (SecurityException | NoSuchMethodException | IllegalArgumentException
+ | IllegalAccessException | InvocationTargetException e) {
// Swallow all this, don't use the variant tree.
}
return null;
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
index f02e7c6ad..a6088a773 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
@@ -509,11 +509,7 @@ public class ForwardingXMLHandler extends XMLHandler {
throw new RuntimeException(new NoSuchMethodException("Could not find method " + methodName //$NON-NLS-1$
+ " on " + XMLHandler.class.getName())); //$NON-NLS-1$
}
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
+ } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
@@ -538,11 +534,7 @@ public class ForwardingXMLHandler extends XMLHandler {
throw new RuntimeException(new NoSuchFieldException("Could not find field " + fieldName //$NON-NLS-1$
+ " on " + XMLHandler.class.getName())); //$NON-NLS-1$
}
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (ExecutionException e) {
+ } catch (IllegalArgumentException | IllegalAccessException | ExecutionException e) {
throw new RuntimeException(e);
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
index 81916fa21..923a513e6 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
@@ -251,9 +251,7 @@ public final class NotLoadingResourceSet extends ResourceSetImpl implements Disp
private void loadFromStorage(Resource resource, IStorage storage) throws IOException {
try (InputStream stream = storage.getContents()) {
resource.load(stream, getLoadOptions());
- } catch (CoreException e) {
- logLoadingFromStorageFailed(resource, storage, e);
- } catch (WrappedException e) {
+ } catch (CoreException | WrappedException e) {
logLoadingFromStorageFailed(resource, storage, e);
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java
index 0aa48382d..7208991d3 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java
@@ -635,9 +635,7 @@ public final class ResourceUtil {
IContentType[] contentTypes = new IContentType[0];
try (InputStream resourceContent = file.getContents()) {
contentTypes = ctManager.findContentTypesFor(resourceContent, file.getName());
- } catch (CoreException e) {
- ctManager.findContentTypesFor(file.getName());
- } catch (IOException e) {
+ } catch (CoreException | IOException e) {
ctManager.findContentTypesFor(file.getName());
}
return contentTypes;
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
index 4d9e3ff11..c454dd3b6 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
@@ -1123,11 +1123,9 @@ public class MergeViewerItem extends AdapterImpl implements IMergeViewerItem {
method.setAccessible(true);
ret = (Collection<? extends EStructuralFeature>)method.invoke(itemProviderAdapter,
object);
- } catch (SecurityException e) {
- } catch (NoSuchMethodException e) {
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
+ } catch (SecurityException | NoSuchMethodException | IllegalArgumentException
+ | IllegalAccessException | InvocationTargetException e) {
+ // ignore
}
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/AbstractInputData.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/AbstractInputData.java
index 41987741f..1f08a407d 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/AbstractInputData.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/AbstractInputData.java
@@ -84,9 +84,7 @@ public abstract class AbstractInputData {
resource = resourceSet.createResource(uri);
stream = fileURL.openStream();
resource.load(stream, Collections.emptyMap());
- } catch (IOException e) {
- // return null
- } catch (WrappedException e) {
+ } catch (IOException | WrappedException e) {
// return null
} finally {
if (stream != null) {
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/ConflictStatement.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/ConflictStatement.java
index b6544d11a..b2fdacad4 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/ConflictStatement.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/ConflictStatement.java
@@ -16,8 +16,8 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.conflict.MatchBasedConflictDetector;
import org.eclipse.emf.compare.conflict.IConflictDetector;
+import org.eclipse.emf.compare.conflict.MatchBasedConflictDetector;
import org.eclipse.emf.compare.diff.DefaultDiffEngine;
import org.eclipse.emf.compare.diff.DiffBuilder;
import org.eclipse.emf.compare.diff.IDiffEngine;
@@ -112,9 +112,7 @@ public class ConflictStatement extends Statement {
IMatchEngine engine = null;
try {
engine = engineClass.newInstance();
- } catch (InstantiationException e) {
- // Swallow : we'll create a default engine instead.
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
@@ -142,9 +140,7 @@ public class ConflictStatement extends Statement {
IDiffEngine engine = null;
try {
engine = engineClass.newInstance();
- } catch (InstantiationException e) {
- // Swallow : we'll create a default engine instead.
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
index 2d1cd568d..c98586d89 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
@@ -105,9 +105,7 @@ public class DiffStatement extends Statement {
IMatchEngine engine = null;
try {
engine = engineClass.newInstance();
- } catch (InstantiationException e) {
- // Swallow : we'll create a default engine instead.
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
@@ -135,9 +133,7 @@ public class DiffStatement extends Statement {
IDiffEngine engine = null;
try {
engine = engineClass.newInstance();
- } catch (InstantiationException e) {
- // Swallow : we'll create a default engine instead.
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
index d5d2c5fa8..626a0effb 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
@@ -110,9 +110,7 @@ public class MatchStatement extends Statement {
IMatchEngine engine = null;
try {
engine = engineClass.newInstance();
- } catch (InstantiationException e) {
- // Swallow : we'll create a default engine instead.
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
diff --git a/plugins/org.eclipse.emf.compare.uml2.edit/src/org/eclipse/emf/compare/uml2/internal/provider/decorator/StereotypedElementItemProviderDecorator.java b/plugins/org.eclipse.emf.compare.uml2.edit/src/org/eclipse/emf/compare/uml2/internal/provider/decorator/StereotypedElementItemProviderDecorator.java
index 9ef0eeeb5..b625cf5c1 100644
--- a/plugins/org.eclipse.emf.compare.uml2.edit/src/org/eclipse/emf/compare/uml2/internal/provider/decorator/StereotypedElementItemProviderDecorator.java
+++ b/plugins/org.eclipse.emf.compare.uml2.edit/src/org/eclipse/emf/compare/uml2/internal/provider/decorator/StereotypedElementItemProviderDecorator.java
@@ -15,7 +15,6 @@ import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -228,13 +227,6 @@ public class StereotypedElementItemProviderDecorator extends ExtendedItemProvide
url = new URL(uriConverter.normalize(uri).toString());
url.openStream().close();
img = url;
- } catch (MalformedURLException e) {
- UMLCompareEditPlugin.getPlugin().getLog()
- .log(new Status(IStatus.WARNING, "org.eclipse.emf.compare.uml2.edit", //$NON-NLS-1$
- UMLCompareEditPlugin.INSTANCE.getString(
- "Unable_To_Retreive_Icon_Error_Message", //$NON-NLS-1$
- new Object[] {location }),
- e));
} catch (IOException e) {
UMLCompareEditPlugin.getPlugin().getLog()
.log(new Status(IStatus.WARNING, "org.eclipse.emf.compare.uml2.edit", //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/ProfileNamespaceURIPatternAPI.java b/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/ProfileNamespaceURIPatternAPI.java
index d8d842d6a..6374e923d 100644
--- a/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/ProfileNamespaceURIPatternAPI.java
+++ b/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/ProfileNamespaceURIPatternAPI.java
@@ -109,19 +109,10 @@ public final class ProfileNamespaceURIPatternAPI {
registryRegisterMethod = registryClass.getMethod(REGISTRY_METHOD_REGISTER, patternClass);
registryUnregisterMethod = registryClass.getMethod(REGISTRY_METHOD_UNREGISTER, patternClass);
- comparisonIsEqualVersionlessNamespaceURIMethod = comparisonClass.getMethod(
- COMPARISON_METHOD_IS_EQUAL_VERSIONLESS_NAMESPACE_URI);
- } catch (ClassNotFoundException e) {
- // do nothing
- } catch (NoSuchFieldException e) {
- // do nothing
- } catch (SecurityException e) {
- // do nothing
- } catch (IllegalArgumentException e) {
- // do nothing
- } catch (IllegalAccessException e) {
- // do nothing
- } catch (NoSuchMethodException e) {
+ comparisonIsEqualVersionlessNamespaceURIMethod = comparisonClass
+ .getMethod(COMPARISON_METHOD_IS_EQUAL_VERSIONLESS_NAMESPACE_URI);
+ } catch (ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException
+ | IllegalAccessException | NoSuchMethodException e) {
// do nothing
}
}
@@ -147,11 +138,7 @@ public final class ProfileNamespaceURIPatternAPI {
protected static Object callMethod(Method method, Object object, Object... args) {
try {
return method.invoke(object, args);
- } catch (IllegalAccessException e) {
- // do nothing
- } catch (IllegalArgumentException e) {
- // do nothing
- } catch (InvocationTargetException e) {
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
// do nothing
}
return null;
@@ -185,17 +172,8 @@ public final class ProfileNamespaceURIPatternAPI {
try {
Constructor<?> patternConstructor = patternClass.getConstructor(String.class);
patternObject = patternConstructor.newInstance(pattern);
- } catch (NoSuchMethodException e) {
- // do nothing
- } catch (SecurityException e) {
- // do nothing
- } catch (InstantiationException e) {
- // do nothing
- } catch (IllegalAccessException e) {
- // do nothing
- } catch (IllegalArgumentException e) {
- // do nothing
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
+ | IllegalArgumentException | InvocationTargetException e) {
// do nothing
}
return patternObject;
diff --git a/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/StereotypeApplicationRepair.java b/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/StereotypeApplicationRepair.java
index 97e3ef621..3ce5ca7fb 100644
--- a/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/StereotypeApplicationRepair.java
+++ b/plugins/org.eclipse.emf.compare.uml2.papyrus/src/org/eclipse/emf/compare/uml2/papyrus/internal/hook/migration/StereotypeApplicationRepair.java
@@ -72,9 +72,10 @@ public class StereotypeApplicationRepair extends StereotypeApplicationRepairSnip
s.disposeService();
}
} catch (ServiceException ex) {
- UMLPapyrusComparePlugin.getDefault().getLog().log(new Status(IStatus.WARNING,
- UMLPapyrusComparePlugin.PLUGIN_ID, "Unable to dispose Label Provider Service", //$NON-NLS-1$
- ex));
+ UMLPapyrusComparePlugin.getDefault().getLog()
+ .log(new Status(IStatus.WARNING, UMLPapyrusComparePlugin.PLUGIN_ID,
+ "Unable to dispose Label Provider Service", //$NON-NLS-1$
+ ex));
}
super.dispose(modelsManager);
}
@@ -92,13 +93,8 @@ public class StereotypeApplicationRepair extends StereotypeApplicationRepairSnip
final Field superField = getClass().getSuperclass().getDeclaredField(fieldName);
superField.setAccessible(true);
superField.set(this, fieldValue);
- } catch (final NoSuchFieldException e) {
- e.printStackTrace();
- } catch (final SecurityException e) {
- e.printStackTrace();
- } catch (final IllegalArgumentException e) {
- e.printStackTrace();
- } catch (final IllegalAccessException e) {
+ } catch (final NoSuchFieldException | SecurityException | IllegalArgumentException
+ | IllegalAccessException e) {
e.printStackTrace();
}
}
@@ -116,13 +112,8 @@ public class StereotypeApplicationRepair extends StereotypeApplicationRepairSnip
final Field superField = getClass().getSuperclass().getDeclaredField(fieldName);
superField.setAccessible(true);
return superField.get(this);
- } catch (final NoSuchFieldException e) {
- e.printStackTrace();
- } catch (final SecurityException e) {
- e.printStackTrace();
- } catch (final IllegalArgumentException e) {
- e.printStackTrace();
- } catch (final IllegalAccessException e) {
+ } catch (final NoSuchFieldException | SecurityException | IllegalArgumentException
+ | IllegalAccessException e) {
e.printStackTrace();
}
return null;
@@ -178,9 +169,10 @@ public class StereotypeApplicationRepair extends StereotypeApplicationRepairSnip
try {
umlLabelProviderService.startService();
} catch (ServiceException ex) {
- UMLPapyrusComparePlugin.getDefault().getLog().log(new Status(IStatus.WARNING,
- UMLPapyrusComparePlugin.PLUGIN_ID, "Unable to start UML Label Provider Service", //$NON-NLS-1$
- ex));
+ UMLPapyrusComparePlugin.getDefault().getLog()
+ .log(new Status(IStatus.WARNING, UMLPapyrusComparePlugin.PLUGIN_ID,
+ "Unable to start UML Label Provider Service", //$NON-NLS-1$
+ ex));
}
return umlLabelProviderService;
}
@@ -240,11 +232,12 @@ public class StereotypeApplicationRepair extends StereotypeApplicationRepairSnip
// CHECKSTYLE:OFF
} catch (Exception e) {
// CHECKSTYLE:ON
- resource.getErrors().add(new ProfileMigrationDiagnostic(UMLPapyrusCompareMessages.getString(
- "profile.migration.exception", e, resource))); //$NON-NLS-1$
- UMLPapyrusComparePlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
- UMLPapyrusComparePlugin.PLUGIN_ID, "Exception occurred during profile migration", //$NON-NLS-1$
- e)); // The exception stack trace will appear in the error log
+ resource.getErrors().add(new ProfileMigrationDiagnostic(
+ UMLPapyrusCompareMessages.getString("profile.migration.exception", e, resource))); //$NON-NLS-1$
+ UMLPapyrusComparePlugin.getDefault().getLog()
+ .log(new Status(IStatus.ERROR, UMLPapyrusComparePlugin.PLUGIN_ID,
+ "Exception occurred during profile migration", //$NON-NLS-1$
+ e)); // The exception stack trace will appear in the error log
}
return null;
}

Back to the top