From 95a6972e70c2976f6447643f06e1e9742aa5ff5b Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 2 Aug 2024 14:20:17 -0700 Subject: [PATCH] Remove unused exception parameter from fbandroid/libraries/fbjni/test/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 --- test/jni/inter_dso_exception_test_2/Test.cpp | 2 +- test/jni/primitive_array_tests.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/jni/inter_dso_exception_test_2/Test.cpp b/test/jni/inter_dso_exception_test_2/Test.cpp index 55551ee..0d613d8 100644 --- a/test/jni/inter_dso_exception_test_2/Test.cpp +++ b/test/jni/inter_dso_exception_test_2/Test.cpp @@ -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; diff --git a/test/jni/primitive_array_tests.cpp b/test/jni/primitive_array_tests.cpp index ad3139e..f0116b6 100644 --- a/test/jni/primitive_array_tests.cpp +++ b/test/jni/primitive_array_tests.cpp @@ -182,27 +182,27 @@ jboolean testIndexOutOfBoundsInRegions(alias_ref) { 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(TOO_MUCH); array->setRegion(0, vec.size(), vec.data()); EXPECT(false); - } catch (JniException& ex) { + } catch (JniException&) { } try { auto vec = std::vector(1); array->setRegion(NEGATIVE, vec.size(), vec.data()); EXPECT(false); - } catch (JniException& ex) { + } catch (JniException&) { } return JNI_TRUE;