< prev index next >

test/hotspot/jtreg/runtime/jni/registerNativesWarning/libregisterNativesWarning.c

Print this page
*** 25,11 ***
  
  #include "jni.h"
  
  /*
   * We will replace:
!  *   java/lang/Thread.java:    public static native void yield();
   *
   * as it is simple and innocuous.
   */
  static void myYield(JNIEnv* env, jclass cls) {
    printf("myYield executed\n");
--- 25,11 ---
  
  #include "jni.h"
  
  /*
   * We will replace:
!  *   java/lang/Thread.java:    private static native void yield0();
   *
   * as it is simple and innocuous.
   */
  static void myYield(JNIEnv* env, jclass cls) {
    printf("myYield executed\n");

*** 39,11 ***
  JNIEXPORT void JNICALL
  Java_TestRegisterNativesWarning_test
  (JNIEnv *env, jclass cls, jclass jlThread) {
    JNINativeMethod nativeMethods[] = {
      {
!       (char*) "yield",  // name
        (char*) "()V",    // sig
        (void*) myYield   // native method ptr
      }
    };
    (*env)->RegisterNatives(env, jlThread, nativeMethods, 1);
--- 39,11 ---
  JNIEXPORT void JNICALL
  Java_TestRegisterNativesWarning_test
  (JNIEnv *env, jclass cls, jclass jlThread) {
    JNINativeMethod nativeMethods[] = {
      {
!       (char*) "yield0", // name
        (char*) "()V",    // sig
        (void*) myYield   // native method ptr
      }
    };
    (*env)->RegisterNatives(env, jlThread, nativeMethods, 1);
< prev index next >