Changeset 17809 in josm for trunk/test/functional


Ignore:
Timestamp:
2021-04-20T23:52:31+02:00 (4 years ago)
Author:
simon04
Message:

see #20745 - Avoid heap allocations in StyleCache

Fixup r17805.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java

    r17625 r17809  
    1414
    1515import org.junit.jupiter.api.AfterAll;
    16 import org.junit.jupiter.api.BeforeAll;
    1716import org.junit.jupiter.api.BeforeEach;
    1817import org.junit.jupiter.api.Test;
     
    5352    @RegisterExtension
    5453    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    55     public JOSMTestRules test = new JOSMTestRules().preferences().projection().mapStyles().timeout(60000);
     54    public JOSMTestRules test = new JOSMTestRules().main().preferences().projection().mapStyles().timeout(60000);
    5655
    5756    /**
     
    5958     * @throws Exception If an error occurred during load.
    6059     */
    61     @BeforeAll
    62     public static void load() throws Exception {
     60    @BeforeEach
     61    public void load() throws Exception {
    6362        img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB);
    6463        try (InputStream in = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2"))) {
     
    158157                StyleElementList sel = p.a;
    159158                assertNotNull(sel);
    160                 Integer k = counter.get(sel);
    161                 if (k == null) {
    162                     k = 0;
    163                 }
    164                 counter.put(sel, k + 1);
     159                counter.merge(sel, 1, Integer::sum);
    165160            }
    166161        }
Note: See TracChangeset for help on using the changeset viewer.