Community
Participate
Working Groups
It's a bug. I am providing a fix below. In summary - it manifests in a class shape with attributes and operations (with signatutres showing) . One has to set a return type of operation or attribute type to another class or primitive type (e.g. MyClass or MyType) and then change the name of MyClass and MyType - the labels of operaions and attributes will not update. It happens because on event notification (when a new return type is assigned) the operation\attrubute is not made to listen to the changes in that new type (and old subscription , if any, is not removed either). The fix is to the TextCompartmentEditPart.handleNotification() method : protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)){ Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) refreshUnderline(); else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) refreshStrikeThrough(); else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else if (isAffectingParserOptions(event)) { refreshParserOptions(); refreshLabel(); }else if (getParser() != null) { // if the parser happens to be sematic it should do areSematicElementsAffected as // a part of isAffectingEvent , then this concuction below should become unnesessary // see RATLC00547391 boolean sematicsAffected = getParser() instanceof ISemanticParser && ((ISemanticParser) getParser()).areSemanticElementsAffected( null, event); boolean parserAffected = getParser().isAffectingEvent(event, getParserOptions().intValue()); if (sematicsAffected) { removeSemanticListeners(); if (resolveSemanticElement() != null) addSemanticListeners(); } if (sematicsAffected || parserAffected) refreshLabel(); } super.handleNotificationEvent(event); }
Committed the proposed fix with minor modifications (comments and formatting).
Can Natalia please attach a patch containing what's in the comment below so that the IP log generator can find this contribution? We've got the contributed keyword, which is great, but without an actual patch attachment by the contributor, this is missed. Thanks!
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug