Fix annotations test 004.
We use the Java return type rather than looking the return type up
from the dex file because we don't have a dex file to look it up in.
The expected results were sorted statics first; now we're sorting
them non-statics first.
Change-Id: Id4ac52cdec9b472483ec055e47ca1bc3c6a2d885
diff --git a/src/object.cc b/src/object.cc
index 281f685..174388a 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -378,6 +378,10 @@
Class* Method::GetReturnType() const {
DCHECK(GetDeclaringClass()->IsResolved() || GetDeclaringClass()->IsErroneous())
<< PrettyMethod(this);
+ Class* java_return_type = java_return_type_;
+ if (java_return_type != NULL) {
+ return java_return_type;
+ }
// Short-cut
Class* result = GetDexCacheResolvedTypes()->Get(GetReturnTypeIdx());
if (result == NULL) {
diff --git a/test/004-annotations/expected.txt b/test/004-annotations/expected.txt
index 8f19c4c..eade6de 100644
--- a/test/004-annotations/expected.txt
+++ b/test/004-annotations/expected.txt
@@ -28,10 +28,10 @@
@android.test.anno.AnnoSimpleMethod()
interface android.test.anno.AnnoSimpleMethod
method parameter annotations:
- annotations on FIELD public static int android.test.anno.SimplyNoted.mOneFoo:
+ annotations on FIELD public int android.test.anno.SimplyNoted.mFoo:
@android.test.anno.AnnoSimpleField()
interface android.test.anno.AnnoSimpleField
- annotations on FIELD public int android.test.anno.SimplyNoted.mFoo:
+ annotations on FIELD public static int android.test.anno.SimplyNoted.mOneFoo:
@android.test.anno.AnnoSimpleField()
interface android.test.anno.AnnoSimpleField