Copilot commented on code in PR #13560:
URL: https://github.com/apache/gluten/pull/13560#discussion_r4537292045
##########
cpp/core/jni/JniError.h:
##########
@@ -28,11 +28,17 @@
#endif
#ifndef JNI_METHOD_END
-#define JNI_METHOD_END(fallback_expr)
\
- }
\
- catch (std::exception & e) {
\
- env->ThrowNew(gluten::getJniErrorState()->glutenExceptionClass(),
e.what()); \
- return fallback_expr;
\
+#define JNI_METHOD_END(fallback_expr)
\
+ }
\
+ catch (const gluten::JavaException& e) {
\
+ e.throwToJava(env);
\
+ return fallback_expr;
\
+ }
\
+ catch (std::exception & e) {
\
+ if (!env->ExceptionCheck() &&
!gluten::JavaException::throwNestedToJava(env, e)) { \
+ env->ThrowNew(gluten::getJniErrorState()->glutenExceptionClass(),
e.what()); \
+ }
\
+ return fallback_expr;
\
}
Review Comment:
`JNI_METHOD_END` now references `gluten::JavaException`, but this header
diff doesn’t show any include (or forward declaration) that guarantees
`JavaException` is known here. This can break compilation for translation units
that include `JniError.h` without also including `JavaException.h` first. Fix
by including the `JavaException` header from `JniError.h` (or adding an
appropriate forward declaration + moving any required definitions so the static
call is visible).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]