author | jrose |
Fri, 03 Jun 2011 11:20:20 -0700 | |
changeset 9782 | 973c21557e1a |
parent 9146 | 8f574b2bae87 |
child 11534 | 9949ffb8eb3a |
permissions | -rw-r--r-- |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
1 |
/* |
8822
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
2 |
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
4 |
* |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
10 |
* |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
15 |
* accompanied this code). |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
16 |
* |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
20 |
* |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
23 |
* questions. |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
24 |
*/ |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
25 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
26 |
/* @test |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
27 |
* @summary tests for class-specific values |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
28 |
* @compile ClassValueTest.java |
8822
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
29 |
* @run junit/othervm test.java.lang.invoke.ClassValueTest |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
30 |
*/ |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
31 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
32 |
/* |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
33 |
Manually: |
8822
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
34 |
$ $JAVA7X_HOME/bin/javac -d foo -cp $JUNIT4_JAR test/java/lang/invoke/ClassValueTest.java |
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
35 |
$ $JAVA7X_HOME/bin/java -cp foo:$JUNIT4_JAR org.junit.runner.JUnitCore test.java.lang.invoke.ClassValueTest |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
36 |
Output: .testAdd => 1000 : Integer |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
37 |
*/ |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
38 |
|
8822
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
39 |
package test.java.lang.invoke; |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
40 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
41 |
import java.util.*; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
42 |
|
8822
8145ab9f5f86
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
7562
diff
changeset
|
43 |
import java.lang.invoke.*; |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
44 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
45 |
import org.junit.*; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
46 |
import static org.junit.Assert.*; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
47 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
48 |
/** |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
49 |
* @author jrose |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
50 |
*/ |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
51 |
public class ClassValueTest { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
52 |
static String nameForCV1(Class<?> type) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
53 |
return "CV1:" + type.getName(); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
54 |
} |
9146
8f574b2bae87
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
jrose
parents:
8822
diff
changeset
|
55 |
int countForCV1; |
8f574b2bae87
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
jrose
parents:
8822
diff
changeset
|
56 |
final ClassValue<String> CV1 = new CV1(); |
8f574b2bae87
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
jrose
parents:
8822
diff
changeset
|
57 |
private class CV1 extends ClassValue<String> { |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
58 |
protected String computeValue(Class<?> type) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
59 |
countForCV1++; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
60 |
return nameForCV1(type); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
61 |
} |
7562
a0ad195efe2c
7001424: implement JSR 292 EG adjustments, November 2010
jrose
parents:
7054
diff
changeset
|
62 |
} |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
63 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
64 |
static final Class[] CLASSES = { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
65 |
String.class, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
66 |
Integer.class, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
67 |
int.class, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
68 |
boolean[].class, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
69 |
char[][].class, |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
70 |
ClassValueTest.class |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
71 |
}; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
72 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
73 |
@Test |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
74 |
public void testGet() { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
75 |
countForCV1 = 0; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
76 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
77 |
assertEquals(nameForCV1(c), CV1.get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
78 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
79 |
assertEquals(CLASSES.length, countForCV1); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
80 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
81 |
assertEquals(nameForCV1(c), CV1.get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
82 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
83 |
assertEquals(CLASSES.length, countForCV1); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
84 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
85 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
86 |
@Test |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
87 |
public void testRemove() { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
88 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
89 |
CV1.get(c); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
90 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
91 |
countForCV1 = 0; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
92 |
int REMCOUNT = 3; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
93 |
for (int i = 0; i < REMCOUNT; i++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
94 |
CV1.remove(CLASSES[i]); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
95 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
96 |
assertEquals(0, countForCV1); // no change |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
97 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
98 |
assertEquals(nameForCV1(c), CV1.get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
99 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
100 |
assertEquals(REMCOUNT, countForCV1); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
101 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
102 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
103 |
static String nameForCVN(Class<?> type, int n) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
104 |
return "CV[" + n + "]" + type.getName(); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
105 |
} |
9146
8f574b2bae87
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
jrose
parents:
8822
diff
changeset
|
106 |
int countForCVN; |
8f574b2bae87
7019529: JSR292: java/dyn/ClassValueTest.java depends on sub-test execution order
jrose
parents:
8822
diff
changeset
|
107 |
class CVN extends ClassValue<String> { |
7054
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
108 |
final int n; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
109 |
CVN(int n) { this.n = n; } |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
110 |
protected String computeValue(Class<?> type) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
111 |
countForCVN++; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
112 |
return nameForCVN(type, n); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
113 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
114 |
}; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
115 |
|
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
116 |
@Test |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
117 |
public void testGetMany() { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
118 |
int CVN_COUNT1 = 100, CVN_COUNT2 = 100; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
119 |
CVN cvns[] = new CVN[CVN_COUNT1 * CVN_COUNT2]; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
120 |
for (int n = 0; n < cvns.length; n++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
121 |
cvns[n] = new CVN(n); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
122 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
123 |
countForCVN = 0; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
124 |
for (int pass = 0; pass <= 2; pass++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
125 |
for (int i1 = 0; i1 < CVN_COUNT1; i1++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
126 |
eachClass: |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
127 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
128 |
for (int i2 = 0; i2 < CVN_COUNT2; i2++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
129 |
int n = i1*CVN_COUNT2 + i2; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
130 |
assertEquals(0, countForCVN); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
131 |
assertEquals(nameForCVN(c, n), cvns[n].get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
132 |
cvns[n].get(c); //get it again |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
133 |
//System.out.println("getting "+n+":"+cvns[n].get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
134 |
boolean doremove = (((i1 + i2) & 3) == 0); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
135 |
switch (pass) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
136 |
case 0: |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
137 |
assertEquals(1, countForCVN); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
138 |
break; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
139 |
case 1: |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
140 |
// remove on middle pass |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
141 |
assertEquals(0, countForCVN); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
142 |
if (doremove) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
143 |
//System.out.println("removing "+n+":"+cvns[n].get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
144 |
cvns[n].remove(c); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
145 |
assertEquals(0, countForCVN); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
146 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
147 |
break; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
148 |
case 2: |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
149 |
assertEquals(doremove ? 1 : 0, countForCVN); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
150 |
break; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
151 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
152 |
countForCVN = 0; |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
153 |
if (i1 > i2 && i1 < i2+5) continue eachClass; // leave diagonal gap |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
154 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
155 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
156 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
157 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
158 |
assertEquals(countForCVN, 0); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
159 |
for (int n = 0; n < cvns.length; n++) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
160 |
for (Class c : CLASSES) { |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
161 |
assertEquals(nameForCVN(c, n), cvns[n].get(c)); |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
162 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
163 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
164 |
} |
fee2fbaf3293
6982752: dynamic languages need to decorate types with runtime information
jrose
parents:
diff
changeset
|
165 |
} |