Revert "Add basic checks for redefinition."
Test fails.
This reverts commit 10f02fb4f026c493c69b21d4ec7c3096970357e1.
Change-Id: I21abfff0d7cd4ec840447f19819b7859b90f45b2
diff --git a/test/ti-agent/common_helper.cc b/test/ti-agent/common_helper.cc
index 01b6c98..ebf1e46 100644
--- a/test/ti-agent/common_helper.cc
+++ b/test/ti-agent/common_helper.cc
@@ -17,7 +17,6 @@
#include "ti-agent/common_helper.h"
#include <stdio.h>
-#include <sstream>
#include "art_method.h"
#include "jni.h"
@@ -42,24 +41,8 @@
namespace common_redefine {
-static void throwRedefinitionError(jvmtiEnv* jvmti, JNIEnv* env, jclass target, jvmtiError res) {
- std::stringstream err;
- char* signature = nullptr;
- char* generic = nullptr;
- jvmti->GetClassSignature(target, &signature, &generic);
- char* error = nullptr;
- jvmti->GetErrorName(res, &error);
- err << "Failed to redefine class <" << signature << "> due to " << error;
- std::string message = err.str();
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(signature));
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(generic));
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(error));
- env->ThrowNew(env->FindClass("java/lang/Exception"), message.c_str());
-}
-
using RedefineDirectFunction = jvmtiError (*)(jvmtiEnv*, jclass, jint, const unsigned char*);
-static void DoClassTransformation(jvmtiEnv* jvmti_env,
- JNIEnv* env,
+static void DoClassTransformation(jvmtiEnv* jvmti_env, JNIEnv* env,
jclass target,
jbyteArray class_file_bytes,
jbyteArray dex_file_bytes) {
@@ -80,7 +63,7 @@
res = f(jvmti_env, target, len, redef_bytes);
}
if (res != JVMTI_ERROR_NONE) {
- throwRedefinitionError(jvmti_env, env, target, res);
+ printf("Redefinition failed!");
}
}