Skip to content

Commit d6b46b3

Browse files
committed
Add JDK 25 support for ScopedValue, prepare next build
1 parent b24992e commit d6b46b3

File tree

14 files changed

+225
-52
lines changed

14 files changed

+225
-52
lines changed

.classpath

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<attribute name="maven.pomderived" value="true"/>
88
</attributes>
99
</classpathentry>
10+
<classpathentry kind="src" path="src/main/java25"/>
1011
<classpathentry excluding="module-info.java" kind="src" output="target/classes" path="src/main/java">
1112
<attributes>
1213
<attribute name="optional" value="true"/>
@@ -19,7 +20,7 @@
1920
<attribute name="optional" value="true"/>
2021
</attributes>
2122
</classpathentry>
22-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
23+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
2324
<attributes>
2425
<attribute name="module" value="true"/>
2526
<attribute name="maven.pomderived" value="true"/>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
33
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
55
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6-
org.eclipse.jdt.core.compiler.compliance=12
6+
org.eclipse.jdt.core.compiler.compliance=25
77
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
88
org.eclipse.jdt.core.compiler.debug.localVariable=generate
99
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
1313
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
1414
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
1515
org.eclipse.jdt.core.compiler.release=enabled
16-
org.eclipse.jdt.core.compiler.source=12
16+
org.eclipse.jdt.core.compiler.source=25

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate/net.tascalate.concurrent.svg)](https://search.maven.org/artifact/net.tascalate/net.tascalate.concurrent/0.9.10/jar) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-concurrent.svg)](https://github.com/vsilaev/tascalate-concurrent/releases/tag/0.9.10) [![license](https://img.shields.io/github/license/vsilaev/tascalate-concurrent.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
1+
[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate/net.tascalate.concurrent.svg)](https://search.maven.org/artifact/net.tascalate/net.tascalate.concurrent/0.9.11/jar) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-concurrent.svg)](https://github.com/vsilaev/tascalate-concurrent/releases/tag/0.9.11) [![license](https://img.shields.io/github/license/vsilaev/tascalate-concurrent.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
22
# tascalate-concurrent
33
The library provides an implementation of the [CompletionStage](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletionStage.html) interface and related classes these are designed to support long-running blocking tasks (typically, I/O bound). This functionality augments the sole Java 8 built-in implementation, [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html), that is primarily supports computational tasks. Also, the library helps with numerous asynchronous programing challenges like handling timeouts, retry/poll functionality, orchestrating results of multiple concurrent computations and similar.
44

@@ -12,7 +12,7 @@ New name:
1212
<dependency>
1313
<groupId>net.tascalate</groupId>
1414
<artifactId>net.tascalate.concurrent</artifactId>
15-
<version>0.9.10</version> <!-- Any version above 0.8.0, the latest one is recommended -->
15+
<version>0.9.11</version> <!-- Any version above 0.8.0, the latest one is recommended -->
1616
</dependency>
1717
```
1818
Old Name
@@ -38,16 +38,7 @@ To use a library you have to add a single Maven dependency
3838
<dependency>
3939
<groupId>net.tascalate</groupId>
4040
<artifactId>net.tascalate.concurrent</artifactId>
41-
<version>0.9.10</version>
42-
</dependency>
43-
```
44-
45-
If you are developing code for JDK 21+ and need to use `ScopedValue` as a `ContentVar`-iable then add the following dependency as well:
46-
```xml
47-
<dependency>
48-
<groupId>net.tascalate</groupId>
49-
<artifactId>net.tascalate.concurrent.addon</artifactId>
50-
<version>0.1.0</version>
41+
<version>0.9.11</version>
5142
</dependency>
5243
```
5344

pom.xml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.tascalate</groupId>
88
<artifactId>net.tascalate.concurrent</artifactId>
9-
<version>0.9.10</version>
9+
<version>0.9.11</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Tascalate Concurrent</name>
@@ -69,7 +69,7 @@
6969
<plugin>
7070
<groupId>org.apache.maven.plugins</groupId>
7171
<artifactId>maven-source-plugin</artifactId>
72-
<version>3.3.1</version>
72+
<version>3.4.0</version>
7373
<executions>
7474
<execution>
7575
<id>attach-sources</id>
@@ -82,7 +82,7 @@
8282
<plugin>
8383
<groupId>org.apache.maven.plugins</groupId>
8484
<artifactId>maven-javadoc-plugin</artifactId>
85-
<version>3.11.2</version>
85+
<version>3.12.0</version>
8686
<configuration>
8787
<jdkToolchain>
8888
<version>1.8</version>
@@ -102,7 +102,7 @@
102102
<plugin>
103103
<groupId>org.apache.maven.plugins</groupId>
104104
<artifactId>maven-gpg-plugin</artifactId>
105-
<version>3.2.7</version>
105+
<version>3.2.8</version>
106106
<executions>
107107
<execution>
108108
<id>sign-artifacts</id>
@@ -152,12 +152,12 @@
152152
<plugin>
153153
<groupId>org.apache.maven.plugins</groupId>
154154
<artifactId>maven-jar-plugin</artifactId>
155-
<version>3.4.2</version>
155+
<version>3.5.0</version>
156156
</plugin>
157157
<plugin>
158158
<groupId>org.apache.maven.plugins</groupId>
159159
<artifactId>maven-surefire-plugin</artifactId>
160-
<version>3.5.3</version>
160+
<version>3.5.4</version>
161161
<configuration>
162162
<includes>
163163
<include>**/*TestSuite.java</include>
@@ -171,7 +171,7 @@
171171
<plugin>
172172
<groupId>org.moditect</groupId>
173173
<artifactId>moditect-maven-plugin</artifactId>
174-
<version>1.2.2.Final</version>
174+
<version>1.3.0.Final</version>
175175
<executions>
176176
<execution>
177177
<id>add-module-infos</id>
@@ -192,7 +192,7 @@
192192
<plugin>
193193
<groupId>org.sonatype.central</groupId>
194194
<artifactId>central-publishing-maven-plugin</artifactId>
195-
<version>0.8.0</version>
195+
<version>0.9.0</version>
196196
<extensions>true</extensions>
197197
<configuration>
198198
<publishingServerId>ossrh</publishingServerId>
@@ -201,7 +201,7 @@
201201
<plugin>
202202
<groupId>org.apache.maven.plugins</groupId>
203203
<artifactId>maven-compiler-plugin</artifactId>
204-
<version>3.14.0</version>
204+
<version>3.14.1</version>
205205
<executions>
206206
<execution>
207207
<id>default-compile</id>
@@ -218,6 +218,23 @@
218218
</excludes>
219219
</configuration>
220220
</execution>
221+
<execution>
222+
<id>compile-java25</id>
223+
<goals>
224+
<goal>compile</goal>
225+
</goals>
226+
<configuration>
227+
<jdkToolchain>
228+
<version>25</version>
229+
<vendor>Oracle</vendor>
230+
</jdkToolchain>
231+
<release>25</release>
232+
<compileSourceRoots>
233+
<compileSourceRoot>${project.basedir}/src/main/java25</compileSourceRoot>
234+
</compileSourceRoots>
235+
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
236+
</configuration>
237+
</execution>
221238
</executions>
222239
<configuration>
223240
<source>1.8</source>

src/main/java/net/tascalate/concurrent/CompletableFutureWrapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected CompletableFutureWrapper(CompletableFuture<T> delegate) {
3232
super(delegate);
3333
}
3434

35+
@SuppressWarnings("deprecation")
3536
protected boolean success(T value) {
3637
return onSuccess(value);
3738
}
@@ -41,6 +42,7 @@ protected boolean onSuccess(T value) {
4142
return delegate.complete(value);
4243
}
4344

45+
@SuppressWarnings("deprecation")
4446
protected boolean failure(Throwable ex) {
4547
return onFailure(ex);
4648
}

src/main/java/net/tascalate/concurrent/var/ContextTrampoline.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,29 +129,29 @@ public static <T> ContextTrampoline<T> relay(ThreadLocal<T> threadLocal) {
129129
}
130130

131131
@SafeVarargs
132-
public static <T> ContextVar<List<? extends T>> genericVars(ContextVar<? extends T>... contextVars) {
132+
public static <T> ContextVar<List<T>> genericVars(ContextVar<? extends T>... contextVars) {
133133
return ContextVar.of(contextVars);
134134
}
135135

136-
public static <T> ContextVar<List<? extends T>> genericVars(List<? extends ContextVar<? extends T>> contextVars) {
136+
public static <T> ContextVar<List<T>> genericVars(List<? extends ContextVar<? extends T>> contextVars) {
137137
return ContextVar.of(contextVars);
138138
}
139139

140140
@SafeVarargs
141-
public static <T> ContextVar<List<? extends T>> modifiableVars(ModifiableContextVar<? extends T>... contextVars) {
141+
public static <T> ContextVar<List<T>> modifiableVars(ModifiableContextVar<? extends T>... contextVars) {
142142
return ModifiableContextVar.of(contextVars);
143143
}
144144

145-
public static <T> ContextVar<List<? extends T>> modifiableVars(List<? extends ModifiableContextVar<? extends T>> contextVars) {
145+
public static <T> ContextVar<List<T>> modifiableVars(List<? extends ModifiableContextVar<? extends T>> contextVars) {
146146
return ModifiableContextVar.of(contextVars);
147147
}
148148

149149
@SafeVarargs
150-
public static <T> ContextVar<List<? extends T>> threadLocals(ThreadLocal<? extends T>... contextVars) {
150+
public static <T> ContextVar<List<T>> threadLocals(ThreadLocal<? extends T>... contextVars) {
151151
return ThreadLocalVar.of(contextVars);
152152
}
153153

154-
public static <T> ContextVar<List<? extends T>> threadLocals(List<? extends ThreadLocal<? extends T>> contextVars) {
154+
public static <T> ContextVar<List<T>> threadLocals(List<? extends ThreadLocal<? extends T>> contextVars) {
155155
return ThreadLocalVar.of(contextVars);
156156
}
157157

src/main/java/net/tascalate/concurrent/var/ContextVar.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public static <T> ContextVar<T> empty() {
8888
}
8989

9090
@SafeVarargs
91-
public static <T> ContextVar<List<? extends T>> of(ContextVar<? extends T>... vars) {
91+
public static <T> ContextVar<List<T>> of(ContextVar<? extends T>... vars) {
9292
return of(Arrays.asList(vars));
9393
}
9494

95-
public static <T> ContextVar<List<? extends T>> of(List<? extends ContextVar<? extends T>> vars) {
95+
public static <T> ContextVar<List<T>> of(List<? extends ContextVar<? extends T>> vars) {
9696
if (null == vars || vars.isEmpty()) {
9797
return ContextVar.empty();
9898
} else {
@@ -101,11 +101,11 @@ public static <T> ContextVar<List<? extends T>> of(List<? extends ContextVar<? e
101101
}
102102

103103
@SafeVarargs
104-
public static <T> ContextVar<List<? extends T>> ofMorphing(ContextVar<? extends T>... vars) {
104+
public static <T> ContextVar<List<T>> ofMorphing(ContextVar<? extends T>... vars) {
105105
return ofMorphing(Arrays.asList(vars));
106106
}
107107

108-
public static <T> ContextVar<List<? extends T>> ofMorphing(List<? extends ContextVar<? extends T>> vars) {
108+
public static <T> ContextVar<List<T>> ofMorphing(List<? extends ContextVar<? extends T>> vars) {
109109
if (null == vars || vars.isEmpty()) {
110110
return ContextVar.empty();
111111
} else {

src/main/java/net/tascalate/concurrent/var/ContextVarGroup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.concurrent.Callable;
2121
import java.util.stream.Collectors;
2222

23-
class ContextVarGroup<T> implements ContextVar<List<? extends T>> {
23+
class ContextVarGroup<T> implements ContextVar<List<T>> {
2424

2525
final List<? extends ContextVar<? extends T>> vars;
2626

@@ -29,14 +29,14 @@ class ContextVarGroup<T> implements ContextVar<List<? extends T>> {
2929
}
3030

3131
@Override
32-
public List<? extends T> get() {
32+
public List<T> get() {
3333
return vars.stream()
3434
.map(ContextVar::get)
3535
.collect(Collectors.toList());
3636
}
3737

3838
@Override
39-
public <V> V callWith(List<? extends T> capturedValue, Callable<V> code) throws Exception {
39+
public <V> V callWith(List<T> capturedValue, Callable<V> code) throws Exception {
4040
Iterator<? extends ContextVar<?>> varsIterator = vars.iterator();
4141
Iterator<? extends T> valuesIterator = capturedValue.iterator();
4242
Callable<V> wrappedCode = code;

src/main/java/net/tascalate/concurrent/var/ModifiableContextVar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public static <T> ModifiableContextVar<T> define(String name, Supplier<? extends
5454
}
5555

5656
@SafeVarargs
57-
public static <T> ContextVar<List<? extends T>> of(ModifiableContextVar<? extends T>... vars) {
57+
public static <T> ContextVar<List<T>> of(ModifiableContextVar<? extends T>... vars) {
5858
return of(Arrays.asList(vars));
5959
}
6060

61-
public static <T> ContextVar<List<? extends T>> of(List<? extends ModifiableContextVar<? extends T>> vars) {
61+
public static <T> ContextVar<List<T>> of(List<? extends ModifiableContextVar<? extends T>> vars) {
6262
if (null == vars || vars.isEmpty()) {
6363
return ContextVar.empty();
6464
}

src/main/java/net/tascalate/concurrent/var/ModifiableContextVarGroup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
import java.util.concurrent.Callable;
2020
import java.util.stream.Collectors;
2121

22-
abstract class ModifiableContextVarGroup<T> implements ModifiableContextVar<List<? extends T>> {
22+
abstract class ModifiableContextVarGroup<T> implements ModifiableContextVar<List<T>> {
2323
final List<? extends ModifiableContextVar<? extends T>> vars;
2424

2525
ModifiableContextVarGroup(List<? extends ModifiableContextVar<? extends T>> vars) {
2626
this.vars = vars;
2727
}
2828

2929
@Override
30-
public List<? extends T> get() {
30+
public List<T> get() {
3131
return vars.stream()
3232
.map(ContextVar::get)
3333
.collect(Collectors.toList());
3434
}
3535

3636
@Override
37-
public void set(List<? extends T> value) {
37+
public void set(List<T> value) {
3838
ContextVarHelper.applyValues(vars, value);
3939
}
4040

@@ -51,7 +51,7 @@ final static class Strict<T> extends ModifiableContextVarGroup<T> {
5151
}
5252

5353
@Override
54-
public <V> V callWith(List<? extends T> capturedValue, Callable<V> code) throws Exception {
54+
public <V> V callWith(List<T> capturedValue, Callable<V> code) throws Exception {
5555
List<? extends T> previousValues = this.get();
5656
ContextVarHelper.applyValues(vars, capturedValue);
5757
try {
@@ -85,7 +85,7 @@ final static class Optimized<T> extends ModifiableContextVarGroup<T> {
8585
}
8686

8787
@Override
88-
public <V> V callWith(List<? extends T> capturedValue, Callable<V> code) throws Exception {
88+
public <V> V callWith(List<T> capturedValue, Callable<V> code) throws Exception {
8989
ContextVarHelper.applyValues(vars, capturedValue);
9090
try {
9191
return code.call();

0 commit comments

Comments
 (0)