aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features151/newarrayjoinpoint/Twelve.java
blob: f4f802db5b5741054d2b0f461c713a66f9e89789 (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
// writing general advice for multiple array types

public class Twelve {
	
  static int[] is1;
  static Integer[] is2;
  static String[][] strs;

  public static void main(String []argv) {
    is1 = new int[5];
    is2 = new Integer[8];  
    strs = new String[4][8];
  }
}

aspect X {

  after() returning(Object o): call(*.new(..)) && within(Twelve) {
	   System.err.println("It is "+o.getClass());
	   System.err.println("Is it an array? "+o.getClass().isArray());
	   System.err.println("Component type is "+o.getClass().getComponentType());
	   System.err.println("--");
  }
  
}