diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
commit | ecb5320c7b61d72edbf4a440e4996171a9c8f7dd (patch) | |
tree | 2b5496ad42ca47d0f3c7e636f2130dbb4d8b6e2c /build/src/main | |
parent | e4a2a5a5d274bc16bae3d1178789752dba043730 (diff) | |
download | aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.tar.gz aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.zip |
Fix some deprecated Java and JUnit warnings by using newer API calls
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'build/src/main')
-rw-r--r-- | build/src/main/java/$installer$/org/aspectj/Main.java | 2 | ||||
-rw-r--r-- | build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/build/src/main/java/$installer$/org/aspectj/Main.java b/build/src/main/java/$installer$/org/aspectj/Main.java index f75f28a6e..a307be930 100644 --- a/build/src/main/java/$installer$/org/aspectj/Main.java +++ b/build/src/main/java/$installer$/org/aspectj/Main.java @@ -145,7 +145,7 @@ public class Main { try { String className = (String) properties.get("installer.main.class"); //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - Installer installer = (Installer) Class.forName(className).newInstance(); + Installer installer = (Installer) Class.forName(className).getDeclaredConstructor().newInstance(); InstallContext installerContext = new InstallContext(properties); installerContext.setHasGui(hasGui); installer.setContext(installerContext); diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java index 31ed76201..82edad5ea 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java @@ -599,7 +599,7 @@ public class AntBuilder extends Builder { ClassLoader parent = Task.class.getClassLoader(); ClassLoader loader = new URLClassLoader(cp, parent); Class c = loader.loadClass(AJCTASK); - task = c.newInstance(); + task = c.getDeclaredConstructor().newInstance(); // Westodo Project project = javac.getProject(); Method m = c.getMethod("setupAjc", new Class[] { Javac.class }); m.invoke(task, new Object[] { javac }); @@ -825,4 +825,4 @@ class ProjectMessager extends Messager { return true; } -}
\ No newline at end of file +} |