Changeset 11324 in josm for trunk


Ignore:
Timestamp:
2016-11-27T05:16:30+01:00 (3 years ago)
Author:
Don-vip
Message:

findbugs

Location:
trunk
Files:
1 added
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r11310 r11324  
    663663        <sequential>
    664664            <echo message="Generating Taginfo for type @{type} to @{output}"/>
    665             <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar">
     665            <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar:tools/findbugs/annotations.jar">
    666666                <arg value="-t"/>
    667667                <arg value="@{type}"/>
  • trunk/scripts/BuildProjectionDefinitions.java

    r9667 r11324  
    6363        }
    6464
    65         try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
    66                 new FileOutputStream(baseDir + File.separator + OUTPUT_EPSG_FILE), StandardCharsets.UTF_8))) {
     65        try (FileOutputStream output = new FileOutputStream(baseDir + File.separator + OUTPUT_EPSG_FILE);
     66             BufferedWriter out = new BufferedWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8))) {
    6767            out.write("## This file is autogenerated, do not edit!\n");
    6868            out.write("## Run ant task \"epsg\" to rebuild.\n");
    69             out.write(String.format("## Source files are %s (can be changed) and %s (copied from the proj.4 project).%n", JOSM_EPSG_FILE, PROJ4_EPSG_FILE));
     69            out.write(String.format("## Source files are %s (can be changed) and %s (copied from the proj.4 project).%n",
     70                    JOSM_EPSG_FILE, PROJ4_EPSG_FILE));
    7071            out.write("##\n");
    7172            out.write("## Entries checked and maintained by the JOSM team:\n");
  • trunk/scripts/TagInfoExtract.groovy

    r11252 r11324  
    99 * groovy -cp dist/josm-custom.jar scripts/taginfoextract.groovy -t external_presets
    1010 */
    11 import groovy.json.JsonBuilder
    12 
    1311import java.awt.image.BufferedImage
    1412import java.nio.file.FileSystems
     
    4947import org.openstreetmap.josm.tools.Utils
    5048
     49import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
     50import groovy.json.JsonBuilder
     51
    5152class TagInfoExtract {
    5253
     
    118119    }
    119120
     121    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
    120122    class NodeChecker extends Checker {
    121123        NodeChecker(tag) {
     
    137139    }
    138140
     141    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
    139142    class WayChecker extends Checker {
    140143        WayChecker(tag) {
     
    159162    }
    160163
     164    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
    161165    class AreaChecker extends Checker {
    162166        AreaChecker(tag) {
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r10937 r11324  
    1515import java.io.PrintWriter;
    1616import java.nio.charset.StandardCharsets;
     17import java.security.SecureRandom;
    1718import java.text.MessageFormat;
    1819import java.util.ArrayList;
    1920import java.util.Locale;
     21import java.util.Random;
    2022import java.util.logging.Logger;
    2123
     
    3941import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    4042
     43import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     44
    4145/**
    4246 * Unit tests of {@link MultiFetchServerObjectReader}.
    4347 */
     48@SuppressFBWarnings(value = "CRLF_INJECTION_LOGS")
    4449public class MultiFetchServerObjectReaderTest {
    4550    private static Logger logger = Logger.getLogger(MultiFetchServerObjectReader.class.getName());
     
    5964        DataSet ds = new DataSet();
    6065        ds.setVersion("0.6");
     66        Random rand = new SecureRandom();
    6167
    6268        int numNodes = 1000;
     
    8187        for (int i = 0; i < numWays; i++) {
    8288            Way w = new Way();
    83             int numNodesInWay = 2 + (int) Math.round(Math.random() * 5);
    84             int start = (int) Math.round(Math.random() * numNodes);
     89            int numNodesInWay = 2 + (int) Math.round(rand.nextDouble() * 5);
     90            int start = (int) Math.round(rand.nextDouble() * numNodes);
    8591            for (int j = 0; j < numNodesInWay; j++) {
    8692                int idx = (start + j) % numNodes;
     
    98104            Relation r = new Relation();
    99105            r.put("name", "relation-" +i);
    100             int numNodesInRelation = (int) Math.round(Math.random() * 10);
    101             int start = (int) Math.round(Math.random() * numNodes);
     106            int numNodesInRelation = (int) Math.round(rand.nextDouble() * 10);
     107            int start = (int) Math.round(rand.nextDouble() * numNodes);
    102108            for (int j = 0; j < numNodesInRelation; j++) {
    103109                int idx = (start + j) % 500;
     
    105111                r.addMember(new RelationMember("role-" + j, n));
    106112            }
    107             int numWaysInRelation = (int) Math.round(Math.random() * 10);
    108             start = (int) Math.round(Math.random() * numWays);
     113            int numWaysInRelation = (int) Math.round(rand.nextDouble() * 10);
     114            start = (int) Math.round(rand.nextDouble() * numWays);
    109115            for (int j = 0; j < numWaysInRelation; j++) {
    110116                int idx = (start + j) % 500;
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r11060 r11324  
    4444import org.openstreetmap.josm.tools.Logging;
    4545
     46import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     47
    4648/**
    4749 * Reads primitives referring to a particular primitive (ways including a node, relations referring to a relation)
    4850 * @since 1806
    4951 */
     52@SuppressFBWarnings(value = "CRLF_INJECTION_LOGS")
    5053public class OsmServerBackreferenceReaderTest {
    5154    private static final Logger logger = Logger.getLogger(OsmServerBackreferenceReader.class.getName());
  • trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java

    r10674 r11324  
    112112    }
    113113
     114    @SuppressFBWarnings(value = "DM_GC")
    114115    private static void cleanSystem() {
    115116        System.gc();
  • trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java

    r11114 r11324  
    88import static org.junit.Assert.assertTrue;
    99
     10import java.security.SecureRandom;
    1011import java.util.ArrayList;
    1112import java.util.Random;
     
    125126    public void generateTestStrings() {
    126127        testStrings.clear();
    127         random = new Random(123);
     128        random = new SecureRandom();
    128129        for (int i = 0; i < TEST_STRING_COUNT; i++) {
    129130            testStrings.add(RandomStringUtils.random(10, 0, 0, true, true, null, random));
  • trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java

    r8926 r11324  
    33
    44import java.io.File;
     5import java.security.SecureRandom;
    56import java.util.ArrayList;
    67import java.util.Random;
     
    4142         */
    4243        public RandomStringList(int seed, int size) {
    43             random = new Random(seed);
     44            random = new SecureRandom();
     45            random.setSeed(seed);
    4446            strings = new String[size];
    4547            interned = new String[size];
     
    8890        protected DataGenerator(String datasetName) {
    8991            this.datasetName = datasetName;
    90             this.random = new Random(1234);
     92            this.random = new SecureRandom();
    9193        }
    9294
     
    126128         */
    127129        public File getFile() {
    128             return new File(DATA_DIR + File.separator + datasetName + ".osm");
     130            return new File(DATA_DIR, datasetName + ".osm");
    129131        }
    130132
     
    139141        @Override
    140142        public String toString() {
    141             return "DataGenerator [datasetName=" + datasetName + "]";
     143            return "DataGenerator [datasetName=" + datasetName + ']';
    142144        }
    143145    }
  • trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java

    r10697 r11324  
    166166        public int noIterations = 7;
    167167        public boolean dumpImage = DUMP_IMAGE;
    168         public boolean skipDraw = false;
    169168        public boolean clearStyleCache = true;
    170169        public String label = "";
     
    264263        test.bounds = BOUNDS_CITY_ALL;
    265264        test.label = "big";
    266         test.skipDraw = true;
    267265        test.dumpImage = false;
    268266        test.noWarmup = 3;
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r11104 r11324  
    1010import java.io.InputStream;
    1111import java.lang.reflect.Field;
     12import java.security.AccessController;
     13import java.security.PrivilegedAction;
    1214import java.util.Arrays;
    1315import java.util.Collection;
     
    7981     */
    8082    public static InputStream getRegressionDataStream(int ticketid, String filename) throws IOException {
    81         return Compression.getUncompressedFileInputStream(new File(getRegressionDataDir(ticketid) + '/' + filename));
     83        return Compression.getUncompressedFileInputStream(new File(getRegressionDataDir(ticketid), filename));
    8284    }
    8385
     
    173175    public static Object getPrivateField(Object obj, String fieldName) throws ReflectiveOperationException {
    174176        Field f = obj.getClass().getDeclaredField(fieldName);
    175         f.setAccessible(true);
     177        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
     178            f.setAccessible(true);
     179            return null;
     180        });
    176181        return f.get(obj);
    177182    }
  • trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java

    r10443 r11324  
    2020import org.openstreetmap.josm.testutils.JOSMTestRules;
    2121
     22import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     23
    2224/**
    2325 * Unit tests for class {@link SelectByInternalPointAction}.
     
    2931     */
    3032    @Rule
     33    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3134    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
    3235
  • trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java

    r11192 r11324  
    2727import org.openstreetmap.josm.tools.date.DateUtils;
    2828
     29import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     30
    2931/**
    3032 * Unit tests for class {@link SearchCompiler}.
     
    3638     */
    3739    @Rule
     40    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3841    public JOSMTestRules test = new JOSMTestRules().preferences();
    3942
  • trunk/test/unit/org/openstreetmap/josm/data/AutosaveTaskTest.java

    r11035 r11324  
    88import static org.junit.Assert.assertTrue;
    99
     10import java.io.BufferedWriter;
    1011import java.io.File;
    11 import java.io.FileWriter;
    12 import java.io.FilenameFilter;
    1312import java.io.IOException;
     13import java.nio.charset.StandardCharsets;
    1414import java.nio.file.Files;
    1515import java.nio.file.Paths;
     
    143143
    144144    private int countFiles() {
    145         return task.getAutosaveDir().toFile().list(new FilenameFilter() {
    146             @Override
    147             public boolean accept(File dir, String name) {
    148                 return name.endsWith(".osm");
    149             }
    150         }).length;
     145        String[] files = task.getAutosaveDir().toFile().list((dir, name) -> name.endsWith(".osm"));
     146        return files != null ? files.length : 0;
    151147    }
    152148
     
    194190    public void testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException {
    195191        runAutosaveTaskSeveralTimes(1);
    196         try (FileWriter file = new FileWriter(new File(task.getAutosaveDir().toFile(), "any_other_file.osm"))) {
     192        try (BufferedWriter file = Files.newBufferedWriter(
     193                new File(task.getAutosaveDir().toFile(), "any_other_file.osm").toPath(), StandardCharsets.UTF_8)) {
    197194            file.append("");
    198195        }
     
    237234    public void testRecoverLayers() throws Exception {
    238235        runAutosaveTaskSeveralTimes(1);
    239         try (FileWriter file = new FileWriter(new File(task.getAutosaveDir().toFile(), "any_other_file.osm"))) {
     236        try (BufferedWriter file = Files.newBufferedWriter(
     237                new File(task.getAutosaveDir().toFile(), "any_other_file.osm").toPath(), StandardCharsets.UTF_8)) {
    240238            file.append("<?xml version=\"1.0\"?><osm version=\"0.6\"><node id=\"1\" lat=\"1\" lon=\"2\" version=\"1\"/></osm>");
    241239        }
  • trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java

    r10962 r11324  
    4545            File cacheFile = new File("foobar/testUseBigDiskFile_BLOCK_v2.data");
    4646            if (!cacheFile.exists()) {
    47                 cacheFile.createNewFile();
     47                if (!cacheFile.createNewFile()) {
     48                    System.err.println("Unable to create " + cacheFile.getAbsolutePath());
     49                }
    4850            }
    4951            try (FileOutputStream fileOutputStream = new FileOutputStream(cacheFile, false)) {
  • trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java

    r11121 r11324  
    3131     */
    3232    @Test
     33    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
    3334    public void testSetKeys() {
    3435        final Changeset cs = new Changeset();
  • trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java

    r10946 r11324  
    1515import org.openstreetmap.josm.data.coor.LatLon;
    1616
     17import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     18
    1719public class NodeDataTest {
    1820
     21    @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
    1922    private static NodeData serializeUnserialize(NodeData data) throws IOException, ClassNotFoundException {
    2023        try (ByteArrayOutputStream bytes = new ByteArrayOutputStream();
  • trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java

    r11269 r11324  
    44import java.io.FileInputStream;
    55import java.io.InputStream;
     6import java.security.SecureRandom;
    67import java.util.ArrayList;
    78import java.util.Arrays;
     
    193194
    194195        // force splits in quad buckets
    195         Random random = new Random(31);
     196        Random random = new SecureRandom();
    196197        for (int i = 0; i < NUM_COMPLETE_WAYS; i++) {
    197198            Way w = new Way(wayId++);
     
    213214
    214215        // add some incomplete nodes
    215         List<Node> incompleteNodes = new ArrayList<>();
    216216        for (int i = 0; i < NUM_INCOMPLETE_NODES; i++) {
    217217            Node n = new Node(nodeId++);
    218             incompleteNodes.add(n);
    219218            n.setIncomplete(true);
    220219            ds.addPrimitive(n);
  • trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java

    r10733 r11324  
    1111import org.junit.Test;
    1212
     13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14
    1315public class WayDataTest {
     16
    1417    @Test
     18    @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
    1519    public void testSerializationForDragAndDrop() throws Exception {
    1620        final WayData data = new WayData();
  • trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java

    r10758 r11324  
    22package org.openstreetmap.josm.data.projection;
    33
     4import java.security.SecureRandom;
    45import java.util.Random;
    56
     
    2021    @Test
    2122    public void testLatLon2Cart2LatLon() {
    22         Random r = new Random(System.currentTimeMillis());
     23        Random r = new SecureRandom();
    2324        double maxErrLat = 0, maxErrLon = 0;
    2425        Ellipsoid ellips = Ellipsoid.WGS84;
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r10758 r11324  
    66import java.io.File;
    77import java.io.FileInputStream;
    8 import java.io.FileNotFoundException;
    98import java.io.FileOutputStream;
    109import java.io.IOException;
     
    1413import java.io.OutputStreamWriter;
    1514import java.nio.charset.StandardCharsets;
     15import java.security.SecureRandom;
    1616import java.util.ArrayList;
    1717import java.util.Arrays;
     
    3838import org.openstreetmap.josm.tools.Pair;
    3939import org.openstreetmap.josm.tools.Utils;
     40
     41import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    4042
    4143/**
     
    7274    }
    7375
    74     static Random rand = new Random();
    75 
    76     public static void main(String[] args) throws FileNotFoundException, IOException {
     76    static Random rand = new SecureRandom();
     77
     78    /**
     79     * Program entry point.
     80     * @param args no argument is expected
     81     * @throws IOException in case of I/O error
     82     */
     83    public static void main(String[] args) throws IOException {
    7784        Collection<RefEntry> refs = readData();
    7885        refs = updateData(refs);
     
    200207
    201208    /**
    202      * Run external cs2cs command from the PROJ.4 library to convert lat/lon to
    203      * east/north value.
     209     * Run external cs2cs command from the PROJ.4 library to convert lat/lon to east/north value.
    204210     * @param def the proj.4 projection definition string
    205211     * @param ll the LatLon
    206212     * @return projected EastNorth or null in case of error
    207213     */
     214    @SuppressFBWarnings(value = "COMMAND_INJECTION")
    208215    private static EastNorth latlon2eastNorthProj4(String def, LatLon ll) {
    209216        List<String> args = new ArrayList<>();
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r10758 r11324  
    1212import java.io.OutputStreamWriter;
    1313import java.nio.charset.StandardCharsets;
     14import java.security.SecureRandom;
    1415import java.util.ArrayList;
    1516import java.util.HashMap;
     
    8687        }
    8788
    88         Random rand = new Random();
     89        Random rand = new SecureRandom();
    8990        try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
    9091                new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java

    r10758 r11324  
    22package org.openstreetmap.josm.data.projection;
    33
     4import java.security.SecureRandom;
    45import java.util.Arrays;
    56import java.util.Collection;
     
    1819public class ProjectionTest {
    1920
    20     private static Random rand = new Random(System.currentTimeMillis());
     21    private static Random rand = new SecureRandom();
    2122
    2223    boolean error;
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r10983 r11324  
    99import java.io.IOException;
    1010import java.io.PrintStream;
     11import java.nio.charset.StandardCharsets;
    1112import java.util.Arrays;
    1213import java.util.Collection;
    13 
    14 import javax.swing.event.ChangeEvent;
    15 import javax.swing.event.ChangeListener;
    1614
    1715import org.junit.BeforeClass;
     
    2523import org.openstreetmap.josm.plugins.PluginListParseException;
    2624import org.openstreetmap.josm.plugins.PluginListParser;
     25
     26import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2727
    2828/**
     
    3939    }
    4040
     41    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
    4142    private void testShow(final String arg, String expected) throws InterruptedException, IOException {
    4243        PrintStream old = System.out;
     
    4950                }
    5051            };
    51             t.run();
     52            t.start();
    5253            t.join();
    5354            System.out.flush();
    54             assertEquals(expected, baos.toString().trim());
     55            assertEquals(expected, baos.toString(StandardCharsets.UTF_8.name()).trim());
    5556        } finally {
    5657            System.setOut(old);
     
    8586        try {
    8687            System.setProperty("josm.plugins", "buildings_tools,plastic_laf");
    87             SplashProgressMonitor monitor = new SplashProgressMonitor("foo", new ChangeListener() {
    88                 @Override
    89                 public void stateChanged(ChangeEvent e) {
    90                     // Do nothing
    91                 }
     88            SplashProgressMonitor monitor = new SplashProgressMonitor("foo", e -> {
     89                // Do nothing
    9290            });
    9391            Collection<PluginInformation> plugins = MainApplication.updateAndLoadEarlyPlugins(null, monitor);
  • trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java

    r10405 r11324  
    3232public class NavigatableComponentTest {
    3333
    34     private final class NavigatableComponentMock extends NavigatableComponent {
     34    private static final class NavigatableComponentMock extends NavigatableComponent {
    3535        @Override
    3636        public Point getLocationOnScreen() {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java

    r10744 r11324  
    4343    }
    4444
    45     protected class AbstractTestOsmLayer extends OsmDataLayer {
     45    protected static class AbstractTestOsmLayer extends OsmDataLayer {
    4646        public AbstractTestOsmLayer() {
    4747            super(new DataSet(), "OSM layer", null);
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java

    r10937 r11324  
    2020import javax.net.ssl.HttpsURLConnection;
    2121import javax.net.ssl.SSLContext;
    22 import javax.net.ssl.SSLSession;
    2322import javax.net.ssl.TrustManager;
    2423import javax.net.ssl.X509TrustManager;
     
    2928import org.openstreetmap.josm.JOSMFixture;
    3029import org.openstreetmap.josm.Main;
     30
     31import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3132
    3233/**
     
    7778            new X509TrustManager() {
    7879                @Override
     80                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
    7981                public X509Certificate[] getAcceptedIssuers() {
    8082                    return new X509Certificate[0];
     
    8284
    8385                @Override
     86                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
    8487                public void checkClientTrusted(X509Certificate[] certs, String authType) {
    8588                }
    8689
    8790                @Override
     91                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
    8892                public void checkServerTrusted(X509Certificate[] certs, String authType) {
    8993                }
     
    97101
    98102        // Create all-trusting host name verifier
    99         HostnameVerifier allHostsValid = new HostnameVerifier() {
    100             @Override
    101             public boolean verify(String hostname, SSLSession session) {
    102                 return true;
    103             }
    104         };
     103        HostnameVerifier allHostsValid = (hostname, session) -> true;
    105104
    106105        // Install the all-trusting host verifier
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java

    r10571 r11324  
    4343    private List<Layer> testRead(String sessionFileName) throws IOException, IllegalDataException {
    4444        boolean zip = sessionFileName.endsWith(".joz");
    45         File file = new File(getSessionDataDir()+"/"+sessionFileName);
     45        File file = new File(getSessionDataDir(), sessionFileName);
    4646        SessionReader reader = new SessionReader();
    4747        reader.loadSession(file, zip, null);
  • trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java

    r10899 r11324  
    55import static org.junit.Assert.assertEquals;
    66import static org.junit.Assert.assertFalse;
     7import static org.junit.Assert.assertNotNull;
    78import static org.junit.Assert.assertNull;
    89import static org.junit.Assert.assertTrue;
     
    1819import org.junit.Test;
    1920
     21import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     22
    2023/**
    2124 * @author michael
     
    7376    }
    7477
     78    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION")
    7579    private void testLogCaptured(Level level, Consumer<String> expectedTester, Runnable printMessage) {
    7680        Logging.setLogLevel(level);
     
    7882        printMessage.run();
    7983
     84        assertNotNull(captured);
    8085        expectedTester.accept(captured.getMessage());
    8186        assertEquals(level, captured.getLevel());
  • trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java

    r11267 r11324  
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
    1010
     11import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     12
    1113/**
    1214 * Unit tests of {@link RightAndLefthandTraffic} class.
     
    1719     */
    1820    @Rule
     21    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    1922    public JOSMTestRules rules = new JOSMTestRules().platform().projection().commands();
    2023
  • trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java

    r11247 r11324  
    1212import org.openstreetmap.josm.testutils.JOSMTestRules;
    1313
     14import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     15
    1416/**
    1517 * Unit tests of {@link Territories} class.
     
    2022     */
    2123    @Rule
     24    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2225    public JOSMTestRules rules = new JOSMTestRules().platform().projection().commands();
    2326
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r11320 r11324  
    1616import org.openstreetmap.josm.testutils.JOSMTestRules;
    1717
     18import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     19
    1820/**
    1921 * Unit tests of {@link Utils} class.
     
    2426     */
    2527    @Rule
     28    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2629    public JOSMTestRules rules = new JOSMTestRules();
    2730
Note: See TracChangeset for help on using the changeset viewer.