From 966326ea32f3ff0160e8d04f2b7d1b1830c62433 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 8 Apr 2024 13:40:01 +0200 Subject: Revert WeavingAdaptor generated class map optimisation This was introduced in commit 8a4aa03845 of PR #278 contribution as part of the #279 fix. The contributor thought that the generated closure class entries were never used, but in fact AJDT class OSGiWeavingAdaptor relies on the presence of those entries. To the best of my present knowledge, it looks as if this change was the root cause of https://github.com/eclipse-aspectj/ajdt/issues/57. Therefore, I reverted it, simultaneously refactoring Iterator::remove usage to delete entries from the map to Collection::removeIf. Signed-off-by: Alexander Kriegisch --- weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java | 1 + 1 file changed, 1 insertion(+) (limited to 'weaver') diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java index 9ee4c0962..42a4e37ee 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -939,6 +939,7 @@ public class WeavingAdaptor implements IMessageContext { lacache.addGeneratedClassesNames(wovenClass.getClassName(), wovenClass.getBytes(), result.getClassName()); } + generatedClasses.put(className, result); generatedClasses.put(wovenClass.getClassName(), wovenClass); generatedClassHandler.acceptClass(className, null, resultBytes); } -- cgit v1.2.3