Ignore:
Timestamp:
2016-05-29T00:14:28+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1848 - refactor URL checks

File:
1 edited

Legend:

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

    r10289 r10294  
    13241324
    13251325    /**
     1326     * Determines if the given URL is valid.
     1327     * @param url The URL to test
     1328     * @return {@code true} if the url is valid
     1329     * @since 10294
     1330     */
     1331    public static boolean isValidUrl(String url) {
     1332        try {
     1333            new URL(url);
     1334            return true;
     1335        } catch (MalformedURLException | NullPointerException e) {
     1336            return false;
     1337        }
     1338    }
     1339
     1340    /**
    13261341     * Creates a new {@link ThreadFactory} which creates threads with names according to {@code nameFormat}.
    13271342     * @param nameFormat a {@link String#format(String, Object...)} compatible name format; its first argument is a unique thread index
Note: See TracChangeset for help on using the changeset viewer.