From 6b4ef025af12b158d117fc80fc79acf620f411a0 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Sun, 23 Oct 2011 14:59:04 -0700 Subject: Make ResolveField not rely on Field::GetType resolution Change-Id: I10f4a874809ac9db2cd54e200cf10eb7c8979fce --- src/utils.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/utils.cc') diff --git a/src/utils.cc b/src/utils.cc index 3922033dd7..a74e2310a7 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -110,13 +110,19 @@ std::string PrettyDescriptor(const std::string& descriptor) { return result; } +std::string PrettyDescriptor(Primitive::Type type) { + char descriptor_char = Primitive::DescriptorChar(type); + std::string descriptor_string(1, descriptor_char); + return PrettyDescriptor(descriptor_string); +} + std::string PrettyField(const Field* f, bool with_type) { if (f == NULL) { return "null"; } std::string result; if (with_type) { - result += PrettyDescriptor(f->GetType()->GetDescriptor()); + result += PrettyDescriptor(f->GetTypeDescriptor()); result += ' '; } result += PrettyDescriptor(f->GetDeclaringClass()->GetDescriptor()); -- cgit v1.2.3-59-g8ed1b