Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-01-08 15:46:41 +0000
committerAnsgar Radermacher2014-01-08 16:28:07 +0000
commit929a1c0c63c5cfc5f0f58bfa5b976812b5b5cd08 (patch)
treea03fc6779bb9e1770b5271e30c701be277eaa909 /extraplugins
parent17cb5b00b6eaf5e54ddfb6e0f9c743f7f861e365 (diff)
downloadorg.eclipse.papyrus-929a1c0c63c5cfc5f0f58bfa5b976812b5b5cd08.tar.gz
org.eclipse.papyrus-929a1c0c63c5cfc5f0f58bfa5b976812b5b5cd08.tar.xz
org.eclipse.papyrus-929a1c0c63c5cfc5f0f58bfa5b976812b5b5cd08.zip
- Don't throw exception in case of an instance specification (trivial)
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java15
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java6
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties1
3 files changed, 21 insertions, 1 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java
new file mode 100644
index 00000000000..a3867d5466d
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java
@@ -0,0 +1,15 @@
+package org.eclipse.papyrus.acceleo;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.acceleo.messages"; //$NON-NLS-1$
+ public static String ModelElementsCreator_UnsupportedModelElement;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
index c013219a044..bcd1e2a6c19 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Package;
@@ -145,8 +146,11 @@ abstract public class ModelElementsCreator {
else if(element instanceof SignalEvent) {
// TODO: not supported, but do nothing
}
+ else if(element instanceof InstanceSpecification) {
+ // TODO: not supported, but do nothing
+ }
else {
- throw new RuntimeException("C++ code generator: unsupported model element " + element); //$NON-NLS-1$
+ throw new RuntimeException(String.format(Messages.ModelElementsCreator_UnsupportedModelElement, element));
}
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties
new file mode 100644
index 00000000000..ad6e5a9fa79
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties
@@ -0,0 +1 @@
+ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element %s

Back to the top