From 110202f22bab30d2a09c59787fa6cfcfbf04497d Mon Sep 17 00:00:00 2001 From: Joe George Date: Mon, 3 Jun 2024 10:43:41 -0400 Subject: [PATCH] Fix deprecation warnings --- .../Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java | 5 ++--- java/Glacier2/simpleChat/Client.java | 4 ++-- java/Ice/interrupt/Server.java | 2 +- java/Ice/swing/Client.java | 2 +- java/build.gradle | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/java/Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java b/java/Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java index 8421fa311e..a29d3f027b 100644 --- a/java/Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java +++ b/java/Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java @@ -37,7 +37,6 @@ import com.zeroc.Glacier2.SessionHelper; import com.zeroc.Glacier2.SessionCallback; import com.zeroc.Glacier2.SessionNotExistException; -import com.zeroc.Ice.Util; class Coordinator { @@ -55,14 +54,14 @@ public Coordinator(MainView mainView, LoginView loginView, ChatView chatView, De com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData(); java.util.List rArgs = new java.util.ArrayList<>(); - initData.properties = com.zeroc.Ice.Util.createProperties(_args, rArgs); + initData.properties = new com.zeroc.Ice.Properties(_args, rArgs); _args = rArgs.toArray(new String[rArgs.size()]); initData.properties.setProperty("Ice.Plugin.IceSSL", "com.zeroc.IceSSL.PluginFactory"); // Load the configuration file. initData.properties.setProperty("Ice.Default.Package", "com.zeroc.demos"); - initData.properties = Util.createProperties(args, initData.properties); + initData.properties = new com.zeroc.Ice.Properties(args, initData.properties); // // Set Ice.Default.Router if not set. diff --git a/java/Glacier2/simpleChat/Client.java b/java/Glacier2/simpleChat/Client.java index 18943ebecd..c28dc5c29f 100644 --- a/java/Glacier2/simpleChat/Client.java +++ b/java/Glacier2/simpleChat/Client.java @@ -290,10 +290,10 @@ public void windowClosing(WindowEvent e) com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData(); // Load the configuration file. - initData.properties = com.zeroc.Ice.Util.createProperties(); + initData.properties = new com.zeroc.Ice.Properties(); initData.properties.load("config.client"); initData.properties.setProperty("Ice.Default.Package", "com.zeroc.demos.Glacier2.simpleChat"); - initData.properties = Util.createProperties(args, initData.properties); + initData.properties = new com.zeroc.Ice.Properties(args, initData.properties); // Setup a dispatcher to dispath Ice and Glacier2 helper callbacks to the GUI thread. initData.dispatcher = (runnable, connection) -> diff --git a/java/Ice/interrupt/Server.java b/java/Ice/interrupt/Server.java index d340c76300..d31d5f8dc6 100644 --- a/java/Ice/interrupt/Server.java +++ b/java/Ice/interrupt/Server.java @@ -13,7 +13,7 @@ public static void main(String[] args) java.util.List extraArgs = new java.util.ArrayList(); com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData(); - initData.properties = com.zeroc.Ice.Util.createProperties(); + initData.properties = new com.zeroc.Ice.Properties(); initData.properties.load("config.server"); // diff --git a/java/Ice/swing/Client.java b/java/Ice/swing/Client.java index 1ba209fb4d..f97af49947 100644 --- a/java/Ice/swing/Client.java +++ b/java/Ice/swing/Client.java @@ -47,7 +47,7 @@ public static void main(final String[] args) // Initialize an Ice communicator. // com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData(); - initData.properties = com.zeroc.Ice.Util.createProperties(); + initData.properties = new com.zeroc.Ice.Properties(); initData.properties.load("config.client"); initData.properties.setProperty("Ice.Default.Package", "com.zeroc.demos.Ice.swing"); initData.dispatcher = (runnable, connection) -> SwingUtilities.invokeLater(runnable); diff --git a/java/build.gradle b/java/build.gradle index f571ce8c6f..4b058313a8 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -9,7 +9,7 @@ subprojects { apply from: "$rootProject.projectDir/gradle/ice.gradle" tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:-options" + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:-options" << "-Xlint:deprecation" options.encoding = "UTF-8" } }