From 4092851e56b0954ce0fa29a20a6f18de1d911578 Mon Sep 17 00:00:00 2001 From: Samuel Freilich Date: Fri, 22 May 2026 07:02:52 -0700 Subject: [PATCH] Rename a variable for consistency PiperOrigin-RevId: 919656752 --- ink/jni/internal/status_native.cc | 48 ++++++++++++++----------------- ink/jni/internal/status_native.h | 14 ++++----- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/ink/jni/internal/status_native.cc b/ink/jni/internal/status_native.cc index 5262048e..60e8c94d 100644 --- a/ink/jni/internal/status_native.cc +++ b/ink/jni/internal/status_native.cc @@ -18,13 +18,13 @@ namespace { -void ThrowExceptionFromStatus( - void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), - absl::Status status) { - throw_exception_from_status_callback(jni_env_pass_through, - static_cast(status.code()), - status.ToString().c_str()); +void ThrowExceptionFromStatus(void* jni_env_pass_through, + void (*throw_from_status_callback)(void*, int, + const char*), + absl::Status status) { + throw_from_status_callback(jni_env_pass_through, + static_cast(status.code()), + status.ToString().c_str()); } } // namespace @@ -57,63 +57,57 @@ int StatusNative_statusCodeUnimplemented() { void StatusNative_throwExceptionFromOkStatusForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*)) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + void (*throw_from_status_callback)(void*, int, const char*)) { + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::OkStatus()); } void StatusNative_throwExceptionFromFailedPreconditionForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::FailedPreconditionError(message)); } void StatusNative_throwExceptionFromInvalidArgumentForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::InvalidArgumentError(message)); } void StatusNative_throwExceptionFromNotFoundForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::NotFoundError(message)); } void StatusNative_throwExceptionFromOutOfRangeForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::OutOfRangeError(message)); } void StatusNative_throwExceptionFromUnimplementedForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message) { - ThrowExceptionFromStatus(jni_env_pass_through, - throw_exception_from_status_callback, + ThrowExceptionFromStatus(jni_env_pass_through, throw_from_status_callback, absl::UnimplementedError(message)); } void StatusNative_throwExceptionFromUnknownStatusCodeForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), int status_code, const char* message) { ThrowExceptionFromStatus( - jni_env_pass_through, throw_exception_from_status_callback, + jni_env_pass_through, throw_from_status_callback, absl::Status(absl::StatusCode(status_code), message)); } diff --git a/ink/jni/internal/status_native.h b/ink/jni/internal/status_native.h index dea31e9a..ad5f7409 100644 --- a/ink/jni/internal/status_native.h +++ b/ink/jni/internal/status_native.h @@ -33,36 +33,36 @@ int StatusNative_statusCodeUnimplemented(); void StatusNative_throwExceptionFromOkStatusForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*)); + void (*throw_from_status_callback)(void*, int, const char*)); void StatusNative_throwExceptionFromFailedPreconditionForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message); void StatusNative_throwExceptionFromInvalidArgumentForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message); void StatusNative_throwExceptionFromNotFoundForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message); void StatusNative_throwExceptionFromOutOfRangeForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message); void StatusNative_throwExceptionFromUnimplementedForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), const char* message); void StatusNative_throwExceptionFromUnknownStatusCodeForTesting( void* jni_env_pass_through, - void (*throw_exception_from_status_callback)(void*, int, const char*), + void (*throw_from_status_callback)(void*, int, const char*), int status_code, const char* message); #ifdef __cplusplus