Revert changes to native code for now

This reverts commit a39da55d97.
This commit is contained in:
Julian Dolby 2017-09-16 14:23:00 -04:00
parent a39da55d97
commit 3c898224ff
6 changed files with 7 additions and 18 deletions

View File

@ -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() { }

View File

@ -75,8 +75,7 @@ private:
jclass _jre;
jmethodID _ctr;
jmethodID _wrapper_ctr;
jmethodID _message;
public:
Exceptions(JNIEnv *java_env, jmp_buf& c_env);

View File

@ -3,7 +3,7 @@
#include "jni.h"
extern "C" JNIEnv *launch(char *);
extern "C" void kill();
extern JNIEnv *launch(char *);
extern void kill();
#endif

View File

@ -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)

View File

@ -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];

View File

@ -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,