summaryrefslogtreecommitdiffstats
path: root/tests/new/ClassForName.java
blob: 83b8a62c5b37f72ef7347b1dbcf28d9ae0070595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import org.aspectj.testing.Tester;
import java.util.*;

public class ClassForName {
    public static void main(String[] args) throws ClassNotFoundException {
    	Class c1 = String[].class;
    	Class c2 = Class.forName("[Ljava.lang.String;");
    	Class c3 = ClassForName.class.getClassLoader().loadClass("[Ljava.lang.String;");
    	
		Tester.checkEqual(c1, c2, "classes c1, c2");
		Tester.checkEqual(c2, c3, "classes c2, c3");
    	
    	Tester.checkEqual(c1.getComponentType(), String.class, "component");
    }
}

aspect A {
	before(): execution(void main(..)) {
		System.out.println(thisJoinPointStaticPart);
	}
}