From 5a6412ada610f48559d2d8ec7427e84e6f18fc0d Mon Sep 17 00:00:00 2001 From: Jan Pikl Date: Fri, 1 Feb 2013 23:52:53 +0100 Subject: [PATCH] Fixed bug in FeatureModelEditPolicy. * was possible to invoke GroupFeaturesCommand on orphaned features. --- .../yafmt/ui/editors/fm/policies/FeatureModelEditPolicy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cz.jpikl.yafmt.ui.editors.fm/src/cz/jpikl/yafmt/ui/editors/fm/policies/FeatureModelEditPolicy.java b/cz.jpikl.yafmt.ui.editors.fm/src/cz/jpikl/yafmt/ui/editors/fm/policies/FeatureModelEditPolicy.java index c17fbfe..838e3ad 100644 --- a/cz.jpikl.yafmt.ui.editors.fm/src/cz/jpikl/yafmt/ui/editors/fm/policies/FeatureModelEditPolicy.java +++ b/cz.jpikl.yafmt.ui.editors.fm/src/cz/jpikl/yafmt/ui/editors/fm/policies/FeatureModelEditPolicy.java @@ -47,10 +47,10 @@ private Command createGroupFeaturesCommand(List selectedEditParts, boolean xo EObject commonParent = null; for(Feature feature: features) { EObject parent = feature.getParent(); - if(parent == null) - return null; if(parent instanceof Group) parent = ((Group) parent).getParent(); + if(!(parent instanceof Feature)) + return null; if(commonParent == null) commonParent = parent; else if(parent != commonParent)