aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/ClassFieldOnPrimitiveType.java
blob: 81d2a0877a3ac34c1a0db1f570726a10ac7b36b0 (plain)
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
63
64
65
66
67
68
69
70
71
import org.aspectj.testing.Tester;

public class ClassFieldOnPrimitiveType
{
    public static void main(String[] args) { test(); }

    public static void test() {
        Tester.checkEqual(checkBoolean(), "boolean", "boolean");
        Tester.checkEqual(checkChar(), "char", "char");
        Tester.checkEqual(checkByte(), "byte", "byte");
        Tester.checkEqual(checkShort(), "short", "short");
        Tester.checkEqual(checkLong(), "long", "long");
        Tester.checkEqual(checkFloat(), "float", "float");
        Tester.checkEqual(checkDouble(), "double", "double");
        Tester.checkEqual(checkIntArray(), "[Z", "boolean[]");
        checkIntArray();
    }
    
    public static String checkVoid() {
        Class c = void.class;
        return c.getName();
    }
    
    public static String checkBoolean() {
        Class c = boolean.class;  
        Tester.check(c.isPrimitive(), "check isPrimitive");
        return c.getName();
    }
    
    public static String checkChar() {
        Class c = char.class;  
        return c.getName();
    }
    
    public static String checkByte() {
        Class c = byte.class;  
        return c.getName();
    }
    
    public static String checkShort() {
        Class c = short.class;  
        return c.getName();
    }
    
    public static String checkInt() {
        Class c = int.class;  
        Tester.check( c == Integer.TYPE, "check Type field");
        return c.getName();
    }
    
    public static String checkLong() {
        Class c = long.class;  
        return c.getName();
    }
    
    public static String checkFloat() {
        Class c = float.class;  
        return c.getName();
    }
    
    public static String checkDouble() {
        Class c = double.class;  
        return c.getName();
    }
    
    public static String checkIntArray() {
        Class c = boolean[].class;
        return c.getName();
    }
}