Skip to content

Commit 98269c8

Browse files
committed
Use Java 8-compatible map init in ConfigView
The merge brought in the JDK 8 CI build job, which flagged Map.of() (Java 9+) in ConfigView's RELOCATED_HINTS. Replace it with a static initializer over a HashMap wrapped in Collections.unmodifiableMap so the source compiles under JDK 8.
1 parent cc5f519 commit 98269c8

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

core/src/main/java/io/questdb/client/impl/ConfigView.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import io.questdb.client.std.NumericException;
2929
import io.questdb.client.std.ObjList;
3030

31+
import java.util.Collections;
32+
import java.util.HashMap;
3133
import java.util.HashSet;
3234
import java.util.Map;
3335

@@ -51,16 +53,20 @@ public final class ConfigView {
5153
* Keys that live in the legacy http/tcp/udp vocabulary. On a {@code ws}/
5254
* {@code wss} string they reject with a hint pointing at the right place.
5355
*/
54-
private static final Map<String, String> RELOCATED_HINTS = Map.of(
55-
"retry_timeout", "(use reconnect_max_duration_millis on ws/wss)",
56-
"protocol_version", "(QWP negotiates the protocol version during the WebSocket upgrade)",
57-
"init_buf_size", "(applies to legacy http/tcp/udp transports only)",
58-
"max_buf_size", "(applies to legacy http/tcp/udp transports only)",
59-
"request_timeout", "(applies to legacy http/tcp/udp transports only)",
60-
"request_min_throughput", "(applies to legacy http/tcp/udp transports only)",
61-
"max_datagram_size", "(applies to legacy http/tcp/udp transports only)",
62-
"multicast_ttl", "(applies to legacy http/tcp/udp transports only)"
63-
);
56+
private static final Map<String, String> RELOCATED_HINTS;
57+
58+
static {
59+
Map<String, String> hints = new HashMap<>();
60+
hints.put("retry_timeout", "(use reconnect_max_duration_millis on ws/wss)");
61+
hints.put("protocol_version", "(QWP negotiates the protocol version during the WebSocket upgrade)");
62+
hints.put("init_buf_size", "(applies to legacy http/tcp/udp transports only)");
63+
hints.put("max_buf_size", "(applies to legacy http/tcp/udp transports only)");
64+
hints.put("request_timeout", "(applies to legacy http/tcp/udp transports only)");
65+
hints.put("request_min_throughput", "(applies to legacy http/tcp/udp transports only)");
66+
hints.put("max_datagram_size", "(applies to legacy http/tcp/udp transports only)");
67+
hints.put("multicast_ttl", "(applies to legacy http/tcp/udp transports only)");
68+
RELOCATED_HINTS = Collections.unmodifiableMap(hints);
69+
}
6470

6571
private final ObjList<String> normKeys = new ObjList<>();
6672
private final ObjList<String> normValues = new ObjList<>();

0 commit comments

Comments
 (0)