summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Pascual2014-07-31 06:08:10 (EDT)
committerGabriel Pascual2014-07-31 06:08:10 (EDT)
commitd52b73ed50ac513d6c9098a986cf3c6f088f6953 (patch)
tree40e64494b955bd49028188ec5f42a41130592946
parentc1b76bd45899b4ea674b10eea29dae887abfc8da (diff)
downloadorg.eclipse.papyrus-d52b73ed50ac513d6c9098a986cf3c6f088f6953.zip
org.eclipse.papyrus-d52b73ed50ac513d6c9098a986cf3c6f088f6953.tar.gz
org.eclipse.papyrus-d52b73ed50ac513d6c9098a986cf3c6f088f6953.tar.bz2
440864: [Profile] Exception is thrown applying Profile with no Papyrusrefs/changes/89/30789/1
version https://bugs.eclipse.org/bugs/show_bug.cgi?id=440864 - Manage no Papyrus profile Change-Id: I0b599c9c1e81c8971f02696ea962a6779f957712 Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net>
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
index b49760e..95e5fdd 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
@@ -121,8 +121,12 @@ public class ApplyProfileCommand extends RecordingCommand {
// Save version of applied profile if necessary
if(saveProfileApplicationVersion) {
ProfileApplication profileApplication = umlPackage.getProfileApplication(profile);
+
+ // Get version annotation in case it is a Papyrus profile
EAnnotation versionAnnotation = profile.getDefinition().getEAnnotation(IPapyrusVersionConstants.PAPYRUS_EANNOTATION_SOURCE);
- profileApplication.getEAnnotations().add(0, EcoreUtil.copy(versionAnnotation));
+ if(versionAnnotation != null) {
+ profileApplication.getEAnnotations().add(0, EcoreUtil.copy(versionAnnotation));
+ }
}
}
}