parent
a39da55d97
commit
3c898224ff
|
@ -9,10 +9,6 @@
|
|||
* IBM Corporation - initial API and implementation
|
||||
*****************************************************************************/
|
||||
public class Monitor2 {
|
||||
private static boolean randomIsolate() {
|
||||
return Math.random() > .5;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
public Monitor2() { }
|
||||
|
|
|
@ -75,8 +75,7 @@ private:
|
|||
jclass _jre;
|
||||
jmethodID _ctr;
|
||||
jmethodID _wrapper_ctr;
|
||||
jmethodID _message;
|
||||
|
||||
|
||||
public:
|
||||
Exceptions(JNIEnv *java_env, jmp_buf& c_env);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "jni.h"
|
||||
|
||||
extern "C" JNIEnv *launch(char *);
|
||||
extern "C" void kill();
|
||||
extern JNIEnv *launch(char *);
|
||||
extern void kill();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,6 @@ Exceptions::Exceptions(JNIEnv *java_env, jmp_buf& c_env) :
|
|||
{
|
||||
_jre = java_env->FindClass("java/lang/RuntimeException");
|
||||
_ctr = java_env->GetMethodID(_jre, "<init>", "(Ljava/lang/String;)V");
|
||||
_message = java_env->GetMethodID(_jre, "getMessage", "()Ljava/lang/String;");
|
||||
_wrapper_ctr =
|
||||
java_env->GetMethodID(_jre,
|
||||
"<init>",
|
||||
|
@ -28,13 +27,9 @@ void Exceptions::throwException(const char *file_name, int line_number) {
|
|||
jthrowable real_ex = _java_env->ExceptionOccurred();
|
||||
_java_env->ExceptionClear();
|
||||
|
||||
jstring message = (jstring)
|
||||
_java_env->CallObjectMethod(real_ex, _message);
|
||||
const char *m = _java_env->GetStringUTFChars(message, false);
|
||||
|
||||
char msg[strlen(file_name) + strlen(m) + 1024];
|
||||
char msg[strlen(file_name) + 1024];
|
||||
memset(msg, 0, strlen(file_name) + 1024);
|
||||
sprintf(msg, "exception at %s:%d: %s", file_name, line_number, m);
|
||||
sprintf(msg, "exception at %s:%d", file_name, line_number);
|
||||
jstring java_message = _java_env->NewStringUTF(msg);
|
||||
|
||||
jthrowable ex = (jthrowable)
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
#include <strings.h>
|
||||
#include "Exceptions.h"
|
||||
#include "CAstWrapper.h"
|
||||
#include "launch.h"
|
||||
|
||||
JavaVM *javaVM;
|
||||
|
||||
JNIEnv *launch(char *classpath) {
|
||||
JavaVMOption jvmopt[2];
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ Require-Bundle: com.ibm.wala.cast.java.test;bundle-version="1.0.0",
|
|||
org.eclipse.ui.ide,
|
||||
org.eclipse.ui.ide.application,
|
||||
org.eclipse.ant.launching,
|
||||
com.ibm.wala.cast.java.ecj,
|
||||
com.ibm.wala.shrike
|
||||
com.ibm.wala.cast.java.ecj
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.ibm.wala.cast.java.jdt.test,
|
||||
|
|
Loading…
Reference in New Issue