Ignore:
Timestamp:
2017-05-30T15:12:36+02:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S3878 - Arrays should not be created for varargs parameters

File:
1 edited

Legend:

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

    r12176 r12279  
    659659    @Override public Action[] getMenuEntries() {
    660660        List<Action> actions = new ArrayList<>();
    661         actions.addAll(Arrays.asList(new Action[]{
     661        actions.addAll(Arrays.asList(
    662662                LayerListDialog.getInstance().createActivateLayerAction(this),
    663663                LayerListDialog.getInstance().createShowHideLayerAction(),
     
    667667                LayerListDialog.getInstance().createDuplicateLayerAction(this),
    668668                new LayerSaveAction(this),
    669                 new LayerSaveAsAction(this),
    670         }));
     669                new LayerSaveAsAction(this)));
    671670        if (ExpertToggleAction.isExpert()) {
    672             actions.addAll(Arrays.asList(new Action[]{
     671            actions.addAll(Arrays.asList(
    673672                    new LayerGpxExportAction(this),
    674                     new ConvertToGpxLayerAction()}));
    675         }
    676         actions.addAll(Arrays.asList(new Action[]{
     673                    new ConvertToGpxLayerAction()));
     674        }
     675        actions.addAll(Arrays.asList(
    677676                SeparatorLayerAction.INSTANCE,
    678                 new RenameLayerAction(getAssociatedFile(), this)}));
     677                new RenameLayerAction(getAssociatedFile(), this)));
    679678        if (ExpertToggleAction.isExpert()) {
    680679            actions.add(new ToggleUploadDiscouragedLayerAction(this));
    681680        }
    682         actions.addAll(Arrays.asList(new Action[]{
     681        actions.addAll(Arrays.asList(
    683682                new ConsistencyTestAction(),
    684683                SeparatorLayerAction.INSTANCE,
    685                 new LayerListPopup.InfoAction(this)}));
     684                new LayerListPopup.InfoAction(this)));
    686685        return actions.toArray(new Action[actions.size()]);
    687686    }
     
    10541053                return 2;
    10551054            }
    1056             ExtendedDialog dialog = new ExtendedDialog(
     1055            return new ExtendedDialog(
    10571056                    Main.parent,
    10581057                    tr("Empty document"),
    1059                     new String[] {tr("Save anyway"), tr("Cancel")}
    1060             );
    1061             dialog.setContent(tr("The document contains no data."));
    1062             dialog.setButtonIcons(new String[] {"save", "cancel"});
    1063             return dialog.showDialog().getValue();
     1058                    tr("Save anyway"), tr("Cancel"))
     1059                .setContent(tr("The document contains no data."))
     1060                .setButtonIcons("save", "cancel")
     1061                .showDialog().getValue();
    10641062        })) {
    10651063            return false;
     
    10681066        ConflictCollection conflictsCol = getConflicts();
    10691067        return conflictsCol == null || conflictsCol.isEmpty() || 1 == GuiHelper.runInEDTAndWaitAndReturn(() -> {
    1070             ExtendedDialog dialog = new ExtendedDialog(
     1068            return new ExtendedDialog(
    10711069                    Main.parent,
    10721070                    /* I18N: Display title of the window showing conflicts */
    10731071                    tr("Conflicts"),
    1074                     new String[] {tr("Reject Conflicts and Save"), tr("Cancel")}
    1075             );
    1076             dialog.setContent(
    1077                     tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"));
    1078             dialog.setButtonIcons(new String[] {"save", "cancel"});
    1079             return dialog.showDialog().getValue();
     1072                    tr("Reject Conflicts and Save"), tr("Cancel"))
     1073                .setContent(
     1074                    tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"))
     1075                .setButtonIcons("save", "cancel")
     1076                .showDialog().getValue();
    10801077        });
    10811078    }
Note: See TracChangeset for help on using the changeset viewer.