Changeset 10222 in josm for trunk/test/performance/org


Ignore:
Timestamp:
2016-05-15T21:14:06+02:00 (8 years ago)
Author:
Don-vip
Message:

findbugs - fix/suppress most of warnings reported in unit tests + enable low confidence warnings for core

Location:
trunk/test/performance/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java

    r10002 r10222  
    2020import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer;
    2121import org.openstreetmap.josm.data.osm.OsmDataGenerator.KeyValueDataGenerator;
     22
     23import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2224
    2325/**
     
    3840     */
    3941    @Rule
     42    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4043    public Timeout globalTimeout = Timeout.seconds(15*60);
    4144
     
    5255     */
    5356    @Test
    54     public void meassureStringEqualsIntern() {
     57    @SuppressFBWarnings(value = "DM_STRING_CTOR", justification = "test Strings that are interned and those that are not")
     58    public void measureStringEqualsIntern() {
    5559        String str1Interned = "string1";
    5660        String str1InternedB = "string1";
     
    196200     */
    197201    @Test
     202    @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
    198203    public void testKeyValueGetKeysGet() {
    199204        for (double tagNodeRatio : TAG_NODE_RATIOS) {
  • trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java

    r7937 r10222  
    77import org.openstreetmap.josm.data.coor.LatLon;
    88import org.openstreetmap.josm.data.coor.LatLonTest;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    911
    1012/**
     
    2224     */
    2325    @Test
     26    @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
    2427    public void test() {
    2528        final int n = 1000000;
  • trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java

    r10197 r10222  
    2424import org.openstreetmap.josm.io.OsmReader;
    2525
     26import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     27
    2628/**
    2729 * Abstract superclass of {@code StyledMapRendererPerformanceTest} and {@code WireframeMapRendererPerformanceTest}.
     
    3234    private static final int IMG_HEIGHT = 1050;
    3335
     36    @SuppressFBWarnings(value = "MS_PKGPROTECT")
    3437    protected static Graphics2D g;
     38    @SuppressFBWarnings(value = "MS_PKGPROTECT")
    3539    protected static BufferedImage img;
     40    @SuppressFBWarnings(value = "MS_PKGPROTECT")
    3641    protected static NavigatableComponent nc;
    3742    private static DataSet dsRestriction;
     
    4348     */
    4449    @Rule
     50    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4551    public Timeout globalTimeout = Timeout.seconds(15*60);
    4652
     
    121127    }
    122128
    123     /** run this manually to verify that the rendering is set up properly */
     129    /**
     130     * run this manually to verify that the rendering is set up properly
     131     * @throws IOException if any I/O error occurs
     132     */
     133    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD")
    124134    private void dumpRenderedImage() throws IOException {
    125         File outputfile = new File("test-neubrandenburg.png");
    126         ImageIO.write(img, "png", outputfile);
     135        ImageIO.write(img, "png", new File("test-neubrandenburg.png"));
    127136    }
    128137}
  • trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java

    r10197 r10222  
    99import org.junit.BeforeClass;
    1010import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
     11
     12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1113
    1214/**
     
    2729    }
    2830
    29     /** run this manually to verify that the rendering is set up properly */
     31    /**
     32     * run this manually to verify that the rendering is set up properly
     33     * @throws IOException if any I/O error occurs
     34     */
     35    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD")
    3036    private void dumpRenderedImage() throws IOException {
    31         File outputfile = new File("test-neubrandenburg.png");
    32         ImageIO.write(img, "png", outputfile);
     37        ImageIO.write(img, "png", new File("test-neubrandenburg.png"));
    3338    }
    3439}
  • trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java

    r9793 r10222  
    1212import java.util.EnumMap;
    1313import java.util.List;
     14import java.util.Locale;
    1415import java.util.Map;
    1516
     
    4142import org.openstreetmap.josm.io.OsmReader;
    4243
     44import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     45
    4346public class MapRendererPerformanceTest {
    4447
     
    6568        ICON, SYMBOL, NODE_TEXT, LINE, LINE_TEXT, AREA;
    6669        public String label() {
    67             return name().toLowerCase();
     70            return name().toLowerCase(Locale.ENGLISH);
    6871        }
    6972    }
     
    7578     */
    7679    @Rule
     80    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    7781    public Timeout globalTimeout = Timeout.seconds(15*60);
    7882
     
    171175        private final List<Long> totalTimes = new ArrayList<>();
    172176
     177        @SuppressFBWarnings(value = "DM_GC")
    173178        public void run() throws IOException {
    174179            boolean checkScale = false;
     
    314319
    315320    public static void dumpTimes(StyledMapRenderer.BenchmarkData bd) {
    316         System.out.print(String.format("gen. %3d, sort %3d, draw %3d\n", bd.generateTime, bd.sortTime, bd.drawTime));
     321        System.out.print(String.format("gen. %3d, sort %3d, draw %3d%n", bd.generateTime, bd.sortTime, bd.drawTime));
    317322    }
    318323
  • trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java

    r9771 r10222  
    1313import org.openstreetmap.josm.gui.mappaint.MultiCascade;
    1414
     15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16
    1517/**
    1618 * Tests how fast {@link MapCSSStyleSource} finds the right style candidates for one object.
     
    2123    private static final int TEST_RULE_COUNT = 10000;
    2224
    23     private class CssGenerator {
     25    private static class CssGenerator {
    2426        StringBuilder sb = new StringBuilder();
    2527        private KeyValueDataGenerator generator;
     
    8385     */
    8486    @Rule
     87    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    8588    public Timeout globalTimeout = Timeout.seconds(15*60);
    8689
  • trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java

    r9491 r10222  
    2020import org.openstreetmap.josm.data.osm.DataSet;
    2121
     22import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     23
    2224/**
    2325 * This test tests how fast we are at reading an OSM file.
     
    3537     */
    3638    @Rule
     39    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3740    public Timeout globalTimeout = Timeout.seconds(15*60);
    3841
Note: See TracChangeset for help on using the changeset viewer.