From 60b3ff5a58110af9d8f84707b398b056081bc64d Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 24 Oct 2024 02:12:53 +0200 Subject: [PATCH] Bugfix --- .../java/it/cavallium/rockserver/core/impl/EmbeddedDB.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java b/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java index de55477..a6e93cf 100644 --- a/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java +++ b/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java @@ -181,10 +181,11 @@ public class EmbeddedDB implements RocksDBSyncAPI, Closeable { var columnName = new String(column.cfh().getName(), StandardCharsets.UTF_8); long hashCode = columnName.hashCode(); long id; - if (this.columnNamesIndex.get(columnName) == hashCode) { + if (Objects.equals(this.columnNamesIndex.get(columnName), hashCode)) { id = hashCode; } else if (this.columns.get(hashCode) == null) { id = hashCode; + this.columns.put(id, column); } else { id = FastRandomUtils.allocateNewValue(this.columns, column, 1, Long.MAX_VALUE); }