• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-Nov-2021-

ExceptionCheckingJniEnv.cppH A D03-Nov-202116.6 KiB472347

ExceptionCheckingJniEnv.hppH A D03-Nov-20216.4 KiB16686

JNIreferences.cppH A D03-Nov-20216.6 KiB214141

READMEH A D03-Nov-20212.1 KiB6345

jni_tools.cppH A D03-Nov-20215.1 KiB201135

jni_tools.hH A D03-Nov-20215.3 KiB17143

libJNIreferences.cppH A D03-Nov-20211.1 KiB262

README

1Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
4This code is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License version 2 only, as
6published by the Free Software Foundation.
7
8This code is distributed in the hope that it will be useful, but WITHOUT
9ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11version 2 for more details (a copy is included in the LICENSE file that
12accompanied this code).
13
14You should have received a copy of the GNU General Public License version
152 along with this work; if not, write to the Free Software Foundation,
16Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
18Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19or visit www.oracle.com if you need additional information or have any
20questions.
21
22---------------------------------------------------------------------------------
23
24This directory contains source files of testbase_nsk JNI framework,
25which provides support for JNI tests and accessing JNI environment.
26
27    Source files:
28        jni_tools.h
29        jni_tools.c
30
31    Naming conventions:
32        macroses:  NSK_JNI_*
33        functions: nsk_JNI_*
34
35---------------------------------------------------------------------------------
36
37jni_tools.h
38
39Provides functions and macroses for invocation of JNI functions
40and checking JNI errors and pending exceptions:
41
42    NSK_JNI_VERIFY(jni, action)
43    NSK_JNI_VERIFY_NEGATIVE(jni, action)
44
45Typical example of usage of the NSK_JNI_VERIFY macro
46for invokation of JNI functions:
47
48    // jni->FindClass(jni, class_name)
49    if (!NSK_JNI_VERIFY(jni,
50            jni->FindClass(class_name) != NULL)) {
51        return JNI_ERR;
52    }
53
54or with saving obtained data:
55
56    // cls = jni->FindClass(jni, class_name)
57    if (!NSK_JNI_VERIFY(jni, (cls =
58            jni->FindClass(class_name)) != NULL)) {
59        return JNI_ERR;
60    }
61
62---------------------------------------------------------------------------------
63