Skip to content

Commit

Permalink
Misc fixes to the NativeBrowserLauncher.
Browse files Browse the repository at this point in the history
Silence some warnings in the NativeBrowserLauncher by:

* avoiding using a "raw type" `Class`;
* avoiding the single-argument form of `java.lang.Runtime.exec`
  (deprecated in Java18).
  • Loading branch information
gouttegd committed Feb 24, 2025
1 parent 61fe161 commit f6d053a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public class NativeBrowserLauncher {
public static void openURL(String url) {
try {
if (OSUtils.isOSX()) {
Class fileMgr = Class.forName("com.apple.eio.FileManager");
Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
Method openURL = fileMgr.getDeclaredMethod("openURL", String.class);
openURL.invoke(null, url);
}
else if (OSUtils.isWindows()){
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
Runtime.getRuntime().exec(new String[] {"rundll32", "url.dll,FileProtocolHandler", url});
}
else { //assume Unix or Linux
String[] browsers = {
Expand Down

0 comments on commit f6d053a

Please sign in to comment.