Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-07-02 07:40:03 -0400
committercletavernie2012-07-02 07:40:03 -0400
commitac7506ca3e2efb4c854c5b99bed11a3f7413686e (patch)
tree5df3654189c9993cf8bed2902bdcccbcf25e52a4 /plugins/infra
parente136d6a491f7a890555ba24c4d98d582da3c0227 (diff)
downloadorg.eclipse.papyrus-ac7506ca3e2efb4c854c5b99bed11a3f7413686e.tar.gz
org.eclipse.papyrus-ac7506ca3e2efb4c854c5b99bed11a3f7413686e.tar.xz
org.eclipse.papyrus-ac7506ca3e2efb4c854c5b99bed11a3f7413686e.zip
370816: [All diagrams] Profiles should be automatically refreshed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370816 Fix a NotFoundException when creating a new Papyrus diagram
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/uml/UmlModel.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/uml/UmlModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/uml/UmlModel.java
index 32b2f763d82..834084c9ae6 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/uml/UmlModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/uml/UmlModel.java
@@ -32,6 +32,7 @@ public class UmlModel extends AbstractBaseModel implements IModel {
*
* @param fullPath
*/
+ @Override
public void createModel(IPath fullPath) {
// Compute model URI
@@ -81,13 +82,12 @@ public class UmlModel extends AbstractBaseModel implements IModel {
* @return
*/
public EObject lookupRoot() throws NotFoundException {
- // TODO Auto-generated method stub
- try {
- return resource.getContents().get(0);
- } catch (IndexOutOfBoundsException e) {
+ if(resource.getContents().isEmpty()) {
// The root doesn't exist.
throw new NotFoundException("No root defined in the model");
}
+
+ return resource.getContents().get(0);
}
}

Back to the top