From 4947a0674f67cc32d5262deb2c398acf6e3eb2ff Mon Sep 17 00:00:00 2001 From: fyrz Date: Sat, 15 Nov 2014 00:14:36 +0100 Subject: [PATCH] [RocksJava] Incorporated review comments D28947 --- java/org/rocksdb/InfoLogLevel.java | 5 ++++- java/org/rocksdb/Options.java | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java/org/rocksdb/InfoLogLevel.java b/java/org/rocksdb/InfoLogLevel.java index 0a4a0e6ea..e67063c68 100644 --- a/java/org/rocksdb/InfoLogLevel.java +++ b/java/org/rocksdb/InfoLogLevel.java @@ -32,6 +32,8 @@ public enum InfoLogLevel { * @param value byte representation of InfoLogLevel. * * @return {@link org.rocksdb.InfoLogLevel} instance or null. + * @throws java.lang.IllegalArgumentException if an invalid + * value is provided. */ public static InfoLogLevel getInfoLogLevel(byte value) { for (InfoLogLevel infoLogLevel : InfoLogLevel.values()) { @@ -39,6 +41,7 @@ public enum InfoLogLevel { return infoLogLevel; } } - return null; + throw new IllegalArgumentException( + "Illegal value provided for InfoLogLevel."); } } diff --git a/java/org/rocksdb/Options.java b/java/org/rocksdb/Options.java index 0d2a79698..55f3defd2 100644 --- a/java/org/rocksdb/Options.java +++ b/java/org/rocksdb/Options.java @@ -604,7 +604,6 @@ public class Options extends RocksObject @Override public Options setMemTableConfig(MemTableConfig config) throws RocksDBException { - assert(isInitialized()); memTableConfig_ = config; setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle()); return this; @@ -612,7 +611,6 @@ public class Options extends RocksObject @Override public Options setRateLimiterConfig(RateLimiterConfig config) { - assert(isInitialized()); rateLimiterConfig_ = config; setRateLimiter(nativeHandle_, config.newRateLimiterHandle()); return this;