Skip to content

Commit

Permalink
Remove unused exception parameter from fbandroid/libraries/fbjni/test…
Browse files Browse the repository at this point in the history
…/jni/inter_dso_exception_test_2/Test.cpp

Summary:
`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.

This:
```
try {
    ...
} catch (exception& e) {
    // no use of e
}
```
should instead be written as
```
} catch (exception&) {
```

If the code compiles, this is safe to land.

Reviewed By: dmm-fb

Differential Revision: D60515202

fbshipit-source-id: 9e1552ed8a7dc2530d3efbf457ed9abcc16434a1
  • Loading branch information
r-barnes authored and facebook-github-bot committed Aug 2, 2024
1 parent 4ec7ce4 commit 95a6972
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/jni/inter_dso_exception_test_2/Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool inter_dso_exception_test_2b() {
try {
inter_dso_exception_test_1();
return false;
} catch (const facebook::jni::JniException& ex) {
} catch (const facebook::jni::JniException&) {
return true;
} catch (...) {
return false;
Expand Down
8 changes: 4 additions & 4 deletions test/jni/primitive_array_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,27 @@ jboolean testIndexOutOfBoundsInRegions(alias_ref<jclass>) {
try {
auto buf = array->getRegion(TOO_MUCH, N);
EXPECT(false);
} catch (JniException& ex) {
} catch (JniException&) {
}

try {
auto buf = array->getRegion(NEGATIVE, N);
EXPECT(false);
} catch (JniException& ex) {
} catch (JniException&) {
}

try {
auto vec = std::vector<jint>(TOO_MUCH);
array->setRegion(0, vec.size(), vec.data());
EXPECT(false);
} catch (JniException& ex) {
} catch (JniException&) {
}

try {
auto vec = std::vector<jint>(1);
array->setRegion(NEGATIVE, vec.size(), vec.data());
EXPECT(false);
} catch (JniException& ex) {
} catch (JniException&) {
}

return JNI_TRUE;
Expand Down

0 comments on commit 95a6972

Please sign in to comment.