Changeset 10938 in josm for trunk


Ignore:
Timestamp:
2016-09-03T12:37:39+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1450 - Private fields only used as local variables in methods should become local variables

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CloseChangesetAction.java

    r10763 r10938  
    8383        private List<Changeset> changesets;
    8484        private Exception lastException;
    85         private UserInfo userInfo;
    8685
    8786        private DownloadOpenChangesetsTask() {
     
    121120        protected void realRun() throws SAXException, IOException, OsmTransferException {
    122121            try {
    123                 userInfo = fetchUserInfo();
     122                UserInfo userInfo = fetchUserInfo();
    124123                if (canceled)
    125124                    return;
  • trunk/src/org/openstreetmap/josm/data/AutosaveTask.java

    r10621 r10938  
    9494    private final Set<DataSet> changedDatasets = new HashSet<>();
    9595    private final List<AutosaveLayerInfo> layersInfo = new ArrayList<>();
    96     private Timer timer;
    9796    private final Object layersLock = new Object();
    9897    private final Deque<File> deletedLayers = new LinkedList<>();
     
    132131            }
    133132
    134             timer = new Timer(true);
    135             timer.schedule(this, 1000L, PROP_INTERVAL.get() * 1000L);
     133            new Timer(true).schedule(this, 1000L, PROP_INTERVAL.get() * 1000L);
    136134            Main.getLayerManager().addLayerChangeListener(this, true);
    137135        }
  • trunk/src/org/openstreetmap/josm/data/cache/BufferedImageCacheEntry.java

    r10723 r10938  
    1818    // transient to avoid serialization, volatile to avoid synchronization of whole getImage() method
    1919    private transient volatile BufferedImage img;
    20     private transient volatile boolean writtenToDisk;
    2120    // we need to have separate control variable, to know, if we already tried to load the image, as img might be null
    2221    // after we loaded image, as for example, when image file is malformed (eg. HTML file)
     
    7978            }
    8079            out.writeObject(this);
    81             // ugly hack to wait till element will get to disk to clean the memory
    82             writtenToDisk = true;
    8380
    8481            if (img != null) {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r10378 r10938  
    159159     * Constants used in the transformation.
    160160     */
    161     private double b, a, e;
    162 
    163     /**
    164      * Convenience value equal to {@link #a} / {@link #b}.
     161    private double b, e;
     162
     163    /**
     164     * Convenience value equal to {@code a} / {@link #b}.
    165165     */
    166166    private double arb;
    167167
    168168    /**
    169      * Convenience value equal to {@link #a}&times;{@link #b}.
     169     * Convenience value equal to {@code a}&times;{@link #b}.
    170170     */
    171171    private double ab;
    172172
    173173    /**
    174      * Convenience value equal to {@link #b} / {@link #a}.
     174     * Convenience value equal to {@link #b} / {@code a}.
    175175     */
    176176    private double bra;
     
    237237        double temp = cosph0 * cosph0;
    238238        b = Math.sqrt(1.0 + e2 * (temp * temp) / (1.0 - e2));
    239         a = b * com / con;
     239        double a = b * com / con;
    240240        final double d = b * com / (cosph0 * Math.sqrt(con));
    241241        double f = d * d - 1.0;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r10763 r10938  
    8686    private ShowChangesetInfoAction showChangesetInfoAction;
    8787    private CloseOpenChangesetsAction closeChangesetAction;
    88     private LaunchChangesetManagerAction launchChangesetManagerAction;
    8988
    9089    private ChangesetDialogPopup popupMenu;
     
    206205        cbInSelectionOnly.addItemListener(showChangesetInfoAction);
    207206
    208         // -- launch changeset manager action
    209         launchChangesetManagerAction = new LaunchChangesetManagerAction();
    210 
    211207        popupMenu = new ChangesetDialogPopup(lstInActiveDataLayer, lstInSelection);
    212208
     
    220216            new SideButton(closeChangesetAction, false),
    221217            new SideButton(showChangesetInfoAction, false),
    222             new SideButton(launchChangesetManagerAction, false)
     218            new SideButton(new LaunchChangesetManagerAction(), false)
    223219        }));
    224220    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r10680 r10938  
    5959    private UserTableModel model;
    6060    private SelectUsersPrimitivesAction selectionUsersPrimitivesAction;
    61     private ShowUserInfoAction showUserInfoAction;
    6261
    6362    /**
     
    9594        // -- info action
    9695        //
    97         showUserInfoAction = new ShowUserInfoAction();
     96        ShowUserInfoAction showUserInfoAction = new ShowUserInfoAction();
    9897        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
    9998
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r10717 r10938  
    400400    private static class HeaderPanel extends JPanel {
    401401
    402         private JMultilineLabel lblMessage;
    403402        private transient Changeset current;
     403
     404        HeaderPanel() {
     405            build();
     406        }
    404407
    405408        protected final void build() {
    406409            setLayout(new FlowLayout(FlowLayout.LEFT));
    407             lblMessage = new JMultilineLabel(
    408                     tr("The content of this changeset is not downloaded yet.")
    409             );
    410             add(lblMessage);
     410            add(new JMultilineLabel(tr("The content of this changeset is not downloaded yet.")));
    411411            add(new JButton(new DownloadAction()));
    412412
    413         }
    414 
    415         HeaderPanel() {
    416             build();
    417413        }
    418414
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r10647 r10938  
    342342     */
    343343    private class SetOffsetActionListener implements ActionListener {
    344         private JPanel panel;
    345         private JLabel lbExifTime;
    346         private JosmTextField tfGpsTime;
    347         private JosmComboBox<String> cbTimezones;
    348         private ImageDisplay imgDisp;
    349         private JList<String> imgList;
    350344
    351345        @Override
     
    353347            SimpleDateFormat dateFormat = (SimpleDateFormat) DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
    354348
    355             panel = new JPanel(new BorderLayout());
     349            JPanel panel = new JPanel(new BorderLayout());
    356350            panel.add(new JLabel(tr("<html>Take a photo of your GPS receiver while it displays the time.<br>"
    357351                    + "Display that photo here.<br>"
     
    359353                    BorderLayout.NORTH);
    360354
    361             imgDisp = new ImageDisplay();
     355            ImageDisplay imgDisp = new ImageDisplay();
    362356            imgDisp.setPreferredSize(new Dimension(300, 225));
    363357            panel.add(imgDisp, BorderLayout.CENTER);
     
    373367            panelTf.add(new JLabel(tr("Photo time (from exif):")), gc);
    374368
    375             lbExifTime = new JLabel();
     369            JLabel lbExifTime = new JLabel();
    376370            gc.gridx = 1;
    377371            gc.weightx = 1.0;
     
    388382            panelTf.add(new JLabel(tr("Gps time (read from the above photo): ")), gc);
    389383
    390             tfGpsTime = new JosmTextField(12);
     384            JosmTextField tfGpsTime = new JosmTextField(12);
    391385            tfGpsTime.setEnabled(false);
    392386            tfGpsTime.setMinimumSize(new Dimension(155, tfGpsTime.getMinimumSize().height));
     
    422416            Collections.sort(vtTimezones);
    423417
    424             cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[0]));
     418            JosmComboBox<String> cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[0]));
    425419
    426420            String tzId = Main.pref.get("geoimage.timezoneid", "");
     
    446440            JPanel panelLst = new JPanel(new BorderLayout());
    447441
    448             imgList = new JList<>(new AbstractListModel<String>() {
     442            JList<String> imgList = new JList<>(new AbstractListModel<String>() {
    449443                @Override
    450444                public String getElementAt(int i) {
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r10611 r10938  
    399399    class FullyAutomaticAuthorisationTask extends PleaseWaitRunnable {
    400400        private boolean canceled;
    401         private OsmOAuthAuthorizationClient authClient;
    402401
    403402        FullyAutomaticAuthorisationTask(Component parent) {
     
    480479            try {
    481480                getProgressMonitor().setTicksCount(3);
    482                 authClient = new OsmOAuthAuthorizationClient(
     481                OsmOAuthAuthorizationClient authClient = new OsmOAuthAuthorizationClient(
    483482                        getAdvancedPropertiesPanel().getAdvancedParameters()
    484483                );
Note: See TracChangeset for help on using the changeset viewer.