Skip to content

Commit bba5e17

Browse files
authored
Refactor usage of deprecated method (openhab#18321)
Signed-off-by: Jacob Laursen <[email protected]>
1 parent 152613f commit bba5e17

File tree

1 file changed

+3
-4
lines changed
  • bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler

1 file changed

+3
-4
lines changed

bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import static org.openhab.binding.sonos.internal.SonosBindingConstants.*;
1616

1717
import java.io.IOException;
18-
import java.net.MalformedURLException;
18+
import java.net.URISyntaxException;
1919
import java.net.URL;
2020
import java.text.ParseException;
2121
import java.text.SimpleDateFormat;
@@ -741,10 +741,9 @@ private void dispatchOnAllGroupMembers(String variable, String value, String ser
741741
try {
742742
URL serviceDescrUrl = service.getDescriptorURL(this);
743743
if (serviceDescrUrl != null) {
744-
url = new URL(serviceDescrUrl.getProtocol(), serviceDescrUrl.getHost(),
745-
serviceDescrUrl.getPort(), albumArtURI).toExternalForm();
744+
url = serviceDescrUrl.toURI().resolve(albumArtURI).toString();
746745
}
747-
} catch (MalformedURLException e) {
746+
} catch (URISyntaxException e) {
748747
logger.debug("Failed to build a valid album art URL from {}: {}", albumArtURI, e.getMessage());
749748
}
750749
}

0 commit comments

Comments
 (0)