Changeset 15603 in josm for trunk/src


Ignore:
Timestamp:
2019-12-21T03:15:48+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #18441 - Allow plugins to remove a test they added (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r15588 r15603  
    166166    }
    167167
     168    /**
     169     * Removes a test from the list of available tests. This will not remove
     170     * core tests.
     171     *
     172     * @param testClass The test class
     173     * @return {@code true} if the test was removed (see {@link Collection#remove})
     174     * @since 15603
     175     */
     176    public static boolean removeTest(Class<? extends Test> testClass) {
     177        boolean removed = false;
     178        if (!Arrays.asList(CORE_TEST_CLASSES).contains(testClass)) {
     179            removed = allTests.remove(testClass);
     180            allTestsMap.remove(testClass.getName());
     181        }
     182        return removed;
     183    }
     184
    168185    static {
    169186        for (Class<? extends Test> testClass : CORE_TEST_CLASSES) {
Note: See TracChangeset for help on using the changeset viewer.