public static IList <EvolutionChange> Detect(Version v1, Version v2, PSMClass psmClass)
        {
            List <EvolutionChange> result = new List <EvolutionChange>();

            if (((PSMClass)psmClass.GetInVersion(v1)).IsStructuralRepresentative !=
                ((PSMClass)psmClass.GetInVersion(v2)).IsStructuralRepresentative)
            {
                ClassIsStructuralRepresentativeChange c = new ClassIsStructuralRepresentativeChange(psmClass)
                {
                    OldVersion = v1, NewVersion = v2
                };
                result.Add(c);
            }

            return(result);
        }
Пример #2
0
        public IEnumerable <PSMClass> FindNewStructuralRepresentatives()
        {
            List <PSMClass> result = new List <PSMClass>();

            foreach (List <EvolutionChange> evolutionChanges in changesByTarget.Values)
            {
                foreach (EvolutionChange change in evolutionChanges)
                {
                    {
                        ClassIsStructuralRepresentativeChange srChanged = change as ClassIsStructuralRepresentativeChange;
                        if (srChanged != null && (srChanged.InvalidatesAttributes || srChanged.InvalidatesContent))
                        {
                            if (srChanged.NewIsStructuralRepresentative)
                            {
                                result.Add(srChanged.PSMClass);
                            }
                        }
                    }
                }
            }
            return(result);
        }