Update to java 22

This commit is contained in:
Andrea Cavalli 2024-03-22 21:24:34 +01:00
parent a7c8e894a0
commit db2125cc46
2 changed files with 4 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>filequeue</artifactId> <artifactId>filequeue</artifactId>
<name>file queue project</name> <name>file queue project</name>
<version>3.1.13</version> <version>3.1.15</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>Light weight, high performance, simple, reliable and persistent queue</description> <description>Light weight, high performance, simple, reliable and persistent queue</description>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -32,9 +32,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version> <version>3.10.1</version>
<configuration> <configuration>
<source>21</source> <source>22</source>
<target>21</target> <target>22</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -59,7 +59,7 @@ public class SimpleQueueMemorySegment<T> implements SimpleQueue<T>, Closeable {
throw new UncheckedIOException(e); throw new UncheckedIOException(e);
} }
try (var arena = Arena.ofConfined()) { try (var arena = Arena.ofConfined()) {
var memorySegment = arena.allocateArray(ValueLayout.JAVA_BYTE, serialized); var memorySegment = arena.allocateFrom(ValueLayout.JAVA_BYTE, serialized);
try { try {
if (!getQueueSegmentForWrite().offer(memorySegment)) { if (!getQueueSegmentForWrite().offer(memorySegment)) {
expandQueueSegmentForWrite().add(memorySegment); expandQueueSegmentForWrite().add(memorySegment);