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 /weaver/src/main/java | |
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 'weaver/src/main/java')
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java | 2 | ||||
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java index f2e61c565..5e72d84ce 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java @@ -280,7 +280,7 @@ public final class LazyClassGen { } public String getNewGeneratedNameTag() { - return new Integer(childCounter++).toString(); + return Integer.toString(childCounter++); } // ---- diff --git a/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java b/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java index 077a91943..ca4779526 100644 --- a/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java +++ b/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java @@ -11,6 +11,7 @@ * ******************************************************************/ package org.aspectj.weaver.ltw; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -179,10 +180,8 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { private static Map makeConcurrentMap() { if (concurrentMapClass != null) { try { - return (Map) concurrentMapClass.newInstance(); - } catch (InstantiationException ie) { - } catch (IllegalAccessException iae) { - } + return (Map) concurrentMapClass.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ignored) {} // fall through if exceptions } return Collections.synchronizedMap(new HashMap()); |