author | katleman |
Thu, 03 Sep 2015 14:24:43 -0700 | |
changeset 32450 | f036508e86e7 |
parent 21596 | 0e3a39f29dbc |
permissions | -rw-r--r-- |
19403
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
1 |
/* |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
2 |
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
4 |
* |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
21596 | 7 |
* published by the Free Software Foundation. |
19403
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
8 |
* |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
13 |
* accompanied this code). |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
14 |
* |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
18 |
* |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
21 |
* questions. |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
22 |
*/ |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
23 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
24 |
/** |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
25 |
* @test |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
26 |
* @bug 8003639 |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
27 |
* @summary defaultMethod resolution and verification |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
28 |
* @run main DefaultMethodRegressionTests |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
29 |
*/ |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
30 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
31 |
import java.util.ArrayList; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
32 |
import java.util.Arrays; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
33 |
import java.util.List; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
34 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
35 |
/** |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
36 |
* This set of classes/interfaces (K/I/C) is specially designed to expose a |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
37 |
* bug in the JVM where it did not find some overloaded methods in some |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
38 |
* specific situations. (fixed by hotspot changeset ffb9316fd9ed). |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
39 |
*/ |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
40 |
interface K { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
41 |
int bbb(Long l); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
42 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
43 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
44 |
interface I extends K { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
45 |
default void aaa() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
46 |
default void aab() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
47 |
default void aac() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
48 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
49 |
default int bbb(Integer i) { return 22; } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
50 |
default int bbb(Float f) { return 33; } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
51 |
default int bbb(Long l) { return 44; } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
52 |
default int bbb(Double d) { return 55; } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
53 |
default int bbb(String s) { return 66; } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
54 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
55 |
default void caa() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
56 |
default void cab() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
57 |
default void cac() {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
58 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
59 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
60 |
class C implements I {} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
61 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
62 |
public class DefaultMethodRegressionTests { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
63 |
public static void main(String... args) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
64 |
new DefaultMethodRegressionTests().run(args); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
65 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
66 |
void run(String... args) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
67 |
testLostOverloadedMethod(); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
68 |
System.out.println("testLostOverloadedMethod: OK"); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
69 |
testInferenceVerifier(); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
70 |
System.out.println("testInferenceVerifier: OK"); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
71 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
72 |
void testLostOverloadedMethod() { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
73 |
C c = new C(); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
74 |
assertEquals(c.bbb(new Integer(1)), 22); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
75 |
assertEquals(c.bbb(new Float(1.1)), 33); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
76 |
assertEquals(c.bbb(new Long(1L)), 44); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
77 |
assertEquals(c.bbb(new Double(0.01)), 55); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
78 |
assertEquals(c.bbb(new String("")), 66); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
79 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
80 |
// Test to ensure that the inference verifier accepts older classfiles |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
81 |
// with classes that implement interfaces with defaults. |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
82 |
void testInferenceVerifier() { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
83 |
// interface I { int m() default { return 99; } } |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
84 |
byte I_bytes[] = { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
85 |
(byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x34, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
86 |
0x00, 0x08, 0x07, 0x00, 0x06, 0x07, 0x00, 0x07, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
87 |
0x01, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x01, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
88 |
0x03, 0x28, 0x29, 0x49, 0x01, 0x00, 0x04, 0x43, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
89 |
0x6f, 0x64, 0x65, 0x01, 0x00, 0x01, 0x49, 0x01, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
90 |
0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
91 |
0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
92 |
0x63, 0x74, 0x06, 0x00, 0x00, 0x01, 0x00, 0x02, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
93 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
94 |
0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x05, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
95 |
0x00, 0x00, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x01, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
96 |
0x00, 0x00, 0x00, 0x03, 0x10, 0x63, (byte)0xac, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
97 |
0x00, 0x00, 0x00, 0x00, 0x00 |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
98 |
}; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
99 |
// public class C implements I {} /* -target 1.5 */ |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
100 |
byte C_bytes[] = { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
101 |
(byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x31, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
102 |
0x00, 0x0c, 0x0a, 0x00, 0x03, 0x00, 0x08, 0x07, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
103 |
0x00, 0x09, 0x07, 0x00, 0x0a, 0x07, 0x00, 0x0b, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
104 |
0x01, 0x00, 0x06, 0x3c, 0x69, 0x6e, 0x69, 0x74, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
105 |
0x3e, 0x01, 0x00, 0x03, 0x28, 0x29, 0x56, 0x01, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
106 |
0x00, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x0c, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
107 |
0x05, 0x00, 0x06, 0x01, 0x00, 0x01, 0x43, 0x01, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
108 |
0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
109 |
0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
110 |
0x63, 0x74, 0x01, 0x00, 0x01, 0x49, 0x00, 0x21, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
111 |
0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
112 |
0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
113 |
0x00, 0x06, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
114 |
0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
115 |
0x00, 0x05, 0x2a, (byte)0xb7, 0x00, 0x01, (byte)0xb1, 0x00, |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
116 |
0x00, 0x00, 0x00, 0x00, 0x00 |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
117 |
}; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
118 |
|
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
119 |
ClassLoader cl = new ClassLoader() { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
120 |
protected Class<?> findClass(String name) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
121 |
if (name.equals("I")) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
122 |
return defineClass("I", I_bytes, 0, I_bytes.length); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
123 |
} else if (name.equals("C")) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
124 |
return defineClass("C", C_bytes, 0, C_bytes.length); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
125 |
} else { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
126 |
return null; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
127 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
128 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
129 |
}; |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
130 |
try { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
131 |
Class.forName("C", true, cl); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
132 |
} catch (Exception e) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
133 |
// unmodified verifier will throw VerifyError |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
134 |
throw new RuntimeException(e); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
135 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
136 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
137 |
void assertEquals(Object o1, Object o2) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
138 |
System.out.print("Expected: " + o1); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
139 |
System.out.println(", Obtained: " + o2); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
140 |
if (!o1.equals(o2)) { |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
141 |
throw new RuntimeException("got unexpected values"); |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
142 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
143 |
} |
d4f40eee1188
8022547: [verifier] move DefaultMethodRegressionTests.java to jdk
ksrini
parents:
diff
changeset
|
144 |
} |