``` java
    if (sd instanceof IManagementPortProvider) {
        port = ((IManagementPortProvider)sd).getManagementPort();
    } else {
        port = IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT;
    }
```
do the same and looks better, doesn't it?