Ignore:
Timestamp:
2023-08-09T15:30:01+02:00 (19 months ago)
Author:
taylor.smock
Message:

Fix #22832: Code cleanup and some simplification, documentation fixes (patch by gaben)

There should not be any functional changes in this patch; it is intended to do
the following:

  • Simplify and cleanup code (example: Arrays.asList(item) -> Collections.singletonList(item))
  • Fix typos in documentation (which also corrects the documentation to match what actually happens, in some cases)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Territories.java

    r18723 r18801  
    200200                    for (JsonValue feature : json.getObject().getJsonArray("features")) {
    201201                        ofNullable(feature.asJsonObject().getJsonObject("properties")).ifPresent(props ->
    202                         ofNullable(props.getJsonObject("urls")).ifPresent(urls ->
    203                         ofNullable(urls.getString(TAGINFO)).ifPresent(taginfo -> {
     202                        ofNullable(props.getJsonObject("urls")).flatMap(urls ->
     203                        ofNullable(urls.getString(TAGINFO))).ifPresent(taginfo -> {
    204204                            JsonArray iso1 = props.getJsonArray(ISO3166_1_LC);
    205205                            JsonArray iso2 = props.getJsonArray(ISO3166_2_LC);
     
    209209                                readExternalTaginfo(taginfoGeofabrikCache, taginfo, iso2, source);
    210210                            }
    211                         })));
     211                        }));
    212212                    }
    213213                }
Note: See TracChangeset for help on using the changeset viewer.