--- old/src/share/native/common/jni_util.h 2014-02-11 15:41:42.000000000 -0800 +++ new/src/share/native/common/jni_util.h 2014-02-11 15:41:42.000000000 -0800 @@ -278,6 +278,38 @@ #define IS_NULL(obj) ((obj) == NULL) #define JNU_IsNull(env,obj) ((obj) == NULL) +/************************************************************************ + * Miscellaneous utilities used by the class libraries to return from + * a function if a value is NULL or an exception is pending. + */ + +#define CHECK_NULL(x) \ + do { \ + if ((x) == NULL) { \ + return; \ + } \ + } while (0) \ + +#define CHECK_NULL_RETURN(x, y) \ + do { \ + if ((x) == NULL) { \ + return (y); \ + } \ + } while (0) \ + +#define JNU_CHECK_EXCEPTION(env) \ + do { \ + if ((*env)->ExceptionCheck(env)) { \ + return; \ + } \ + } while (0) \ + +#define JNU_CHECK_EXCEPTION_RETURN(env, y) \ + do { \ + if ((*env)->ExceptionCheck(env)) { \ + return (y); \ + } \ + } while (0) /************************************************************************ * Debugging utilities