eolivelli opened a new issue, #4777:
URL: https://github.com/apache/bookkeeper/issues/4777
### Description
Branch `branch-4.17` fails to compile after commit 0e1bddd7e5 ([Fix]
ConcurrentLongHashMap throw ArrayIndexOutOfBoundsException, #4771) was
backported to it.
The commit introduces a Java `record` declaration in `ConcurrentLongHashMap`:
```java
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:
```xml
<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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]