Changeset 11781 in josm for trunk/src


Ignore:
Timestamp:
2017-03-26T13:52:10+02:00 (2 years ago)
Author:
michael2402
Message:

Update StyleCacheTest: Clear the style cache before each test. Add documentation.

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r11589 r11781  
    254254    }
    255255
     256    /**
     257     * Reloads all styles from the preferences.
     258     */
    256259    public static void readFromPreferences() {
    257260        styles.clear();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r11553 r11781  
    4949    }
    5050
     51    /**
     52     * Get the style for a specific style. Returns the range as well.
     53     * @param scale The current scale
     54     * @param selected true to get the state for a selected element,
     55     * @return The style and the range it is valid for.
     56     */
    5157    public Pair<StyleElementList, Range> getWithRange(double scale, boolean selected) {
    5258        int idx = getIndex(selected);
     
    8894
    8995    /**
     96     * Clears the style cache. This should only be used for testing.
     97     * It may be removed some day and replaced by a WeakReference implementation that automatically forgets old entries.
     98     */
     99    static void clearStyleCachePool() {
     100        internPool.clear();
     101    }
     102
     103    /**
    90104     * Get the size of the intern pool. Only for tests!
    91105     * @return size of the intern pool
Note: See TracChangeset for help on using the changeset viewer.