7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
authorjrose
Sat, 09 Apr 2011 21:38:40 -0700
changeset 9146 8f574b2bae87
parent 9033 a88f5656f05d
child 9147 24f45d5bc7d2
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order Summary: Test should not use static variables, because they may contain stale values. Reviewed-by: twisti
jdk/test/java/lang/invoke/ClassValueTest.java
--- a/jdk/test/java/lang/invoke/ClassValueTest.java	Thu Apr 07 22:07:06 2011 -0700
+++ b/jdk/test/java/lang/invoke/ClassValueTest.java	Sat Apr 09 21:38:40 2011 -0700
@@ -52,9 +52,9 @@
     static String nameForCV1(Class<?> type) {
         return "CV1:" + type.getName();
     }
-    static int countForCV1;
-    static final ClassValue<String> CV1 = new CV1();
-    private static class CV1 extends ClassValue<String> {
+    int countForCV1;
+    final ClassValue<String> CV1 = new CV1();
+    private class CV1 extends ClassValue<String> {
         protected String computeValue(Class<?> type) {
             countForCV1++;
             return nameForCV1(type);
@@ -103,8 +103,8 @@
     static String nameForCVN(Class<?> type, int n) {
         return "CV[" + n + "]" + type.getName();
     }
-    static int countForCVN;
-    static class CVN extends ClassValue<String> {
+    int countForCVN;
+    class CVN extends ClassValue<String> {
         final int n;
         CVN(int n) { this.n = n; }
         protected String computeValue(Class<?> type) {