Program: 147885
Project: 147885
Buggy source:
private void setAnnotationActions(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
    manager.add(setAnnotationPrimaryKeyInfoAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationForeignKeyAction);
    manager.add(setAnnotationFKFilterAction);
    manager.add(setAnnotationForeignKeyInfoAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(new Separator());
    manager.add(setAnnotationWriteAction);
    manager.add(setAnnotationNoAction);
    if (obj instanceof XSDParticle) {
      XSDAnnotationsStructure struc=getStructureByActiveItem();
      manager.add(visibleRuleAction);
      if (struc != null) {
        if (struc.getVisibleRule() != null) {
          XSDVisibleRuleAction deleteVisibleRuleAction=new XSDVisibleRuleAction(this,dataModelName,true);
          manager.add(deleteVisibleRuleAction);
        }
      }
      manager.add(defaultValueRuleAction);
      if (struc != null) {
        if (struc.getDefaultValueRule() != null) {
          XSDDefaultValueRuleAction deleteDefaultRuleAction=new XSDDefaultValueRuleAction(this,dataModelName,true);
          manager.add(deleteDefaultRuleAction);
        }
      }
    }
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels(isLocalInput());
  for (int i=0; i < availablemodels.size(); i++) {
    IAvailableModel model=availablemodels.get(i);
    model.fillContextMenu(obj,manager,this,dataModelName);
    if (i == 1) {
      manager.add(new Separator());
    }
  }
}

Fixed version (ground truth):
private void setAnnotationActions(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
    manager.add(setAnnotationPrimaryKeyInfoAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationForeignKeyAction);
    manager.add(setAnnotationFKFilterAction);
    manager.add(setAnnotationForeignKeyInfoAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(new Separator());
    manager.add(setAnnotationWriteAction);
    manager.add(setAnnotationNoAction);
    if (obj instanceof XSDParticle) {
      XSDAnnotationsStructure struc=getStructureByActiveItem();
      manager.add(visibleRuleAction);
      if (struc != null) {
        if (struc.getVisibleRule() != null) {
          XSDVisibleRuleAction deleteVisibleRuleAction=new XSDVisibleRuleAction(this,dataModelName,true);
          manager.add(deleteVisibleRuleAction);
        }
      }
      boolean enabled=!isAutoGeneratedType((XSDParticle)obj);
      manager.add(defaultValueRuleAction);
      defaultValueRuleAction.setEnabled(enabled);
      if (struc != null) {
        if (struc.getDefaultValueRule() != null) {
          XSDDefaultValueRuleAction deleteDefaultRuleAction=new XSDDefaultValueRuleAction(this,dataModelName,true);
          manager.add(deleteDefaultRuleAction);
          deleteDefaultRuleAction.setEnabled(enabled);
        }
      }
    }
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels(isLocalInput());
  for (int i=0; i < availablemodels.size(); i++) {
    IAvailableModel model=availablemodels.get(i);
    model.fillContextMenu(obj,manager,this,dataModelName);
    if (i == 1) {
      manager.add(new Separator());
    }
  }
}