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

sonar - squid:S1848 - refactor URL checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r10212 r10294  
    1212import java.lang.reflect.Constructor;
    1313import java.lang.reflect.InvocationTargetException;
    14 import java.net.MalformedURLException;
    1514import java.net.URL;
    1615import java.text.MessageFormat;
     
    206205            s = attr.getValue("Plugin-Link");
    207206        }
    208         if (s != null) {
    209             try {
    210                 new URL(s);
    211             } catch (MalformedURLException e) {
    212                 Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
    213                 s = null;
    214             }
     207        if (s != null && !Utils.isValidUrl(s)) {
     208            Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
     209            s = null;
    215210        }
    216211        link = s;
Note: See TracChangeset for help on using the changeset viewer.