diff options
author | Ansgar Radermacher | 2018-10-05 12:58:17 +0000 |
---|---|---|
committer | Patrick Tessier | 2018-10-19 07:46:27 +0000 |
commit | 50d8e30590f967ded03041be10e8cbcfc2414a76 (patch) | |
tree | cdf7688c62db16b78d2a7ebffa4f1b290b61b354 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java | |
parent | 65a7b3c413b602f2b2eaa40fd7d7b9035f32029f (diff) | |
download | org.eclipse.papyrus-50d8e30590f967ded03041be10e8cbcfc2414a76.tar.gz org.eclipse.papyrus-50d8e30590f967ded03041be10e8cbcfc2414a76.tar.xz org.eclipse.papyrus-50d8e30590f967ded03041be10e8cbcfc2414a76.zip |
Bug 539754 - [Customization] Improve error messages
- Add error messages
- Use ClassLoaderHelper instead of directly using bundle.loadClass.
Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java index 19616c59eb9..9018362751d 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java @@ -13,6 +13,8 @@ * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation * Benoit Maggi (Cea) benoit.maggi@cea.fr - Add utility to get the containing diagram * Christian W. Damus - bug 527580 + * Ansgar Radermacher - bug 539754 + * *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.common.utils; @@ -178,13 +180,13 @@ public class DiagramUtils { /** * Gets the prototype of a {@code diagram} according to a given policy {@code checker}. - * + * * @param diagram * a diagram * @param checker * a policy checker * @return the policy {@code checker}'s prototype for the {@code diagram} - * + * * @since 3.2 */ public static ViewPrototype getPrototype(Diagram diagram, PolicyChecker checker) { @@ -262,8 +264,12 @@ public class DiagramUtils { pvs = (PapyrusDiagramStyle) diagram.createStyle(StylePackage.Literals.PAPYRUS_DIAGRAM_STYLE); pvs.setDiagramKindId(prototype.getRepresentationKind().getId()); } - } else - throw new IllegalArgumentException("The diagram's type differs from the prototype's implementation id"); + } else { + throw new IllegalArgumentException( + String.format("The diagram type (=%s) differs from the prototype's implementation id (=%s)", //$NON-NLS-1$ + diagram.getType(), + prototype.getRepresentationKind().getImplementationID())); + } } |