Changeset 10306 in josm


Ignore:
Timestamp:
2016-05-31T00:14:15+02:00 (4 years ago)
Author:
Don-vip
Message:

sonar - pmd:ImmutableField + remove unused code

Location:
trunk
Files:
12 edited

Legend:

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

    r10216 r10306  
    4545    private OsmServerReader reader;
    4646    /** the target layer */
    47     private OsmDataLayer targetLayer;
     47    private final OsmDataLayer targetLayer;
    4848    /** the collection of child primitives */
    49     private Map<Long, OsmPrimitiveType> children;
     49    private final Map<Long, OsmPrimitiveType> children;
    5050    /** the parents */
    51     private DataSet parents;
     51    private final DataSet parents;
    5252
    5353    /**
  • trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java

    r10235 r10306  
    4242    private XMLStreamReader parser;
    4343    private int version;
    44     private Reader reader;
    45     private File file;
     44    private final Reader reader;
     45    private final File file;
    4646
    4747    private final boolean defaults;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r9774 r10306  
    124124    private final transient HighlightHelper highlightHelper = new HighlightHelper();
    125125    private final boolean highlightEnabled = Main.pref.getBoolean("draw.target-highlight", true);
    126     private transient RecentRelationsAction recentRelationsAction;
     126    private final transient RecentRelationsAction recentRelationsAction;
    127127
    128128    /**
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java

    r10300 r10306  
    4545    private final JPopupMenu popup;
    4646    private SideButton sideButton;
    47     private JCheckBox visibilityCheckbox;
     47    private final JCheckBox visibilityCheckbox;
    4848    final OpacitySlider opacitySlider = new OpacitySlider();
    4949    private final ArrayList<FilterSlider<?>> sliders = new ArrayList<>();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r10300 r10306  
    656656        private final List<JosmAction> recentTagsActions = new ArrayList<>();
    657657        protected final transient FocusAdapter focus;
    658         private JPanel mainPanel;
     658        private final JPanel mainPanel;
    659659        private JPanel recentTagsPanel;
    660660
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeModel.java

    r8510 r10306  
    2020 * {@link #populate(Relation)} and {@link #populate(List)} respectively.
    2121 *
    22  *
     22 * @since 1828
    2323 */
    2424public class RelationTreeModel implements TreeModel {
     
    2727
    2828    /** the tree model listeners */
    29     private CopyOnWriteArrayList<TreeModelListener> listeners;
     29    private final CopyOnWriteArrayList<TreeModelListener> listeners;
    3030
    3131    /**
     
    3434    public RelationTreeModel() {
    3535        this.root = null;
    36         listeners = new CopyOnWriteArrayList<>();
    37     }
    38 
    39     /**
    40      * constructor
    41      * @param root the root relation
    42      */
    43     public RelationTreeModel(Relation root) {
    44         this.root = root;
    45         listeners = new CopyOnWriteArrayList<>();
    46     }
    47 
    48     /**
    49      * constructor
    50      *
    51      * @param members a list of members
    52      */
    53     public RelationTreeModel(List<RelationMember> members) {
    54         if (members == null) return;
    55         Relation root = new Relation();
    56         root.setMembers(members);
    57         this.root = root;
    5836        listeners = new CopyOnWriteArrayList<>();
    5937    }
  • trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java

    r10300 r10306  
    2727         * Scale factor, same unit as in {@link NavigatableComponent}
    2828         */
    29         private double scale;
     29        private final double scale;
    3030
    3131        /**
    3232         * True if this scale is native resolution for data source.
    3333         */
    34         private boolean isNative;
    35 
    36         private int index;
     34        private final boolean isNative;
     35
     36        private final int index;
    3737
    3838        /**
     
    7878
    7979    /**
    80      * List of scales, may include intermediate steps
    81      * between native resolutions
     80     * List of scales, may include intermediate steps between native resolutions
    8281     */
    8382    class ScaleList  {
    84         private List<Scale> scales = new ArrayList<>();
    85 
    86         protected ScaleList(double[] scales) {
    87             for (int i = 0; i < scales.length; i++) {
    88                 this.scales.add(new Scale(scales[i], i));
    89             }
    90         }
     83        private final List<Scale> scales = new ArrayList<>();
    9184
    9285        protected ScaleList() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r10179 r10306  
    300300    private final JPanel projSubPrefPanelWrapper = new JPanel(new GridBagLayout());
    301301
    302     private JLabel projectionCodeLabel = new JLabel(tr("Projection code"));
    303     private Component projectionCodeGlue = GBC.glue(5, 0);
     302    private final JLabel projectionCodeLabel = new JLabel(tr("Projection code"));
     303    private final Component projectionCodeGlue = GBC.glue(5, 0);
    304304    private final JLabel projectionCode = new JLabel();
    305305    private final JLabel projectionNameLabel = new JLabel(tr("Projection name"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreference.java

    r10196 r10306  
    3737    private static final BooleanProperty FOR_MULTI_FETCH = new BooleanProperty("download.overpass.for-multi-fetch", false);
    3838
    39     private HistoryComboBox overpassServer = new HistoryComboBox();
     39    private final HistoryComboBox overpassServer = new HistoryComboBox();
    4040    private final JCheckBox forMultiFetch = new JCheckBox(tr("Use Overpass server for object downloads"));
    4141
  • trunk/src/org/openstreetmap/josm/tools/bugreport/DebugTextDisplay.java

    r10055 r10306  
    1515 */
    1616public class DebugTextDisplay extends JScrollPane {
    17     private String text;
     17    private final String text;
    1818
    1919    /**
  • trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java

    r10305 r10306  
    251251    private static class Section {
    252252
    253         private String sectionName;
    254         private ArrayList<SectionEntry> entries = new ArrayList<>();
     253        private final String sectionName;
     254        private final ArrayList<SectionEntry> entries = new ArrayList<>();
    255255
    256256        Section(String sectionName) {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java

    r9883 r10306  
    2929    public void testTicket12255() {
    3030        assertNull(new NativeScaleLayer.ScaleList(Collections.<Double>emptyList()).getSnapScale(10, 2, false));
    31         assertNull(new NativeScaleLayer.ScaleList(new double[0]).getSnapScale(10, 2, false));
    3231    }
    3332}
Note: See TracChangeset for help on using the changeset viewer.