Ignore:
Timestamp:
2016-05-15T21:14:06+02:00 (9 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/data/osm
Files:
4 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}
Note: See TracChangeset for help on using the changeset viewer.