diff options
author | Andrey Turbanov <turbanoff@gmail.com> | 2022-04-12 11:22:29 +0300 |
---|---|---|
committer | Andrey Turbanov <turbanoff@gmail.com> | 2022-04-12 11:22:29 +0300 |
commit | 1c487b2e0f54eeb4c2630940e7d57c279ba5a032 (patch) | |
tree | 0c0d84e75783441de07f4193e003429e64b11550 /runtime/src | |
parent | caa2c39be10775a8772a27eea8b9a673dd0bab8d (diff) | |
download | aspectj-1c487b2e0f54eeb4c2630940e7d57c279ba5a032.tar.gz aspectj-1c487b2e0f54eeb4c2630940e7d57c279ba5a032.zip |
Remove redundant casts after generics update
Diffstat (limited to 'runtime/src')
7 files changed, 10 insertions, 10 deletions
diff --git a/runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java b/runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java index 49f3bb18c..8e6550c76 100644 --- a/runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java +++ b/runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java @@ -120,7 +120,7 @@ public class AjTypeImpl<T> implements AjType<T> { */ public AjType<? super T> getSupertype() { Class<? super T> superclass = clazz.getSuperclass(); - return superclass==null ? null : (AjType<? super T>) new AjTypeImpl<>(superclass); + return superclass==null ? null : new AjTypeImpl<>(superclass); } /* (non-Javadoc) diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/CFlowStack.java b/runtime/src/main/java/org/aspectj/runtime/internal/CFlowStack.java index a95b7d2c4..d9f597b3e 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/CFlowStack.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/CFlowStack.java @@ -91,7 +91,7 @@ public class CFlowStack { public Object peek() { Stack<?> stack = getThreadStack(); if (stack.isEmpty()) throw new org.aspectj.lang.NoAspectBoundException(); - return (Object)stack.peek(); + return stack.peek(); } public Object get(int index) { diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounterImpl11.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounterImpl11.java index 6f6a51bd9..4b51816fd 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounterImpl11.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounterImpl11.java @@ -34,7 +34,7 @@ public class ThreadCounterImpl11 implements ThreadCounter { private synchronized Counter getThreadCounter() { if (Thread.currentThread() != cached_thread) { cached_thread = Thread.currentThread(); - cached_counter = (Counter)counters.get(cached_thread); + cached_counter = counters.get(cached_thread); if (cached_counter == null) { cached_counter = new Counter(); counters.put(cached_thread, cached_counter); @@ -45,7 +45,7 @@ public class ThreadCounterImpl11 implements ThreadCounter { if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) { List<Thread> dead_stacks = new ArrayList<>(); for (Enumeration<Thread> e = counters.keys(); e.hasMoreElements(); ) { - Thread t = (Thread)e.nextElement(); + Thread t = e.nextElement(); if (!t.isAlive()) dead_stacks.add(t); } for (Thread t : dead_stacks) { diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java index db58be683..02f5e4cdf 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java @@ -21,7 +21,7 @@ public class ThreadStackFactoryImpl implements ThreadStackFactory { return new Stack(); } public Stack getThreadStack() { - return (Stack)get(); + return get(); } public void removeThreadStack() { this.remove(); @@ -38,7 +38,7 @@ public class ThreadStackFactoryImpl implements ThreadStackFactory { return new Counter(); } public Counter getThreadCounter() { - return (Counter)get(); + return get(); } public void removeThreadCounter() { diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java index 5f37fa73f..fc6b94ee2 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java @@ -39,11 +39,11 @@ public class ThreadStackImpl11 implements ThreadStack { if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) { Stack<Thread> dead_stacks = new Stack<>(); for (Enumeration<Thread> e = stacks.keys(); e.hasMoreElements(); ) { - Thread t = (Thread)e.nextElement(); + Thread t = e.nextElement(); if (!t.isAlive()) dead_stacks.push(t); } for (Enumeration<Thread> e = dead_stacks.elements(); e.hasMoreElements(); ) { - Thread t = (Thread)e.nextElement(); + Thread t = e.nextElement(); stacks.remove(t); } change_count = 0; diff --git a/runtime/src/main/java/org/aspectj/runtime/reflect/Factory.java b/runtime/src/main/java/org/aspectj/runtime/reflect/Factory.java index 58d01d1ea..c012a6029 100644 --- a/runtime/src/main/java/org/aspectj/runtime/reflect/Factory.java +++ b/runtime/src/main/java/org/aspectj/runtime/reflect/Factory.java @@ -59,7 +59,7 @@ public final class Factory { static Class<?> makeClass(String s, ClassLoader loader) { if (s.equals("*")) return null; - Class<?> ret = (Class)prims.get(s); + Class<?> ret = prims.get(s); if (ret != null) return ret; try { diff --git a/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java b/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java index 3e87369f3..28ebbd759 100644 --- a/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java +++ b/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java @@ -230,7 +230,7 @@ abstract class SignatureImpl implements Signature { } private String[] array() { - return (String[]) toStringCacheRef.get(); + return toStringCacheRef.get(); } private String[] makeCache() { |