Remove deprecations for JDK 17

This commit is contained in:
Nico Mexis 2021-09-16 13:55:56 +02:00
parent 2f7cff63c2
commit 35613f01da
No known key found for this signature in database
GPG Key ID: 27D6E17CE092AB78

AI 샘플 코드 생성 중입니다

Loading...
12 changed files with 22 additions and 18 deletions

View File

@ -365,6 +365,7 @@
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>

View File

@ -44,7 +44,7 @@ public class GlobalHotKeys
//CTRL + O
//open resource
if ((e.getKeyCode() == KeyEvent.VK_O) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
if ((e.getKeyCode() == KeyEvent.VK_O) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
@ -62,7 +62,7 @@ public class GlobalHotKeys
//CTRL + N
//new workspace
else if ((e.getKeyCode() == KeyEvent.VK_N) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_N) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
BytecodeViewer.resetWorkspace(true);
@ -70,7 +70,7 @@ public class GlobalHotKeys
//CTRL + T
//compile
else if ((e.getKeyCode() == KeyEvent.VK_T) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_T) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
Thread t = new Thread(() -> BytecodeViewer.compile(true, false), "Compile");
@ -79,7 +79,7 @@ public class GlobalHotKeys
//CTRL + R
//Run remote code
else if ((e.getKeyCode() == KeyEvent.VK_R) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_R) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
@ -91,7 +91,7 @@ public class GlobalHotKeys
//CTRL + S
//Export resources
else if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
@ -137,7 +137,7 @@ public class GlobalHotKeys
//CTRL + W
//close active resource (currently opened tab)
else if ((e.getKeyCode() == KeyEvent.VK_W) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_W) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
@ -147,7 +147,7 @@ public class GlobalHotKeys
//CTRL + L
//open last opened resource
else if ((e.getKeyCode() == KeyEvent.VK_L) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
else if ((e.getKeyCode() == KeyEvent.VK_L) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis();

View File

@ -215,7 +215,7 @@ public class ExtendedJOptionPane
else
dialog.setLocationRelativeTo(BytecodeViewer.viewer);
dialog.show();
dialog.setVisible(true);
dialog.dispose();
return dialog;

View File

@ -82,7 +82,7 @@ public class SearchableJTextArea extends JTextArea
addKeyListener(new PressKeyListener(keyEvent ->
{
if ((keyEvent.getKeyCode() == KeyEvent.VK_F) && ((keyEvent.getModifiers() & KeyEvent.CTRL_MASK) != 0))
if ((keyEvent.getKeyCode() == KeyEvent.VK_F) && ((keyEvent.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
searchInput.requestFocus();
GlobalHotKeys.keyPressed(keyEvent);

View File

@ -108,10 +108,10 @@ public class SearchableRSyntaxTextArea extends RSyntaxTextArea
addKeyListener(new PressKeyListener(keyEvent ->
{
if ((keyEvent.getKeyCode() == KeyEvent.VK_F) && ((keyEvent.getModifiers() & KeyEvent.CTRL_MASK) != 0))
if ((keyEvent.getKeyCode() == KeyEvent.VK_F) && ((keyEvent.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
searchInput.requestFocus();
if (onCtrlS != null && (keyEvent.getKeyCode() == KeyEvent.VK_S) && ((keyEvent.getModifiers() & KeyEvent.CTRL_MASK) != 0))
if (onCtrlS != null && (keyEvent.getKeyCode() == KeyEvent.VK_S) && ((keyEvent.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0))
{
onCtrlS.run();
return;

View File

@ -101,7 +101,7 @@ public class TabbedPane extends JPanel
exitButton.setComponentPopupMenu(rightClickMenu);
exitButton.addMouseListener(new MouseClickedListener(e ->
{
if (e.getModifiers() != InputEvent.ALT_MASK || System.currentTimeMillis() - lastMouseClick < 100)
if (e.getModifiersEx() != InputEvent.ALT_DOWN_MASK || System.currentTimeMillis() - lastMouseClick < 100)
return;
lastMouseClick = System.currentTimeMillis();

View File

@ -299,7 +299,7 @@ public class EZInjection extends Plugin
if(kit != null)
kit.setVisible(true);
m2.invoke(classNode.getClass().newInstance(), (Object[]) new String[1]);
m2.invoke(classNode.getClass().getDeclaredConstructor().newInstance(), (Object[]) new String[1]);
print("Finished running " + invokeMethodInformation);
}

View File

@ -61,7 +61,7 @@ public class CompiledJavaPluginLaunchStrategy implements PluginLaunchStrategy {
}
LoadingClassLoader cl = new LoadingClassLoader(pdata, set);
Plugin p = cl.pluginKlass.newInstance();
Plugin p = cl.pluginKlass.getDeclaredConstructor().newInstance();
LoadedPluginData npdata = new LoadedPluginData(pdata, cl, p);
loaded.add(npdata);
@ -197,4 +197,4 @@ public class CompiledJavaPluginLaunchStrategy implements PluginLaunchStrategy {
return pluginKlass;
}
}
}
}

View File

@ -51,6 +51,6 @@ public class JavaPluginLaunchStrategy implements PluginLaunchStrategy
);
//create a new instance of the class
return (Plugin) clazz.newInstance();
return (Plugin) clazz.getDeclaredConstructor().newInstance();
}
}
}

View File

@ -84,6 +84,7 @@ public enum TranslatedStrings
PLEASE_SEND_THIS_ERROR_LOG_TO,
PLEASE_SEND_RESOURCES,
ONE_PLUGIN_AT_A_TIME,
ILLEGAL_ACCESS_ERROR,
YES,

View File

@ -263,6 +263,7 @@
"PLEASE_SEND_THIS_ERROR_LOG_TO": "Please send this error log to",
"PLEASE_SEND_RESOURCES": "If you hold appropriate legal rights to the relevant class/jar/apk file please include that as well.",
"ONE_PLUGIN_AT_A_TIME": "There is currently another plugin running right now, please wait for that to finish executing.",
"ILLEGAL_ACCESS_ERROR": "Please use Java 15 or older to do this.",
"FILES": "Files",

View File

@ -255,5 +255,6 @@
"CLOSE_TAB": "Tab schließen",
"PLEASE_SEND_THIS_ERROR_LOG_TO": "Bitte senden Sie dieses Fehlerprotokoll an",
"PLEASE_SEND_RESOURCES": "Wenn Sie entsprechende gesetzliche Rechte an der jeweiligen Klasse besitzen",
"MIN_SDK_VERSION": "Minimale SDK-Version"
"MIN_SDK_VERSION": "Minimale SDK-Version",
"ILLEGAL_ACCESS_ERROR": "Bitte benutzen Sie Java 15 oder älter, um dies zu tun."
}