Adding JNI code for dalvik.system.DexFile and java.lang.Class
Change-Id: I079c037db77aeaca0dec06660f7551f57adf2607
diff --git a/src/common_test.h b/src/common_test.h
index 844fa00..b56090b 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -241,15 +241,6 @@
return class_loader;
}
- std::string ConvertClassNameToClassDescriptor(const char* class_name) {
- std::string desc;
- desc += "L";
- desc += class_name;
- desc += ";";
- std::replace(desc.begin(), desc.end(), '.', '/');
- return desc;
- }
-
void CompileMethod(Method* method) {
CHECK(method != NULL);
compiler_->CompileOne(method);
@@ -262,7 +253,7 @@
const char* class_name,
const char* method_name,
const char* signature) {
- std::string class_descriptor = ConvertClassNameToClassDescriptor(class_name);
+ std::string class_descriptor = DotToDescriptor(class_name);
Class* klass = class_linker_->FindClass(class_descriptor, class_loader);
CHECK(klass != NULL) << "Class not found " << class_name;
Method* method = klass->FindDirectMethod(method_name, signature);
@@ -275,7 +266,7 @@
const char* class_name,
const char* method_name,
const char* signature) {
- std::string class_descriptor = ConvertClassNameToClassDescriptor(class_name);
+ std::string class_descriptor = DotToDescriptor(class_name);
Class* klass = class_linker_->FindClass(class_descriptor, class_loader);
CHECK(klass != NULL) << "Class not found " << class_name;
Method* method = klass->FindVirtualMethod(method_name, signature);