SPARK-2204: Code cleanup: Remove some deprecated methods usage

This commit is contained in:
arthur 2020-11-26 23:15:10 +03:00
parent 894478ab45
commit 790cf68b6a
5 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ import org.jivesoftware.sparkimpl.plugin.idle.IdleTime;
public class LinuxIdleTime implements IdleTime {
/** Definition (incomplete) of the Xext library. */
interface Xss extends Library {
Xss INSTANCE = Native.loadLibrary("Xss", Xss.class);
Xss INSTANCE = Native.load("Xss", Xss.class);
class XScreenSaverInfo extends Structure {
public X11.Window window; /* screen saver window */

View File

@ -12,7 +12,7 @@ public class MacIdleTime implements IdleTime {
public interface ApplicationServices extends Library {
ApplicationServices INSTANCE = Native.loadLibrary("ApplicationServices", ApplicationServices.class);
ApplicationServices INSTANCE = Native.load("ApplicationServices", ApplicationServices.class);
int kCGAnyInputEventType = ~0;
int kCGEventSourceStatePrivate = -1;

View File

@ -15,7 +15,7 @@ import java.util.List;
*/
public class Win32IdleTime implements IdleTime {
public interface Kernel32 extends StdCallLibrary {
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class);
Kernel32 INSTANCE = Native.load("kernel32", Kernel32.class);
/**
* Retrieves the number of milliseconds that have elapsed since the system was started.
@ -26,7 +26,7 @@ public class Win32IdleTime implements IdleTime {
}
public interface User32 extends StdCallLibrary {
User32 INSTANCE = Native.loadLibrary("user32", User32.class);
User32 INSTANCE = Native.load("user32", User32.class);
/**
* Contains the time of the last input.
* @see "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputstructures/lastinputinfo.asp"

View File

@ -49,7 +49,7 @@ public class AppleDock implements ActionListener {
frame.add(menu);
// set dock menu
Application app = new Application();
Application app = Application.getApplication();
app.setDockMenu(menu);
}

View File

@ -23,7 +23,7 @@ public class MacNotificationCenter {
File dylib = new File(Spark.getPluginDirectory().getAbsolutePath()
+ File.separator + "roar" + File.separator + "native" + File.separator + "NSUserNotificationsBridge.dylib" );
NSUserNotificationsBridge instance = Native.loadLibrary(dylib.getAbsolutePath(), NSUserNotificationsBridge.class);
NSUserNotificationsBridge instance = Native.load(dylib.getAbsolutePath(), NSUserNotificationsBridge.class);
int sendNotification(String title, String subtitle, String text, int timeoffset, String sound);
}