public static @CheckForNull String getActionUrl(String itUrl, Action action) {
        String urlName = action.getUrlName();
        if (urlName == null)   return null;    // Should not be displayed
        try {
            if (new URI(urlName).isAbsolute()) {
                return urlName;
            }
        } catch (URISyntaxException x) {
            Logger.getLogger(Functions.class.getName()).log(Level.WARNING, "Failed to parse URL for {0}: {1}", new Object[] {action, x});
            return null;
        }
        if (urlName.startsWith("/"))
            return joinPath(Stapler.getCurrentRequest().getContextPath(), urlName);
        else
            // relative URL name
            return joinPath(Stapler.getCurrentRequest().getContextPath() + '/' + itUrl, urlName);
    }
@Test
    public void testGetActionUrl_unparseable() {
        assertNull(Functions.getActionUrl(null, createMockAction("http://example.net/stuff?something=^woohoo")));
    }