Fix error in PrettyType.
PrettyType was incorrectly adding a space at the end of the type.
Also added a brief comment explaining what pretty type does.
Change-Id: Ia8b6f583a44d86a8c0db5efcd9ad495b686995d3
diff --git a/src/utils.cc b/src/utils.cc
index d038f6d..4efb177 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -279,10 +279,7 @@
std::string PrettyType(uint32_t type_idx, const DexFile& dex_file) {
const DexFile::TypeId& type_id = dex_file.GetTypeId(type_idx);
- std::string result;
- result += PrettyDescriptor(dex_file.GetTypeDescriptor(type_id));
- result += ' ';
- return result;
+ return PrettyDescriptor(dex_file.GetTypeDescriptor(type_id));
}
std::string PrettyArguments(const char* signature) {
diff --git a/src/utils.h b/src/utils.h
index 8412377..7372ee2 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -195,6 +195,9 @@
// Given String.class, the output would be "java.lang.Class<java.lang.String>".
std::string PrettyTypeOf(const Object* obj)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
+// Returns a human-readable form of the type at an index in the specified dex file.
+// Example outputs: char[], java.lang.String.
std::string PrettyType(uint32_t type_idx, const DexFile& dex_file);
// Returns a human-readable form of the name of the given class.