summaryrefslogtreecommitdiff
path: root/test/031-class-attributes/src/ClassAttrs.java
diff options
context:
space:
mode:
author Sebastien Hertz <shertz@google.com> 2015-03-04 16:55:21 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-03-04 16:55:22 +0000
commitdc68bafc29a457b1cc5b29a03f2ef5f2af77865d (patch)
tree05332b60a00d2be899471906826c244fab07e934 /test/031-class-attributes/src/ClassAttrs.java
parent3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d (diff)
parentb1add757fc60d8645ffa36db5bbb9279d86451ee (diff)
Merge "Update run-test 031-class-attributes"
Diffstat (limited to 'test/031-class-attributes/src/ClassAttrs.java')
-rw-r--r--test/031-class-attributes/src/ClassAttrs.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/031-class-attributes/src/ClassAttrs.java b/test/031-class-attributes/src/ClassAttrs.java
index ae8b2f56da..977a05f1a6 100644
--- a/test/031-class-attributes/src/ClassAttrs.java
+++ b/test/031-class-attributes/src/ClassAttrs.java
@@ -9,6 +9,9 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
public class ClassAttrs {
ClassAttrs() {
@@ -323,19 +326,27 @@ public class ClassAttrs {
* Convert an array of Type into a string. Start with an array count.
*/
private static String stringifyTypeArray(Type[] types) {
+ List<String> typeStringList = new ArrayList<String>();
+ for (Type t : types) {
+ typeStringList.add(t.toString());
+ }
+ // Sort types alphabetically so they're always printed in the same order, whichever
+ // tool generated the DEX file of the test.
+ Collections.sort(typeStringList);
+
StringBuilder stb = new StringBuilder();
boolean first = true;
stb.append("[" + types.length + "]");
- for (Type t: types) {
+ for (String typeString : typeStringList) {
if (first) {
stb.append(" ");
first = false;
} else {
stb.append(", ");
}
- stb.append(t.toString());
+ stb.append(typeString);
}
return stb.toString();