Changeset 12808 in josm for trunk/src/org


Ignore:
Timestamp:
2017-09-09T20:13:14+02:00 (7 years ago)
Author:
Don-vip
Message:

SpotBugs - fix some warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r12804 r12808  
    66
    77import java.awt.BorderLayout;
     8import java.awt.Container;
    89import java.awt.Dimension;
    910import java.awt.GraphicsEnvironment;
     
    932933                !args.hasOption(Option.NO_MAXIMIZE) && Main.pref.getBoolean("gui.maximized", false));
    933934        final MainFrame mainFrame = new MainFrame(geometry);
    934         if (mainFrame.getContentPane() instanceof JComponent) {
    935             contentPanePrivate = (JComponent) mainFrame.getContentPane();
     935        final Container contentPane = mainFrame.getContentPane();
     936        if (contentPane instanceof JComponent) {
     937            contentPanePrivate = (JComponent) contentPane;
    936938        }
    937939        mainPanel = mainFrame.getPanel();
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r11948 r12808  
    621621                while (splitChildren.hasNext()) {
    622622                    Node splitChild = splitChildren.next();
    623                     Divider dividerChild =
    624                         splitChildren.hasNext() ? (Divider) (splitChildren.next()) : null;
     623                    Divider dividerChild = null;
     624                    if (splitChildren.hasNext()) {
     625                        Node next = splitChildren.next();
     626                        if (next instanceof Divider) {
     627                            dividerChild = (Divider) next;
     628                        }
     629                    }
    625630
    626631                    double childWidth;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r12722 r12808  
    13161316        // convert rotatedAngle to an integer value from 0 to 360
    13171317        Long angleLong = Math.round(rotatedAngle % 360);
    1318         Long originalAngle = rotatedAngle != 0 && angleLong == 0 ? 360L : angleLong;
     1318        Long originalAngle = rotatedAngle != 0 && angleLong == 0 ? Long.valueOf(360L) : angleLong;
    13191319
    13201320        synchronized (ROTATE_CACHE) {
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java

    r12791 r12808  
    1717public class BugReportQueue {
    1818
    19     private static final BugReportQueue INSTANCE = new BugReportQueue();
    20 
    2119    /**
    2220     * The fallback bug report handler if none is set. Prints the stacktrace on standard error stream.
     
    2725        return BugReportQueue.SuppressionMode.NONE;
    2826    };
     27
     28    private static final BugReportQueue INSTANCE = new BugReportQueue();
    2929
    3030    private final LinkedList<ReportedException> reportsToDisplay = new LinkedList<>();
Note: See TracChangeset for help on using the changeset viewer.