< prev index next >

src/java.base/share/native/libjava/jni_util.h

Print this page
rev 14890 : 8158023: SocketExceptions contain too little information sometimes
   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  80 JNU_ThrowNoSuchMethodException(JNIEnv *env, const char *msg);
  81 
  82 JNIEXPORT void JNICALL
  83 JNU_ThrowClassNotFoundException(JNIEnv *env, const char *msg);
  84 
  85 JNIEXPORT void JNICALL
  86 JNU_ThrowNumberFormatException(JNIEnv *env, const char *msg);
  87 
  88 JNIEXPORT void JNICALL
  89 JNU_ThrowNoSuchFieldError(JNIEnv *env, const char *msg);
  90 
  91 JNIEXPORT void JNICALL
  92 JNU_ThrowNoSuchMethodError(JNIEnv *env, const char *msg);
  93 
  94 JNIEXPORT void JNICALL
  95 JNU_ThrowStringIndexOutOfBoundsException(JNIEnv *env, const char *msg);
  96 
  97 JNIEXPORT void JNICALL
  98 JNU_ThrowInstantiationException(JNIEnv *env, const char *msg);
  99 
 100 /* Throw an exception by name, using the string returned by
 101  * JVM_LastErrorString for the detail string.  If the last-error

 102  * string is NULL, use the given default detail string.
 103  */
 104 JNIEXPORT void JNICALL
 105 JNU_ThrowByNameWithLastError(JNIEnv *env, const char *name,
 106                              const char *defaultMessage);








 107 
 108 /* Throw an IOException, using the last-error string for the detail
 109  * string.  If the last-error string is NULL, use the given default
 110  * detail string.
 111  */
 112 JNIEXPORT void JNICALL
 113 JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail);
 114 
 115 /* Convert between Java strings and i18n C strings */
 116 JNIEXPORT jstring
 117 NewStringPlatform(JNIEnv *env, const char *str);
 118 
 119 JNIEXPORT const char *
 120 GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
 121 
 122 JNIEXPORT jstring JNICALL
 123 JNU_NewStringPlatform(JNIEnv *env, const char *str);
 124 
 125 JNIEXPORT const char * JNICALL
 126 JNU_GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
 127 
 128 JNIEXPORT void JNICALL
 129 JNU_ReleaseStringPlatformChars(JNIEnv *env, jstring jstr, const char *str);
 130 


   1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  80 JNU_ThrowNoSuchMethodException(JNIEnv *env, const char *msg);
  81 
  82 JNIEXPORT void JNICALL
  83 JNU_ThrowClassNotFoundException(JNIEnv *env, const char *msg);
  84 
  85 JNIEXPORT void JNICALL
  86 JNU_ThrowNumberFormatException(JNIEnv *env, const char *msg);
  87 
  88 JNIEXPORT void JNICALL
  89 JNU_ThrowNoSuchFieldError(JNIEnv *env, const char *msg);
  90 
  91 JNIEXPORT void JNICALL
  92 JNU_ThrowNoSuchMethodError(JNIEnv *env, const char *msg);
  93 
  94 JNIEXPORT void JNICALL
  95 JNU_ThrowStringIndexOutOfBoundsException(JNIEnv *env, const char *msg);
  96 
  97 JNIEXPORT void JNICALL
  98 JNU_ThrowInstantiationException(JNIEnv *env, const char *msg);
  99 
 100 /*
 101  * Throw an exception by name, using the string returned by
 102  * getLastErrorString for the detail string. If the last-error
 103  * string is NULL, use the given default detail string.
 104  */
 105 JNIEXPORT void JNICALL
 106 JNU_ThrowByNameWithLastError(JNIEnv *env, const char *name,
 107                              const char *defaultDetail);
 108 
 109 /*
 110  * Throw an exception by name, using a given message and the string
 111  * returned by getLastErrorString to construct the detail string.
 112  */
 113 JNIEXPORT void JNICALL
 114 JNU_ThrowByNameWithMessageAndLastError
 115   (JNIEnv *env, const char *name, const char *message);
 116 
 117 /*
 118  * Convenience method.
 119  * Call JNU_ThrowByNameWithLastError for java.io.IOException.
 120  */
 121 JNIEXPORT void JNICALL
 122 JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail);
 123 
 124 /* Convert between Java strings and i18n C strings */
 125 JNIEXPORT jstring
 126 NewStringPlatform(JNIEnv *env, const char *str);
 127 
 128 JNIEXPORT const char *
 129 GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
 130 
 131 JNIEXPORT jstring JNICALL
 132 JNU_NewStringPlatform(JNIEnv *env, const char *str);
 133 
 134 JNIEXPORT const char * JNICALL
 135 JNU_GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
 136 
 137 JNIEXPORT void JNICALL
 138 JNU_ReleaseStringPlatformChars(JNIEnv *env, jstring jstr, const char *str);
 139 


< prev index next >