diff options
author | Don Anderson <dda@mongodb.com> | 2017-03-28 20:08:23 -0400 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2017-03-29 11:08:23 +1100 |
commit | d5a10d2e97853e7db6bb4c2635b97febf13607c5 (patch) | |
tree | e75de7ac2cd26cb56d19b06400bf0ac197bf68f0 /lang | |
parent | a5b3166ab7bcdb365b60686246b8e5624efeca84 (diff) | |
download | mongo-d5a10d2e97853e7db6bb4c2635b97febf13607c5.tar.gz |
WT-3238 Java: Fix Cursor.compare and Cursor.equals to return int values. (#3355)
Non-zero int values for these functions should not raise exceptions.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/java/Makefile.am | 1 | ||||
-rw-r--r-- | lang/java/wiredtiger.i | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lang/java/Makefile.am b/lang/java/Makefile.am index 7184fe610dc..2ff822a5d08 100644 --- a/lang/java/Makefile.am +++ b/lang/java/Makefile.am @@ -49,6 +49,7 @@ JAVA_JUNIT = \ $(JAVATEST)/ConcurrentCloseTest.java \ $(JAVATEST)/CursorTest.java \ $(JAVATEST)/CursorTest02.java \ + $(JAVATEST)/CursorTest03.java \ $(JAVATEST)/ExceptionTest.java \ $(JAVATEST)/PackTest.java \ $(JAVATEST)/PackTest02.java \ diff --git a/lang/java/wiredtiger.i b/lang/java/wiredtiger.i index efc512f2f5a..275b708090c 100644 --- a/lang/java/wiredtiger.i +++ b/lang/java/wiredtiger.i @@ -319,6 +319,15 @@ WT_CLASS(struct __wt_async_op, WT_ASYNC_OP, op) %rename (getValueFormat) __wt_async_op::getValue_format; %rename (getType) __wt_async_op::get_type; +/* + * Special cases: override the out typemap, return checking is done in the + * wrapper. + */ +%typemap(out) int __wt_cursor::compare_wrap, + int __wt_cursor::equals_wrap %{ + $result = $1; +%} + /* SWIG magic to turn Java byte strings into data / size. */ %apply (char *STRING, int LENGTH) { (char *data, int size) }; @@ -529,7 +538,6 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler}; %} %extend __wt_async_op { - %javamethodmodifiers get_key_wrap "protected"; WT_ITEM get_key_wrap(JNIEnv *jenv) { WT_ITEM k; |