diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java index ffe1a87bd6..4398dee5c5 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java @@ -715,7 +715,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/QuestMasterHandler.java index ec7f54da66..33fc74605a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -897,7 +897,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/java.cfg b/L2J_Mobius_1.0_Ertheia/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/java.cfg +++ b/L2J_Mobius_1.0_Ertheia/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ui/Gui.java index c174cdaff4..eeafe3490a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ui/Gui.java @@ -311,8 +311,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java index c3464f6cd2..732d4ba43c 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java @@ -717,7 +717,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java index 934c65d498..cb179b8b87 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -963,7 +963,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_2.5_Underground/dist/game/java.cfg b/L2J_Mobius_2.5_Underground/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/java.cfg +++ b/L2J_Mobius_2.5_Underground/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ui/Gui.java index c174cdaff4..eeafe3490a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ui/Gui.java @@ -311,8 +311,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java index 27cfcd7a02..b861a892b4 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java @@ -719,7 +719,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java index 92394b6703..b974b07492 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -893,7 +893,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_3.0_Helios/dist/game/java.cfg b/L2J_Mobius_3.0_Helios/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/java.cfg +++ b/L2J_Mobius_3.0_Helios/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java index c174cdaff4..eeafe3490a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java @@ -311,8 +311,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java index 27cfcd7a02..b861a892b4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java @@ -719,7 +719,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java index 56283865a3..82a82bd486 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -887,7 +887,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/java.cfg b/L2J_Mobius_4.0_GrandCrusade/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/java.cfg +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ui/Gui.java index c174cdaff4..eeafe3490a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ui/Gui.java @@ -311,8 +311,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_CT_2.6_HighFive/.settings/org.eclipse.jdt.core.prefs b/L2J_Mobius_CT_2.6_HighFive/.settings/org.eclipse.jdt.core.prefs index 25ac1d2757..4bc509ec3d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/.settings/org.eclipse.jdt.core.prefs +++ b/L2J_Mobius_CT_2.6_HighFive/.settings/org.eclipse.jdt.core.prefs @@ -15,6 +15,14 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error @@ -114,6 +122,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java index 28ddbdd6ca..e686a858b5 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java @@ -641,7 +641,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/QuestMasterHandler.java index 499aa08ab1..4368410fa5 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -1049,7 +1049,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/java.cfg b/L2J_Mobius_CT_2.6_HighFive/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/java.cfg +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ui/Gui.java index c174cdaff4..eeafe3490a 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ui/Gui.java @@ -311,8 +311,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index fdc2952f75..3d08f19b1f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobiush5"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index e20142067c..2513a727df 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobiush5"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java index 76b2b567e4..a492afd034 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java @@ -719,7 +719,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/quests/QuestMasterHandler.java index 12172b950b..aa9502e96c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -363,7 +363,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/java.cfg b/L2J_Mobius_Classic_2.0_Saviors/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/java.cfg +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ui/Gui.java index b1ba2aa6d4..b49ecfcbe7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ui/Gui.java @@ -299,8 +299,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java index 76b2b567e4..a492afd034 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java @@ -719,7 +719,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/quests/QuestMasterHandler.java index 79f722fcc1..1f92f9dee5 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -357,7 +357,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/java.cfg b/L2J_Mobius_Classic_2.1_Zaken/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/java.cfg +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ui/Gui.java index b1ba2aa6d4..b49ecfcbe7 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ui/Gui.java @@ -299,8 +299,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java index 76b2b567e4..a492afd034 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java @@ -719,7 +719,7 @@ public class MasterHandler try { - final Object handler = c.newInstance(); + final Object handler = c.getDeclaredConstructor().newInstance(); for (Entry, Method> entry : registerHandlerMethods.entrySet()) { if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler)) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/quests/QuestMasterHandler.java index 79f722fcc1..1f92f9dee5 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -357,7 +357,7 @@ public class QuestMasterHandler { try { - quest.newInstance(); + quest.getDeclaredConstructor().newInstance(); } catch (Exception e) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/java.cfg b/L2J_Mobius_Classic_2.2_Antharas/dist/game/java.cfg index 38fa2539e6..cb4a4dc204 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/java.cfg +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/java.cfg @@ -1 +1 @@ --server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file +-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=com.l2jmobius.log.L2LogManager -XX:+AggressiveOpts -Xnoclassgc -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -Xmx4g -Xms2g -Xmn1g \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java index 7849204bae..9a80c1db8f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/handler/DailyMissionHandler.java @@ -49,7 +49,6 @@ public class DailyMissionHandler { try { - ScriptEngineManager.getInstance().executeDailyMissionMasterHandler(); } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ui/Gui.java index b1ba2aa6d4..b49ecfcbe7 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ui/Gui.java @@ -299,8 +299,8 @@ public class Gui JScrollPane scrollPanel = new JScrollPane(txtrConsole); scrollPanel.setBounds(0, 0, 800, 550); JLayeredPane layeredPanel = new JLayeredPane(); - layeredPanel.add(scrollPanel, new Integer(0), 0); - layeredPanel.add(systemPanel, new Integer(1), 0); + layeredPanel.add(scrollPanel, 0, 0); + layeredPanel.add(systemPanel, 1, 0); // Set frame. JFrame frame = new JFrame("Mobius - GameServer"); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java index ba6b9f679f..849ef9984e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/util/cron4j/SchedulingPattern.java @@ -370,7 +370,7 @@ public class SchedulingPattern ArrayList values = new ArrayList<>(); for (int i = min; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } return values; } @@ -393,7 +393,7 @@ public class SchedulingPattern if (size == 1) { ArrayList values = new ArrayList<>(); - values.add(new Integer(v1)); + values.add(v1); return values; } String v2Str = st.nextToken(); @@ -411,7 +411,7 @@ public class SchedulingPattern { for (int i = v1; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else if (v1 > v2) @@ -420,17 +420,17 @@ public class SchedulingPattern int max = parser.getMaxValue(); for (int i = v1; i <= max; i++) { - values.add(new Integer(i)); + values.add(i); } for (int i = min; i <= v2; i++) { - values.add(new Integer(i)); + values.add(i); } } else { // v1 == v2 - values.add(new Integer(v1)); + values.add(v1); } return values; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java index cb8c89fa5a..583796e677 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherGS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherGS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/game/"; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java index 1a8c1a955c..8c58a9dfa7 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/LauncherLS.java @@ -29,7 +29,7 @@ import com.l2jmobius.tools.dbinstaller.gui.DBConfigGUI; */ public class LauncherLS extends AbstractDBLauncher { - public static void main(String[] args) + public static void main(String[] args) throws Exception { final String defDatabase = "l2jmobius"; final String dir = "sql/login/"; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java index 3c4121569a..4ac531c664 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/console/DBInstallerConsole.java @@ -32,7 +32,7 @@ public class DBInstallerConsole implements DBOutputInterface { Connection _con; - public DBInstallerConsole(String db, String dir) + public DBInstallerConsole(String db, String dir) throws Exception { System.out.println("Welcome to L2J DataBase installer"); final Preferences prop = Preferences.userRoot(); @@ -98,8 +98,9 @@ public class DBInstallerConsole implements DBOutputInterface * @param pass the password * @param database the database name * @param mode the mode, c: Clean, u:update + * @throws Exception */ - public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) + public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode) throws Exception { if ((database == null) || database.isEmpty()) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java index 366df7e60a..5d95647387 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBConfigGUI.java @@ -33,6 +33,7 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.WindowConstants; import com.l2jmobius.commons.util.SplashScreen; import com.l2jmobius.tools.dbinstaller.RunTasks; @@ -82,7 +83,7 @@ public class DBConfigGUI extends JFrame final int height = 220; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); @@ -137,9 +138,17 @@ public class DBConfigGUI extends JFrame final ActionListener connectListener = e -> { - final MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + MySqlConnect connector = null; + try + { + connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - if (connector.getConnection() != null) + if ((connector != null) && (connector.getConnection() != null)) { _prop.put("dbHost_" + _db, _dbHost.getText()); _prop.put("dbPort_" + _db, _dbPort.getText()); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java index 724a48677d..1d2c33c3e2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/gui/DBInstallerGUI.java @@ -30,6 +30,7 @@ import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.WindowConstants; import com.l2jmobius.tools.dbinstaller.DBOutputInterface; @@ -62,7 +63,7 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface final int height = 360; final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height); setResizable(false); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java index 91555627ba..08c3d4dc5b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/tools/dbinstaller/util/mysql/MySqlConnect.java @@ -31,11 +31,11 @@ public class MySqlConnect { Connection con = null; - public MySqlConnect(String host, String port, String user, String password, String db, boolean console) + public MySqlConnect(String host, String port, String user, String password, String db, boolean console) throws Exception { try (Formatter form = new Formatter()) { - Class.forName("com.mysql.jdbc.Driver").newInstance(); + Class.forName("com.mysql.jdbc.Driver").getDeclaredConstructor().newInstance(); final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString(); con = DriverManager.getConnection(formattedText, user, password);