aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime/src/main
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-21 17:34:09 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-21 17:34:09 +0700
commitecb5320c7b61d72edbf4a440e4996171a9c8f7dd (patch)
tree2b5496ad42ca47d0f3c7e636f2130dbb4d8b6e2c /loadtime/src/main
parente4a2a5a5d274bc16bae3d1178789752dba043730 (diff)
downloadaspectj-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 'loadtime/src/main')
-rw-r--r--loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java2
-rw-r--r--loadtime/src/main/java/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java7
2 files changed, 3 insertions, 6 deletions
diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java
index e76f60e7c..1577ffc21 100644
--- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java
+++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java
@@ -65,7 +65,7 @@ public class Options {
String handlerClass = arg.substring(OPTIONVALUED_messageHandler.length()).trim();
try {
Class<?> handler = Class.forName(handlerClass, false, laoder);
- weaverOption.messageHandler = ((IMessageHandler) handler.newInstance());
+ weaverOption.messageHandler = ((IMessageHandler) handler.getDeclaredConstructor().newInstance());
} catch (Throwable t) {
weaverOption.messageHandler.handleMessage(new Message("Cannot instantiate message handler " + handlerClass,
IMessage.ERROR, t, null));
diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
index 9ee650dc6..f0773c0ed 100644
--- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
+++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
@@ -98,13 +98,10 @@ public class WeavingURLClassLoader extends ExtensibleURLClassLoader implements W
File f = new File(t.nextToken().trim());
try {
if (f.exists()) {
- URL url = f.toURL();
- if (url != null) {
+ URL url = f.toURI().toURL();
urlList.add(url);
}
- }
- } catch (MalformedURLException e) {
- }
+ } catch (MalformedURLException ignored) {}
}
URL[] urls = new URL[urlList.size()];