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 | |
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')
4 files changed, 6 insertions, 7 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()); diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java index 42c5189a4..cef1f7c90 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java @@ -49,7 +49,7 @@ public class ClassLoaderRepositoryTest extends TestCase { private ClassLoaderRepository setupRepository() throws Exception { ClassLoader cl = Thread.currentThread().getContextClassLoader(); - ClassLoader res = new URLClassLoader(new URL[]{f.toURL()},cl); + ClassLoader res = new URLClassLoader(new URL[]{f.toURI().toURL()},cl); ClassLoaderRepository rep = new ClassLoaderRepository(res); return rep; } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java index 6e4ffa9f6..d3eaaf67e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java @@ -21,7 +21,7 @@ import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.PointcutRewriter; -import junit.framework.Assert; +import org.junit.Assert; import junit.framework.TestCase; /** |