6733995: legal notice repair on langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
Reviewed-by: ksrini
/* * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. *//* * Copyright 2003 Wily Technology, Inc. */#ifndef _JAVAEXCEPTIONS_H_#define _JAVAEXCEPTIONS_H_#include <jni.h>#include <jvmti.h>/** * This module contains utility routines for manipulating Java throwables * and JNIEnv throwable state from native code. */#ifdef __cplusplusextern "C" {#endif/* * Set up static state. Needs java, must be called at or after VMInit. * Returns true if it succeeds, false if it fails. */extern jbooleaninitializeFallbackError(JNIEnv* jnienv);/* * Mapping support. Allows different clients to map checked exceptions in different ways. */typedef jthrowable (*CheckedExceptionMapper) ( JNIEnv * jnienv, jthrowable throwableToMap);/* Default mapper. Map everything checked to InternalError; can return null if error */extern jthrowablemapAllCheckedToInternalErrorMapper( JNIEnv * jnienv, jthrowable throwableToMap);/* * Exception-helper routines that do not modify the JNIEnv. * They require a clean JNIEnv on entry, and they guarantee a clean JNIEnv on exit. *//* creates a throwable from the supplied parameters; can return null if error */extern jthrowablecreateThrowable( JNIEnv* jnienv, const char* className, jstring message);/* creates a java.lang.InternalError; can return null if error */extern jthrowablecreateInternalError(JNIEnv * jnienv, jstring message);/* creates the appropriate java Throwable based on the error code; can return null if error */extern jthrowablecreateThrowableFromJVMTIErrorCode(JNIEnv * jnienv, jvmtiError errorCode);/* fetches the message string out of the supplied throwable, null if there is none, null if error */extern jstringgetMessageFromThrowable( JNIEnv* jnienv, jthrowable exception);/* true if the supplied throwable is unchecked. null will return true. */extern jbooleanisUnchecked( JNIEnv* jnienv, jthrowable exception);/* true if the env contains a thrown exception */extern jbooleancheckForThrowable( JNIEnv* jnienv);/* true if the env is clean for JNI calls */extern jbooleanisSafeForJNICalls( JNIEnv * jnienv);/* * Logs the outstanding throwable, if one exists. * This call assumes an outstanding exception, but does not * modify the JNIEnv outstanding Throwable state. */extern voidlogThrowable( JNIEnv * jnienv);/* * These routines do modify the JNIEnv outstanding Throwable state. *//* Throws the supplied throwable. always sets the JNIEnv throwable */extern voidthrowThrowable( JNIEnv * jnienv, jthrowable exception);/* returns current throwable. always clears the JNIEnv exception */extern jthrowablepreserveThrowable(JNIEnv * jnienv);/* undoes preserveThrowable (Throws the supplied throwable). always sets the JNIEnv throwable */extern voidrestoreThrowable( JNIEnv * jnienv, jthrowable preservedException);/* always clears the JNIEnv throwable. returns true if an exception was pending on entry. */extern jbooleancheckForAndClearThrowable( JNIEnv * jnienv);/* creates the appropriate java Throwable based on the error code * does the very best it can to make sure an exception ends up installed; uses fallback if necessary * always sets the JNIEnv exception */extern voidcreateAndThrowThrowableFromJVMTIErrorCode(JNIEnv * jnienv, jvmtiError errorCode);/* creates a java.lang.InternalError and installs it into the JNIEnv. * does the very best it can to make sure an exception ends up installed; uses fallback if necessary * always sets the JNIEnv exception */extern voidcreateAndThrowInternalError(JNIEnv * jnienv);/* If no throwable is outstanding, do nothing. * If a throwable is outstanding, make sure it is of a legal type according to the supplied * mapping function. * Leaves the "thrown" state the same (none on exit if none on entry, thrown on exit if * thrown on entry); may change the type of the thrown exception. */extern voidmapThrownThrowableIfNecessary(JNIEnv * jnienv, CheckedExceptionMapper mapper);#ifdef __cplusplus} /* extern "C" */#endif /* __cplusplus */#endif