- Timestamp:
- 2017-12-17T00:42:54+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r13132 r13206 85 85 */ 86 86 protected static Layer askTargetLayer(List<Layer> targetLayers) { 87 return askTargetLayer(targetLayers.toArray(new Layer[ targetLayers.size()]),87 return askTargetLayer(targetLayers.toArray(new Layer[0]), 88 88 tr("Please select the target layer."), 89 89 tr("Select target layer"), -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r12636 r13206 169 169 tree.updateTree(wms); 170 170 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])); 172 172 formats.setSelectedItem(wms.getPreferredFormats()); 173 173 formats.setToolTipText(tr("Select image format for WMS layer")); -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r12846 r13206 249 249 */ 250 250 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])); 252 252 list.addSelectionInterval(0, tasks.size() - 1); 253 253 final ExtendedDialog dialog = new WhichTasksToPerformDialog(list); -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r13130 r13206 149 149 return Long.compare(o1.getUniqueId(), o2.getUniqueId()); 150 150 }); 151 JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[ toPurgeAdditionally.size()]));151 JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[0])); 152 152 /* force selection to be active for all entries */ 153 153 list.setCellRenderer(new SelectionForcedOsmPrimitivRenderer()); -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r12846 r13206 106 106 public void run() { 107 107 try { 108 Runtime.getRuntime().exec(cmd.toArray(new String[ cmd.size()]));108 Runtime.getRuntime().exec(cmd.toArray(new String[0])); 109 109 } catch (IOException e) { 110 110 Logging.error(e); -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r13173 r13206 170 170 this.selection = selection; 171 171 this.wayToKeep = wayToKeep; 172 this.list = new JList<>(newWays.toArray(new Way[ newWays.size()]));172 this.list = new JList<>(newWays.toArray(new Way[0])); 173 173 configureList(); 174 174 -
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r13173 r13206 42 42 super(ds); 43 43 this.name = name; 44 this.sequence = sequenz.toArray(new Command[ sequenz.size()]);44 this.sequence = sequenz.toArray(new Command[0]); 45 45 this.continueOnError = continueOnError; 46 46 } -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r13173 r13206 54 54 55 55 if (members != null) { 56 this.members = members.toArray(new RelationMember[ members.size()]);56 this.members = members.toArray(new RelationMember[0]); 57 57 } else { 58 58 this.members = new RelationMember[0]; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r13173 r13206 63 63 this.nodes = new Node[0]; 64 64 } else { 65 this.nodes = nodes.toArray(new Node[ nodes.size()]);65 this.nodes = nodes.toArray(new Node[0]); 66 66 } 67 67 for (Node node: this.nodes) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r13173 r13206 1610 1610 1611 1611 // We use parallel sort here. This is only available for arrays. 1612 StyleRecord[] sorted = allStyleElems.toArray(new StyleRecord[ allStyleElems.size()]);1612 StyleRecord[] sorted = allStyleElems.toArray(new StyleRecord[0]); 1613 1613 Arrays.parallelSort(sorted, null); 1614 1614 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r12881 r13206 15 15 16 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;18 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;19 17 import org.openstreetmap.josm.data.coor.EastNorth; 20 18 import org.openstreetmap.josm.data.osm.DataSet; … … 29 27 import org.openstreetmap.josm.data.projection.Projection; 30 28 import org.openstreetmap.josm.spi.preferences.Config; 29 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 30 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; 31 31 import org.openstreetmap.josm.tools.Geometry; 32 32 import org.openstreetmap.josm.tools.Geometry.AreaAndPerimeter; … … 580 580 public static Collection<JoinedWay> joinWays(Collection<Way> waysToJoin) { 581 581 final Collection<JoinedWay> result = new ArrayList<>(); 582 final Way[] joinArray = waysToJoin.toArray(new Way[ waysToJoin.size()]);582 final Way[] joinArray = waysToJoin.toArray(new Way[0]); 583 583 int left = waysToJoin.size(); 584 584 while (left > 0) { -
trunk/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java
r11930 r13206 146 146 octetList.remove(0); 147 147 } 148 octets = octetList.toArray(new String[ octetList.size()]);148 octets = octetList.toArray(new String[0]); 149 149 } 150 150 if (octets.length > IPV6_MAX_HEX_GROUPS) { -
trunk/src/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferable.java
r11113 r13206 56 56 flavors.addAll(OsmLayerTransferData.FLAVORS); 57 57 } 58 return flavors.toArray(new DataFlavor[ flavors.size()]);58 return flavors.toArray(new DataFlavor[0]); 59 59 } 60 60 -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r13130 r13206 251 251 build(); 252 252 lblMessage.setText(msg); 253 lstLayers.setListData(infos.toArray(new SaveLayerInfo[ infos.size()]));253 lstLayers.setListData(infos.toArray(new SaveLayerInfo[0])); 254 254 } 255 255 -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r13077 r13206 1649 1649 actions.add(SeparatorLayerAction.INSTANCE); 1650 1650 actions.add(new LayerListPopup.InfoAction(this)); 1651 return actions.toArray(new Action[ actions.size()]);1651 return actions.toArray(new Action[0]); 1652 1652 } 1653 1653 -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r13165 r13206 392 392 actions.add(new LayerSaveAction(this)); 393 393 actions.add(new LayerSaveAsAction(this)); 394 return actions.toArray(new Action[ actions.size()]);394 return actions.toArray(new Action[0]); 395 395 } 396 396 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r13161 r13206 681 681 SeparatorLayerAction.INSTANCE, 682 682 new LayerListPopup.InfoAction(this))); 683 return actions.toArray(new Action[ actions.size()]);683 return actions.toArray(new Action[0]); 684 684 } 685 685 -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r12620 r13206 82 82 ret.add(new LayerSaveAsAction(this)); 83 83 ret.add(new BookmarkWmsAction()); 84 return ret.toArray(new Action[ ret.size()]);84 return ret.toArray(new Action[0]); 85 85 } 86 86 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r13204 r13206 421 421 Collections.sort(vtTimezones); 422 422 423 JosmComboBox<String> cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[ vtTimezones.size()]));423 JosmComboBox<String> cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[0])); 424 424 425 425 String tzId = Config.getPref().get("geoimage.timezoneid", ""); … … 573 573 panelCb.add(new JLabel(tr("GPX track: "))); 574 574 575 cbGpx = new JosmComboBox<>(gpxLst.toArray(new GpxDataWrapper[ gpxLst.size()]));575 cbGpx = new JosmComboBox<>(gpxLst.toArray(new GpxDataWrapper[0])); 576 576 if (defaultItem != null) { 577 577 cbGpx.setSelectedItem(defaultItem); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r12671 r13206 349 349 entries.add(new LayerListPopup.InfoAction(this)); 350 350 351 return entries.toArray(new Action[ entries.size()]);351 return entries.toArray(new Action[0]); 352 352 353 353 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
r13130 r13206 124 124 return null; 125 125 } 126 return AbstractMergeAction.askTargetLayer(targetLayers.toArray(new AbstractTileSourceLayer[ targetLayers.size()]),126 return AbstractMergeAction.askTargetLayer(targetLayers.toArray(new AbstractTileSourceLayer[0]), 127 127 tr("Please select the imagery layer."), 128 128 tr("Select imagery layer"), -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r12987 r13206 1033 1033 } 1034 1034 1035 return createColorLut(0, colorList.toArray(new Color[ colorList.size()]));1035 return createColorLut(0, colorList.toArray(new Color[0])); 1036 1036 } 1037 1037 -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r13130 r13206 240 240 components.add(SeparatorLayerAction.INSTANCE); 241 241 components.add(new LayerListPopup.InfoAction(this)); 242 return components.toArray(new Action[ components.size()]);242 return components.toArray(new Action[0]); 243 243 } 244 244 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r12620 r13206 76 76 tree.updateTree(wms); 77 77 List<String> wmsFormats = wms.getFormats(); 78 formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[ wmsFormats.size()])));78 formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[0]))); 79 79 formats.setSelectedItem(wms.getPreferredFormats()); 80 80 } catch (MalformedURLException ex1) { -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r11017 r13206 92 92 filter.getDocument().addDocumentListener(this); 93 93 94 selectionList = new JList<>(data.toArray(new String[ data.size()]));94 selectionList = new JList<>(data.toArray(new String[0])); 95 95 selectionList.setModel(model); 96 96 JScrollPane scroll = new JScrollPane(selectionList); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r13182 r13206 358 358 public ProjectionPreference() { 359 359 this.projectionCombo = new JosmComboBox<>( 360 projectionChoices.toArray(new ProjectionChoice[ projectionChoices.size()]));360 projectionChoices.toArray(new ProjectionChoice[0])); 361 361 this.coordinatesCombo = new JosmComboBox<>( 362 362 CoordinateFormatManager.getCoordinateFormats().toArray(new ICoordinateFormat[0])); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
r13167 r13206 42 42 */ 43 43 public UTMProjectionChoice() { 44 super(tr("UTM"), /* NO-ICON */ "core:utm", cbEntries.toArray(new String[ cbEntries.size()]), tr("UTM Zone"));44 super(tr("UTM"), /* NO-ICON */ "core:utm", cbEntries.toArray(new String[0]), tr("UTM Zone")); 45 45 } 46 46 … … 118 118 } 119 119 } 120 return projections.toArray(new String[ projections.size()]);120 return projections.toArray(new String[0]); 121 121 } 122 122 … … 144 144 145 145 if (args != null) { 146 String[] array = args.toArray(new String[ args.size()]);146 String[] array = args.toArray(new String[0]); 147 147 148 148 if (array.length > 1) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java
r12902 r13206 81 81 allowedStates.add(QuadStateCheckBox.State.UNSET); 82 82 check = new QuadStateCheckBox(locale_text, initialState, 83 allowedStates.toArray(new QuadStateCheckBox.State[ allowedStates.size()]));83 allowedStates.toArray(new QuadStateCheckBox.State[0])); 84 84 check.setPropertyText(key); 85 85 check.setState(check.getState()); // to update the tooltip text -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r12846 r13206 344 344 result.add(item.toString()); 345 345 } 346 return result.toArray(new String[ result.size()]);346 return result.toArray(new String[0]); 347 347 } 348 348 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r12846 r13206 107 107 } else { 108 108 // the objects have different values 109 JosmComboBox<String> comboBox = new JosmComboBox<>(usage.values.toArray(new String[ usage.values.size()]));109 JosmComboBox<String> comboBox = new JosmComboBox<>(usage.values.toArray(new String[0])); 110 110 comboBox.setEditable(true); 111 111 comboBox.setEditor(textField); -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r11017 r13206 56 56 // https://bugs.openjdk.java.net/browse/JDK-4811090 : Extend awt filedialog 57 57 // https://bugs.openjdk.java.net/browse/JDK-6192906 : Add more features to java.awt.FileDialog 58 return fileFilters.toArray(new FileFilter[ fileFilters.size()]);58 return fileFilters.toArray(new FileFilter[0]); 59 59 } 60 60 -
trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
r13003 r13206 61 61 templateEntry = parseVariable(); 62 62 } else if (endTokens.contains(token.getType())) 63 return CompoundTemplateEntry.fromArray(entries.toArray(new TemplateEntry[ entries.size()]));63 return CompoundTemplateEntry.fromArray(entries.toArray(new TemplateEntry[0])); 64 64 else if (token.getType() == TokenType.TEXT) { 65 65 tokenizer.nextToken();
Note:
See TracChangeset
for help on using the changeset viewer.