Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
62 lines (48 loc) · 2.36 KB

File metadata and controls

executable file
·
62 lines (48 loc) · 2.36 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package reflectionTests;
import java.lang.reflect.*;
/**
* This class is created with methods that the tests can look for.
* They return numbers so that the result of invoking the returned
* method can be checked against what the VM chooses during runtime.
*/
public class TestClass {
private int value;
// Test with (int,int,int), ambiguous
public TestClass(int i, double d, float f) { value = 1; }
public TestClass(int i, float f, double d) { value = 2; }
// Test with (String,int,int), ambiguous
public TestClass(String s, Integer a, int b) { value = 3; }
public TestClass(String s, int a, Integer b) { value = 4; }
// Test with (Class,int), ambiguous
public TestClass(Class<?> c, int... rest) { value = 5; }
public TestClass(Class<?> c, int i, int... rest) { value = 6; }
// Test with (Method,int), expect 7
public TestClass(Method m, Number n) { value = 7; }
public TestClass(Method m, Object o) { value = 8; }
// Test with (Field,String,String,String), assert found 9
public TestClass(Field f, String... msg) { value = 9; }
// Test with (boolean, int), expect not found
public TestClass(boolean b, Float f) { value = 10; }
public TestClass(int i) { value = 11; }
public TestClass(Integer i) { value = 12; }
public static int test(int x, int y){ return 4; }
public static int test(Integer x, Integer y){ return 5; }
public static int test(int x, int y, int z){ return 6; }
public static int test(int... i){ return 3; }
public static int test0(int x) { return 1; }
public static int test0(Integer x) { return 2; }
public static int test1(double a, int b, float c){ return 1; }
public static int test1(float a, int b, double c){ return 2; }
public static int test2(int a, int b, int c, int... rest) { return 1; }
public static int test2(Integer a, Integer b, Integer c) { return 2; }
public static int test3(Integer a, double b) { return 1; }
public static int test3(Integer a, long b) { return 2; }
public static int test4(Number b) { return 1; }
public static int test4(int b) { return 2; }
public static int test5(int a, int... rest) { return 1; }
public static int test5(int a, int b, int... rest) { return 2; }
public static int test6(int a) { return 1; }
public static int test7(Number i) { return 1; }
public static int test8(Object o) { return 2; }
public int value() { return value; }
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.