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

View File

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