Convert Class::descriptor_ from StringPiece to String (as part of image loading)
Change-Id: Iab5ffa353661a7c06ee79af1f40d399a53777174
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index 8e8ecd3..a55cdae 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -472,7 +472,7 @@
if (method == NULL || method->IsStatic() != is_static) {
Thread* self = Thread::Current();
- std::string class_name(c->GetDescriptor().ToString());
+ std::string class_name(c->GetDescriptor()->ToModifiedUtf8());
// TODO: try searching for the opposite kind of method from is_static
// for better diagnostics?
self->ThrowNewException("Ljava/lang/NoSuchMethodError;",
@@ -505,7 +505,7 @@
if (field == NULL) {
Thread* self = Thread::Current();
- std::string class_name(c->GetDescriptor().ToString());
+ std::string class_name(c->GetDescriptor()->ToModifiedUtf8());
self->ThrowNewException("Ljava/lang/NoSuchFieldError;",
"no \"%s\" field \"%s\" in class \"%s\" or its superclasses", sig,
name, class_name.c_str());
@@ -1768,7 +1768,7 @@
Class* element_class = Decode<Class*>(ts, element_jclass);
std::string descriptor;
descriptor += "[";
- descriptor += element_class->GetDescriptor().ToString();
+ descriptor += element_class->GetDescriptor()->ToModifiedUtf8();
// Find the class.
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
@@ -2003,7 +2003,7 @@
}
if (method == NULL) {
Thread* self = Thread::Current();
- std::string class_name = klass->GetDescriptor().ToString();
+ std::string class_name = klass->GetDescriptor()->ToModifiedUtf8();
// TODO: pretty print method names through a single routine
self->ThrowNewException("Ljava/lang/NoSuchMethodError;",
"no method \"%s.%s%s\"",
@@ -2011,7 +2011,7 @@
return JNI_ERR;
} else if (!method->IsNative()) {
Thread* self = Thread::Current();
- std::string class_name = klass->GetDescriptor().ToString();
+ std::string class_name = klass->GetDescriptor()->ToModifiedUtf8();
// TODO: pretty print method names through a single routine
self->ThrowNewException("Ljava/lang/NoSuchMethodError;",
"method \"%s.%s%s\" is not native",