Description
Branch branch-4.17 fails to compile after commit 0e1bddd ([Fix] ConcurrentLongHashMap throw ArrayIndexOutOfBoundsException, #4771) was backported to it.
The commit introduces a Java record declaration in ConcurrentLongHashMap:
private record Table<V>(long[] keys, V[] values, int capacity) { }
The record keyword requires Java 16+, but on branch-4.17 the root pom.xml sets:
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
so the file fails to parse.
Build error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (default-compile) on project bookkeeper-server: Compilation failure: Compilation failure:
[ERROR] .../ConcurrentLongHashMap.java:[320,29] ';' expected
[ERROR] .../ConcurrentLongHashMap.java:[320,32] illegal start of type
Affected branches
branch-4.17 — broken (Java 8 target).
master — not affected (Java 17 target).
Proposed fix
Replace the record with an equivalent static final nested class exposing keys(), values() and capacity() accessors, preserving the existing call sites.
Description
Branch
branch-4.17fails to compile after commit 0e1bddd ([Fix] ConcurrentLongHashMap throw ArrayIndexOutOfBoundsException, #4771) was backported to it.The commit introduces a Java
recorddeclaration inConcurrentLongHashMap:The
recordkeyword requires Java 16+, but onbranch-4.17the rootpom.xmlsets:so the file fails to parse.
Build error
Affected branches
branch-4.17— broken (Java 8 target).master— not affected (Java 17 target).Proposed fix
Replace the record with an equivalent
static finalnested class exposingkeys(),values()andcapacity()accessors, preserving the existing call sites.