Changeset 11520 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2017-01-31T23:38:13+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:ITU_INAPPROPRIATE_TOSTRING_USE - Correctness - Method performs algorithmic operations on the result of a toString() call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r11044 r11520  
    610610            if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
    611611                return;
    612             if (e.getURL() == null || e.getURL().toString().startsWith(url+'#')) {
     612            if (e.getURL() == null || e.getURL().toExternalForm().startsWith(url+'#')) {
    613613                // Probably hyperlink event on a an A-element with a href consisting of a fragment only, i.e. "#ALocalFragment".
    614614                String fragment = getUrlFragment(e);
     
    633633                    );
    634634                }
    635             } else if (e.getURL().toString().endsWith("action=edit")) {
    636                 OpenBrowser.displayUrl(e.getURL().toString());
     635            } else if (e.getURL().toExternalForm().endsWith("action=edit")) {
     636                OpenBrowser.displayUrl(e.getURL().toExternalForm());
    637637            } else {
    638                 url = e.getURL().toString();
    639                 openUrl(e.getURL().toString());
     638                url = e.getURL().toExternalForm();
     639                openUrl(url);
    640640            }
    641641        }
Note: See TracChangeset for help on using the changeset viewer.