Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r11589 r11781 254 254 } 255 255 256 /** 257 * Reloads all styles from the preferences. 258 */ 256 259 public static void readFromPreferences() { 257 260 styles.clear(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
r11553 r11781 49 49 } 50 50 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 */ 51 57 public Pair<StyleElementList, Range> getWithRange(double scale, boolean selected) { 52 58 int idx = getIndex(selected); … … 88 94 89 95 /** 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 /** 90 104 * Get the size of the intern pool. Only for tests! 91 105 * @return size of the intern pool -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
r11778 r11781 17 17 import org.junit.Rule; 18 18 import org.junit.Test; 19 import org.openstreetmap.josm.JOSMFixture;20 19 import org.openstreetmap.josm.Main; 21 20 import org.openstreetmap.josm.data.Bounds; … … 53 52 @Rule 54 53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 55 public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection().mapStyles() ;54 public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection().mapStyles().timeout(60000); 56 55 57 56 /** … … 112 111 @Test 113 112 public void testStyleCacheInternPool() { 114 // This can be removed if there was no dependency on Main.map in some MapCSS conditions. See #14572 115 JOSMFixture.createFunctionalTestFixture().init(true); 116 113 StyleCache.clearStyleCachePool(); 117 114 Bounds bounds = new Bounds(53.56, 13.25, 53.57, 13.26); 118 115 Rendering visitor = new StyledMapRenderer(g, nc, false); … … 141 138 @Test 142 139 public void testStyleCacheInternPool2() { 143 // This can be removed if there was no dependency on Main.map in some MapCSS conditions. See #14572 144 JOSMFixture.createFunctionalTestFixture().init(true); 145 140 StyleCache.clearStyleCachePool(); 146 141 Bounds bounds = new Bounds(53.56, 13.25, 53.57, 13.26); 147 142 Rendering visitor = new StyledMapRenderer(g, nc, false);
Note:
See TracChangeset
for help on using the changeset viewer.