Changeset 11534 in josm


Ignore:
Timestamp:
2017-02-04T14:47:39+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:FCBL_FIELD_COULD_BE_LOCAL - Correctness - Class defines fields that are used only as locals

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

Legend:

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

    r11502 r11534  
    167167    private static final class AnglePopupMenu extends JPopupMenu {
    168168
    169         private final JCheckBoxMenuItem repeatedCb;
    170         private final JCheckBoxMenuItem helperCb;
    171         private final JCheckBoxMenuItem projectionCb;
    172 
    173169        private AnglePopupMenu(final DrawSnapHelper snapHelper) {
    174             repeatedCb = new JCheckBoxMenuItem(new RepeatedAction(snapHelper));
    175             helperCb = new JCheckBoxMenuItem(new HelperAction(snapHelper));
    176             projectionCb = new JCheckBoxMenuItem(new ProjectionAction(snapHelper));
     170            JCheckBoxMenuItem repeatedCb = new JCheckBoxMenuItem(new RepeatedAction(snapHelper));
     171            JCheckBoxMenuItem helperCb = new JCheckBoxMenuItem(new HelperAction(snapHelper));
     172            JCheckBoxMenuItem projectionCb = new JCheckBoxMenuItem(new ProjectionAction(snapHelper));
    177173
    178174            helperCb.setState(DrawAction.DRAW_CONSTRUCTION_GEOMETRY.get());
  • trunk/src/org/openstreetmap/josm/gui/MapScaler.java

    r10853 r11534  
    110110
    111111        private final double dist100Pixel;
    112         private final double lineDistance;
    113112        /**
    114113         * Distance in meters between two ticks.
     
    125124        TickMarks(double dist100Pixel, int width) {
    126125            this.dist100Pixel = dist100Pixel;
    127             lineDistance = dist100Pixel * width / 100;
     126            double lineDistance = dist100Pixel * width / 100;
    128127
    129128            double log10 = Math.log(lineDistance) / Math.log(10);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r10616 r11534  
    327327     */
    328328    class DownloadAllChildrenTask extends DownloadTask {
    329         private final Relation relation;
    330329        private final Stack<Relation> relationsToDownload;
    331330        private final Set<Long> downloadedRelationIds;
     
    333332        DownloadAllChildrenTask(Dialog parent, Relation r) {
    334333            super(tr("Download relation members"), parent);
    335             this.relation = r;
    336334            relationsToDownload = new Stack<>();
    337335            downloadedRelationIds = new HashSet<>();
    338             relationsToDownload.push(this.relation);
     336            relationsToDownload.push(r);
    339337        }
    340338
  • trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java

    r10611 r11534  
    4040    private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this);
    4141
    42     private final transient ActionListener al = e -> cellEditorSupport.fireEditingStopped();
    43 
    4442    /**
    4543     * Constructs a new {@code ActionFlagsTableCell}.
     
    5048        setLayout(new GridBagLayout());
    5149
     50        ActionListener al = e -> cellEditorSupport.fireEditingStopped();
    5251        ActionMap am = getActionMap();
    5352        for (final JCheckBox b : checkBoxes) {
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r11457 r11534  
    527527        private final ExecutorService worker;
    528528        private boolean canceled;
    529         private Future<?> currentFuture;
    530529        private AbstractIOTask currentTask;
    531530
     
    565564                    continue;
    566565                }
    567                 currentFuture = worker.submit(currentTask);
     566                Future<?> currentFuture = worker.submit(currentTask);
    568567                try {
    569568                    // wait for the asynchronous task to complete
    570                     //
    571569                    currentFuture.get();
    572570                } catch (CancellationException e) {
     
    606604                }
    607605                currentTask = new SaveLayerTask(layerInfo, monitor);
    608                 currentFuture = worker.submit(currentTask);
     606                Future<?> currentFuture = worker.submit(currentTask);
    609607
    610608                try {
     
    632630                }
    633631                this.currentTask = null;
    634                 this.currentFuture = null;
    635632            }
    636633        }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java

    r11035 r11534  
    6464        setEnabled(enabled);
    6565
     66        ChangeListener changeListener = e -> {
     67            if (isEnabled()) applyFilterWithDelay();
     68        };
     69
    6670        dateFrom.addDateListener(changeListener);
    6771        dateTo.addDateListener(changeListener);
    6872        noTimestampCb.addChangeListener(changeListener);
    6973    }
    70 
    71     private final transient ChangeListener changeListener = e -> {
    72         if (isEnabled()) applyFilterWithDelay();
    73     };
    7474
    7575    private final Timer t = new Timer(200, e -> applyFilter());
Note: See TracChangeset for help on using the changeset viewer.