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;