Skip to content

Commit

Permalink
[Java] add missing JNI exception checks to fix warnings (#2405)
Browse files Browse the repository at this point in the history
* add missing JNI exception checks to fix warnings

* updated based on comments

* removed rethrow logic

* replace tabs with spaces
  • Loading branch information
imatiach-msft authored and guolinke committed Sep 26, 2019
1 parent a0a117a commit 7b2963d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions swig/lightgbmlib.i
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@

// get the size, indices and values
auto indices = (jintArray)jenv->CallObjectMethod(objSparseVec, sparseVectorIndices);
if (jenv->ExceptionCheck()) {
return -1;
}
auto values = (jdoubleArray)jenv->CallObjectMethod(objSparseVec, sparseVectorValues);
if (jenv->ExceptionCheck()) {
return -1;
}
int size = jenv->GetArrayLength(indices);

// Note: when testing on larger data (e.g. 288k rows per partition and 36mio rows total)
Expand Down

0 comments on commit 7b2963d

Please sign in to comment.