aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2022-04-13 13:51:39 +0300
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-04-15 11:00:33 +0700
commit2091b6d1ded90bfeb29f8d74bd17f05ec8fc983d (patch)
tree4afc936dbc982b72b5dadddafc8360f6c4436be0 /loadtime
parent047a93c24f4eef3b2ebf254be9332d4340adbd04 (diff)
downloadaspectj-2091b6d1ded90bfeb29f8d74bd17f05ec8fc983d.tar.gz
aspectj-2091b6d1ded90bfeb29f8d74bd17f05ec8fc983d.zip
Reduce 'Object' class usage
Diffstat (limited to 'loadtime')
-rw-r--r--loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java
index f54a42d02..3c6ab2952 100644
--- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java
+++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.aspectj.weaver.loadtime;
+import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.security.ProtectionDomain;
@@ -46,7 +47,7 @@ public class Aj implements ClassPreProcessor {
* should tidy up the adaptor map and remove the adaptor (weaver) from the map we are maintaining from adaptorkey &gt; adaptor
* (weaver)
*/
- private static ReferenceQueue adaptorQueue = new ReferenceQueue();
+ private static ReferenceQueue<ClassLoader> adaptorQueue = new ReferenceQueue<>();
private static Trace trace = TraceFactory.getTraceFactory().getTrace(Aj.class);
@@ -198,11 +199,11 @@ public class Aj implements ClassPreProcessor {
System.err.println("Weaver adaptors before queue processing:");
Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> m = WeaverContainer.weavingAdaptors;
Set<AdaptorKey> keys = m.keySet();
- for (Object object : keys) {
+ for (AdaptorKey object : keys) {
System.err.println(object + " = " + WeaverContainer.weavingAdaptors.get(object));
}
}
- Object o = adaptorQueue.poll();
+ Reference<?> o = adaptorQueue.poll();
while (o != null) {
if (displayProgress)
System.err.println("Processing referencequeue entry " + o);
@@ -221,7 +222,7 @@ public class Aj implements ClassPreProcessor {
System.err.println("Weaver adaptors after queue processing:");
Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> m = WeaverContainer.weavingAdaptors;
Set<AdaptorKey> keys = m.keySet();
- for (Object object : keys) {
+ for (AdaptorKey object : keys) {
System.err.println(object + " = " + WeaverContainer.weavingAdaptors.get(object));
}
}
@@ -242,7 +243,7 @@ public class Aj implements ClassPreProcessor {
*/
public static void checkQ() {
synchronized (adaptorQueue) {
- Object o = adaptorQueue.poll();
+ Reference<?> o = adaptorQueue.poll();
while (o != null) {
AdaptorKey wo = (AdaptorKey) o;
// boolean removed =