From 94f70a86b9dc9b1a8beade56faa12d2c695cb81c Mon Sep 17 00:00:00 2001 From: fyrz Date: Sun, 16 Nov 2014 18:23:06 +0100 Subject: [PATCH] [RocksJava] Incoroporated changes for D29013 --- java/org/rocksdb/ColumnFamilyOptions.java | 5 ++++- java/org/rocksdb/Options.java | 5 ++++- java/org/rocksdb/test/MergeTest.java | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/java/org/rocksdb/ColumnFamilyOptions.java b/java/org/rocksdb/ColumnFamilyOptions.java index 86e42bf7d..898a6cb45 100644 --- a/java/org/rocksdb/ColumnFamilyOptions.java +++ b/java/org/rocksdb/ColumnFamilyOptions.java @@ -128,7 +128,10 @@ public class ColumnFamilyOptions extends RocksObject @Override public ColumnFamilyOptions setMergeOperatorName(String name) { assert (isInitialized()); - assert (name != null); + if (name == null) { + throw new IllegalArgumentException( + "Merge operator name must not be null."); + } setMergeOperatorName(nativeHandle_, name); return this; } diff --git a/java/org/rocksdb/Options.java b/java/org/rocksdb/Options.java index 68a11e633..7781b80a6 100644 --- a/java/org/rocksdb/Options.java +++ b/java/org/rocksdb/Options.java @@ -166,7 +166,10 @@ public class Options extends RocksObject @Override public Options setMergeOperatorName(String name) { assert (isInitialized()); - assert (name != null); + if (name == null) { + throw new IllegalArgumentException( + "Merge operator name must not be null."); + } setMergeOperatorName(nativeHandle_, name); return this; } diff --git a/java/org/rocksdb/test/MergeTest.java b/java/org/rocksdb/test/MergeTest.java index 3dacb3923..f90b0b0c1 100644 --- a/java/org/rocksdb/test/MergeTest.java +++ b/java/org/rocksdb/test/MergeTest.java @@ -273,7 +273,7 @@ public class MergeTest { } } - @Test(expected = AssertionError.class) + @Test(expected = IllegalArgumentException.class) public void nullStringInSetMergeOperatorByNameOptions() { Options opt = null; try { @@ -286,7 +286,7 @@ public class MergeTest { } } - @Test(expected = AssertionError.class) + @Test(expected = IllegalArgumentException.class) public void nullStringInSetMergeOperatorByNameColumnFamilyOptions() { ColumnFamilyOptions opt = null;