Moved Classloader utility methods into their own class.

This commit is contained in:
nathan 2017-07-15 18:25:10 +02:00
parent f584ca4549
commit fa3afc7c74

View File

@ -22,7 +22,7 @@ import java.awt.AWTException;
import java.util.Locale; import java.util.Locale;
import dorkbox.systemTray.SystemTray; import dorkbox.systemTray.SystemTray;
import dorkbox.util.BootStrapClassLoader; import dorkbox.util.ClassLoaderUtil;
import dorkbox.util.OS; import dorkbox.util.OS;
import javassist.ClassPool; import javassist.ClassPool;
import javassist.CtBehavior; import javassist.CtBehavior;
@ -231,8 +231,8 @@ class SystemTrayFixes {
} }
// whoosh, past the classloader and directly into memory. // whoosh, past the classloader and directly into memory.
BootStrapClassLoader.defineClass(trayBytes); ClassLoaderUtil.Bootstrap.defineClass(trayBytes);
BootStrapClassLoader.defineClass(trayIconBytes); ClassLoaderUtil.Bootstrap.defineClass(trayIconBytes);
if (SystemTray.DEBUG) { if (SystemTray.DEBUG) {
logger.debug("Successfully changed tray icon size to: {}", trayIconSize); logger.debug("Successfully changed tray icon size to: {}", trayIconSize);
@ -412,7 +412,7 @@ class SystemTrayFixes {
mouseEventBytes = trayClass.toBytecode(); mouseEventBytes = trayClass.toBytecode();
// whoosh, past the classloader and directly into memory. // whoosh, past the classloader and directly into memory.
BootStrapClassLoader.defineClass(mouseEventBytes); ClassLoaderUtil.Bootstrap.defineClass(mouseEventBytes);
if (SystemTray.DEBUG) { if (SystemTray.DEBUG) {
logger.debug("Successfully changed mouse trigger for MacOSX"); logger.debug("Successfully changed mouse trigger for MacOSX");
@ -691,11 +691,11 @@ class SystemTrayFixes {
} }
// whoosh, past the classloader and directly into memory. // whoosh, past the classloader and directly into memory.
BootStrapClassLoader.defineClass(runnableBytes); ClassLoaderUtil.Bootstrap.defineClass(runnableBytes);
BootStrapClassLoader.defineClass(eFrameBytes); ClassLoaderUtil.Bootstrap.defineClass(eFrameBytes);
BootStrapClassLoader.defineClass(iconCanvasBytes); ClassLoaderUtil.Bootstrap.defineClass(iconCanvasBytes);
BootStrapClassLoader.defineClass(trayIconBytes); ClassLoaderUtil.Bootstrap.defineClass(trayIconBytes);
BootStrapClassLoader.defineClass(trayPeerBytes); ClassLoaderUtil.Bootstrap.defineClass(trayPeerBytes);
if (SystemTray.DEBUG) { if (SystemTray.DEBUG) {
logger.debug("Successfully changed tray icon background color"); logger.debug("Successfully changed tray icon background color");