It's a slight duplication, however the default port has changed between the two blocks of code. You can see that the constant has changed. I could make another protected method getJMXUrl(int default, String serviceScheme)  because one version's url is service:jmx:http-remoting-jmx while the other's is service:jmx:remoting-jmx.  

In the end I specifically decided against this, because there's no guarantee that the method fulfills all the requirements for possible future changes. Theoretically, the method below would be optimal, but there's no guarantee that it fills all future requirements either. 

// In wildfly class
public String getJMXUrl() {
    return getJMXUrl("http-jmx-remoting", IJBossToolingConstants.WILDFLY8_MANAGEMENT_PORT_DEFAULT_PORT);
}
// In as7 class
public String getJMXUrl() {
    return getJMXUrl("jmx-remoting", IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT;);
}

public String getJMXUrl(String urlSegment, int defaultPort) { 
    if (sd instanceof IManagementPortProvider) {
        port = ((IManagementPortProvider)sd).getManagementPort();
    } else {
        port = defaultPort;
    }
    String url = "service:jmx:" + urlSegment + "://" + server.getHost() + ":" + port;  //$NON-NLS-1$ //$NON-NLS-2$
    return url;
  } 

But I honestly do not want to do that in the maintenance release. I am 100% happy with the current code in the maintenance release and do not wish to add the delegated method. In the master, I may make such changes in the future, but for maintenance I do not wish to at this time.