Ignore:
Timestamp:
2017-12-17T00:42:54+01:00 (2 years ago)
Author:
Don-vip
Message:

enable PMD rule OptimizableToArrayCall

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

Legend:

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

    r13132 r13206  
    8585     */
    8686    protected static Layer askTargetLayer(List<Layer> targetLayers) {
    87         return askTargetLayer(targetLayers.toArray(new Layer[targetLayers.size()]),
     87        return askTargetLayer(targetLayers.toArray(new Layer[0]),
    8888                tr("Please select the target layer."),
    8989                tr("Select target layer"),
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r12636 r13206  
    169169        tree.updateTree(wms);
    170170        List<String> wmsFormats = wms.getFormats();
    171         final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[wmsFormats.size()]));
     171        final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[0]));
    172172        formats.setSelectedItem(wms.getPreferredFormats());
    173173        formats.setToolTipText(tr("Select image format for WMS layer"));
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r12846 r13206  
    249249     */
    250250    Collection<DownloadTask> askWhichTasksToLoad(final Collection<DownloadTask> tasks) {
    251         final JList<DownloadTask> list = new JList<>(tasks.toArray(new DownloadTask[tasks.size()]));
     251        final JList<DownloadTask> list = new JList<>(tasks.toArray(new DownloadTask[0]));
    252252        list.addSelectionInterval(0, tasks.size() - 1);
    253253        final ExtendedDialog dialog = new WhichTasksToPerformDialog(list);
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r13130 r13206  
    149149                return Long.compare(o1.getUniqueId(), o2.getUniqueId());
    150150            });
    151             JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[toPurgeAdditionally.size()]));
     151            JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[0]));
    152152            /* force selection to be active for all entries */
    153153            list.setCellRenderer(new SelectionForcedOsmPrimitivRenderer());
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r12846 r13206  
    106106            public void run() {
    107107                try {
    108                     Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]));
     108                    Runtime.getRuntime().exec(cmd.toArray(new String[0]));
    109109                } catch (IOException e) {
    110110                    Logging.error(e);
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r13173 r13206  
    170170            this.selection = selection;
    171171            this.wayToKeep = wayToKeep;
    172             this.list = new JList<>(newWays.toArray(new Way[newWays.size()]));
     172            this.list = new JList<>(newWays.toArray(new Way[0]));
    173173            configureList();
    174174
Note: See TracChangeset for help on using the changeset viewer.