diff --git a/src/main/java/runwar/Server.java b/src/main/java/runwar/Server.java index 4466b6c..b6664ff 100644 --- a/src/main/java/runwar/Server.java +++ b/src/main/java/runwar/Server.java @@ -10,7 +10,6 @@ import java.io.PrintStream; import java.io.PrintWriter; import java.lang.management.ManagementFactory; -import java.lang.reflect.Method; import java.net.ConnectException; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -34,6 +33,8 @@ import org.xnio.Option; import org.xnio.OptionMap; +import com.apple.eawt.Application; + import io.undertow.Undertow; import io.undertow.server.DefaultByteBufferPool; import io.undertow.server.HandlerWrapper; @@ -258,11 +259,7 @@ public synchronized void startServer(final ServerOptions options) throws Excepti System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("-Xdock:name", processName); try { - Class appClass = Class.forName("com.apple.eawt.Application"); - Method getAppMethod = appClass.getMethod("getApplication"); - Object appInstance = getAppMethod.invoke(null); - Method dockMethod = appInstance.getClass().getMethod("setDockIconImage", java.awt.Image.class); - dockMethod.invoke(appInstance, dockIcon); + Application.getApplication().setDockIconImage(dockIcon); } catch (Exception e) { LOG.warn(" Error setting dock icon image", e); } diff --git a/src/main/java/runwar/options/ConfigParser.java b/src/main/java/runwar/options/ConfigParser.java index c80e968..0d6b7e9 100644 --- a/src/main/java/runwar/options/ConfigParser.java +++ b/src/main/java/runwar/options/ConfigParser.java @@ -420,7 +420,7 @@ private void parseOptions() { // issues as detailed here: // https://issues.redhat.com/browse/UNDERTOW-584 if (siteConfig.hasOption("sendFileMinSizeKB")) { - site.transferMinSize(Long.valueOf(siteConfig.getOptionValue("transferMinSize")) * 1024); + site.transferMinSize(Long.valueOf(siteConfig.getOptionValue("sendFileMinSizeKB")) * 1024); } if (siteConfig.hasOption("GZipEnable")) {