Class DuplicateRelation

    • Method Detail

      • startTest

        public void startTest​(ProgressMonitor monitor)
        Description copied from class: Test
        Start the test using a given progress monitor
        Overrides:
        startTest in class Test
        Parameters:
        monitor - the progress monitor
      • endTest

        public void endTest()
        Description copied from class: Test
        Notification of the end of the test. The tester may perform additional actions and destroy the used structures.

        If you override this method, don't forget to cleanup progressMonitor (most overrides call super.endTest() to do this).

        Overrides:
        endTest in class Test
      • checkOrderAndTags

        private void checkOrderAndTags​(java.util.Set<Relation> sameMembers)
        Check a list of relations which are guaranteed to have the same members, possibly in different order and possibly different tags.
        Parameters:
        sameMembers - the list of relations
      • reportDuplicateKeys

        private void reportDuplicateKeys​(java.util.Collection<Relation> duplicated)
        Check collection of relations with the same keys and members, possibly in different order
        Parameters:
        duplicated - collection of relations, caller must make sure that they have the same keys and members
      • reportDuplicateMembers

        private void reportDuplicateMembers​(java.util.Set<Relation> duplicated)
        Report relations with the same member(s) in the same order, keys may be different
        Parameters:
        duplicated - collection of relations with identical member list
      • cleanedKeys

        private static java.util.Map<java.lang.String,​java.lang.String> cleanedKeys​(OsmPrimitive p)
        return tags of a primitive after removing all discardable tags
        Parameters:
        p - the primitive
        Returns:
        map with cleaned tags
      • getSortedMembers

        private static java.util.List<RelationMembergetSortedMembers​(Relation r)
        Order members of given relation by type, unique id, and role.
        Parameters:
        r - the relation
        Returns:
        sorted list of members
      • fixError

        public Command fixError​(TestError testError)
        Fix the error by removing all but one instance of duplicate relations
        Overrides:
        fixError in class Test
        Parameters:
        testError - The error to fix, must be of type DUPLICATE_RELATION
        Returns:
        The command to fix the error
      • isFixable

        public boolean isFixable​(TestError testError)
        Description copied from class: Test
        Returns true if the given error can be fixed automatically
        Overrides:
        isFixable in class Test
        Parameters:
        testError - The error to check if can be fixed
        Returns:
        true if the error can be fixed