Skip to content

Commit 5bd70d1

Browse files
committed
Remove element from protectionDomains when resetting the class loader
When we reset the class loader with the new transformed classes, we need to make sure we drop the element from the protectionDomains, otherwise the MemoryClassPathElement is kept as a key and leaks to the next test/dev mode runs. Fixes quarkusio#51688
1 parent d980f91 commit 5bd70d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/QuarkusClassLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public void reset(Map<String, byte[]> generatedResources, Map<String, byte[]> tr
233233
throw new IllegalStateException("Classloader is not resettable");
234234
}
235235
synchronized (this) {
236+
// we don't want the previous MemoryClassPathElement to leak as a key of protectionDomains
237+
protectionDomains.remove(this.transformedClasses);
236238
this.transformedClasses = new MemoryClassPathElement(transformedClasses, true);
237239
resettableElement.reset(generatedResources);
238240
classPathResourceIndex = null;

0 commit comments

Comments
 (0)