Fix multi-release JAR issue with VirtualThreadDelegate

This commit ensures that both `VirtualThreadDelegate` implementations
expose the same public API. If not, JAR verification fails with the
following message:

```
jar --validate --file spring-core-6.2.13-SNAPSHOT.jar
entry: META-INF/versions/21/org/springframework/core/task/VirtualThreadDelegate.class, contains a class with different api from earlier version
```

Fixes gh-35773
This commit is contained in:
Brian Clozel
2025-11-07 14:01:51 +01:00
parent b5008d33ee
commit f0cf7f19f6
@@ -30,6 +30,10 @@ final class VirtualThreadDelegate {
private final Thread.Builder threadBuilder = Thread.ofVirtual();
public VirtualThreadDelegate() {
}
public ThreadFactory virtualThreadFactory() {
return this.threadBuilder.factory();
}