Changeset 18208 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2021-09-11T17:50:57+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r17594 r18208 47 47 import org.openstreetmap.josm.tools.ImageProvider; 48 48 import org.openstreetmap.josm.tools.Logging; 49 import org.openstreetmap.josm.tools.Utils; 49 50 import org.openstreetmap.josm.tools.bugreport.ReportedException; 50 51 … … 115 116 case WMS_ENDPOINT: 116 117 // convert to WMS type 117 if ( info.getDefaultLayers() == null || info.getDefaultLayers().isEmpty()) {118 if (Utils.isEmpty(info.getDefaultLayers())) { 118 119 return getWMSLayerInfo(info); 119 120 } else { … … 122 123 case WMTS: 123 124 // specify which layer to use 124 if ( info.getDefaultLayers() == null || info.getDefaultLayers().isEmpty()) {125 if (Utils.isEmpty(info.getDefaultLayers())) { 125 126 WMTSTileSource tileSource = new WMTSTileSource(info); 126 127 DefaultLayer layerId = tileSource.userSelectLayer(); … … 169 170 } 170 171 } catch (IllegalArgumentException | ReportedException ex) { 171 if ( ex.getMessage() == null || ex.getMessage().isEmpty() || GraphicsEnvironment.isHeadless()) {172 if (Utils.isEmpty(ex.getMessage()) || GraphicsEnvironment.isHeadless()) { 172 173 throw ex; 173 174 } else { -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r17200 r18208 50 50 import org.openstreetmap.josm.tools.Shortcut; 51 51 import org.openstreetmap.josm.tools.UserCancelException; 52 import org.openstreetmap.josm.tools.Utils; 52 53 53 54 /** … … 113 114 // prepare and clean the list of ways to combine 114 115 // 115 if ( ways == null || ways.isEmpty())116 if (Utils.isEmpty(ways)) 116 117 return null; 117 118 ways.remove(null); // just in case - remove all null ways from the collection -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r17585 r18208 387 387 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 388 388 DataSet ds = getLayerManager().getEditDataSet(); 389 if (ds == null || selection.isEmpty()) {389 if (ds == null || Utils.isEmpty(selection)) { 390 390 setEnabled(false); 391 391 } else if (update) { -
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r14397 r18208 15 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 16 import org.openstreetmap.josm.tools.Shortcut; 17 import org.openstreetmap.josm.tools.Utils; 17 18 18 19 /** … … 44 45 */ 45 46 public static void downloadReferrers(OsmDataLayer targetLayer, Collection<OsmPrimitive> children) { 46 if ( children == null || children.isEmpty())47 if (Utils.isEmpty(children)) 47 48 return; 48 49 MainApplication.worker.submit(new DownloadReferrersTask(targetLayer, children)); -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r18014 r18208 261 261 @Override 262 262 protected void realRun() throws SAXException, IOException, OsmTransferException { 263 if ( files == null || files.isEmpty()) return;263 if (Utils.isEmpty(files)) return; 264 264 265 265 /** -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r14397 r18208 28 28 import org.openstreetmap.josm.io.OsmTransferException; 29 29 import org.openstreetmap.josm.tools.Shortcut; 30 import org.openstreetmap.josm.tools.Utils; 30 31 31 32 /** … … 120 121 @Override 121 122 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 122 if ( selection == null || selection.isEmpty()) {123 if (Utils.isEmpty(selection)) { 123 124 setEnabled(false); 124 125 } else { -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r15513 r18208 34 34 import org.openstreetmap.josm.tools.ExceptionUtil; 35 35 import org.openstreetmap.josm.tools.Shortcut; 36 import org.openstreetmap.josm.tools.Utils; 36 37 import org.xml.sax.SAXException; 37 38 … … 138 139 */ 139 140 public void uploadPrimitives(OsmDataLayer layer, Collection<OsmPrimitive> toUpload) { 140 if ( toUpload == null || toUpload.isEmpty()) return;141 if (Utils.isEmpty(toUpload)) return; 141 142 UploadHullBuilder builder = new UploadHullBuilder(); 142 143 toUpload = builder.build(toUpload); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r18017 r18208 188 188 protected final void extractOsmFilename(DownloadParams settings, String pattern, String url) { 189 189 newLayerName = settings.getLayerName(); 190 if ( newLayerName == null || newLayerName.isEmpty()) {190 if (Utils.isEmpty(newLayerName)) { 191 191 Matcher matcher = Pattern.compile(pattern).matcher(url); 192 192 newLayerName = matcher.matches() && matcher.groupCount() > 0 ? Utils.decodeUrl(matcher.group(1)) : null; -
trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java
r17458 r18208 36 36 */ 37 37 protected static final Collection<IRelation<?>> getRelations(Collection<? extends IPrimitive> primitives) { 38 if ( primitives == null || primitives.isEmpty()) {38 if (Utils.isEmpty(primitives)) { 39 39 return Collections.<IRelation<?>>emptySet(); 40 40 } else { -
trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
r16438 r18208 29 29 import org.openstreetmap.josm.tools.ImageProvider; 30 30 import org.openstreetmap.josm.tools.Shortcut; 31 import org.openstreetmap.josm.tools.Utils; 31 32 32 33 /** … … 73 74 public static Relation getLastRelation() { 74 75 List<Relation> recentRelations = getRecentRelationsOnActiveLayer(); 75 if ( recentRelations == null || recentRelations.isEmpty())76 if (Utils.isEmpty(recentRelations)) 76 77 return null; 77 78 return recentRelations.stream().filter(RecentRelationsAction::isRelationListable)
Note:
See TracChangeset
for help on using the changeset viewer.