Bug #5826

Diagram profile monitor MappedTypeGroup implementation doesn't do reference relation type comparisons exhaustively enough

Added by Tuukka Lehtonen about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:2015-05-05
Priority:4Due date:2015-05-05
Assignee:Tuukka Lehtonen% Done:

100%

Category:DiagramSpent time:1.00 hour
Target version:1.18.1
Release notes:Improved subtyping tolerance in diagram profile MappedTypeGroup implementation.
Tags: diagram, profile, regression, monitor
Story points-
Velocity based estimate-
ReleaseSimantics 1.18.1Release relationshipAuto

Description

Currently MappedTypeGroup handles diagram reference element type comparisons like this:

                        Resource referenceRelation = graph.getPossibleObject(element, MOD.HasReferenceRelation);
                        if (referenceRelation != null) {
                            Collection<Resource> referencedTypes = graph.getObjects(referenceRelation, MOD.HasReferencedType);
                            if (!Collections.disjoint(types, referencedTypes))
                                result.add(element);
                        }

This does not work if the resources defined in types contain only a base type of what's in referencedTypes.

The fix is to make the code more tolerant by investigating the intersection of the full supertype hierarchy:

                        Resource referenceRelation = graph.getPossibleObject(element, MOD.HasReferenceRelation);
                        if (referenceRelation != null) {
                            Collection<Resource> referencedTypes = graph.getObjects(referenceRelation, MOD.HasReferencedType);
                            if (!Collections.disjoint(types, referencedTypes)) {
                                result.add(element);
                            } else {
                                for (Resource referencedType : referencedTypes) {
                                    Set<Resource> allTypes = graph.getSupertypes(referencedType);
                                    if (!Collections.disjoint(types, allTypes))
                                        result.add(element);
                                }
                            }
                        }

Associated revisions

Revision 31244
Added by Tuukka Lehtonen about 2 years ago

Fixed MappedTypeGroup to take supertype hierarchy into account when comparing types referenced by profile monitor group definitions and diagram reference element relations.

refs #5826

Revision 31246
Added by Tuukka Lehtonen about 2 years ago

Merged trunk@31244 to branches/simantics-1.18 on 2015-05-05 for 1.18.1 release.

refs #5826

Revision 31247
Added by Tuukka Lehtonen about 2 years ago

Merged trunk@31244 to branches/simantics-1.18 on 2015-05-05 for 1.18.1 release.

refs #5826

History

#1 Updated by Tuukka Lehtonen about 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

#2 Updated by Tuukka Lehtonen about 2 years ago

  • Tags changed from diagram, profile, monitor to diagram, profile, monitor, regression

#3 Updated by Tuukka Lehtonen about 2 years ago

  • Release notes set to Improved subtyping tolerance in diagram profile MappedTypeGroup implementation.

#4 Updated by Tuukka Lehtonen about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF