提交 94f70a86 编写于 作者: F fyrz

[RocksJava] Incoroporated changes for D29013

上级 a280af2a
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册