aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features151/serialveruid/TwoTypes.java
blob: c61ffac270273b9c5dcc562b5e79bf88d3ee1f99 (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
import java.io.Serializable;
import java.lang.reflect.Field;
import com.testware.ejb.common.*;

// when in a package, AJ worked out:
//Test SerialVersionUID is 8593816477552447372
//ATest SerialVersionUID is -5439116922937363745
// atest serialveruid: -5439116922937363745L
//  test serialveruid: 8593816477552447372L


//ATest: static final long serialVersionUID = 9091955077097551023L;
//Test: static final long serialVersionUID =  1583992244946994789L;

//ATest SerialVersionUID is 9091955077097551023
//Test SerialVersionUID is 1583992244946994789
//
aspect X {
	before(): staticinitialization(*Test) {}
}

public class TwoTypes implements Serializable {
  public static void main(String[] args) {
	  try {
		  Test c = (Test)Test.class.newInstance();
		  Field f = Test.class.getDeclaredField("serialVersionUID");
		  f.setAccessible(true);
		  long l = f.getLong(c);
	      System.err.println("Test SerialVersionUID is "+l);
	  
	      
		 // ATest b = (ATest)ATest.class.newInstance();
	      f = ATest.class.getDeclaredField("serialVersionUID");
	      f.setAccessible(true);
	      l = f.getLong(Test.class.getSuperclass());
	      System.err.println("ATest SerialVersionUID is "+l);

	  
	  } catch (Exception e) {
	      System.err.println("Problem: "+e.toString());
	      e.printStackTrace();
	  }
  }
//  
//  public int anInt;
//  
//  public static boolean aBoolean = false;
//  
//  public long foo = 376;
//  
//  public void m() {}
//  public int compareTo(Object o) { return 0;}
//  public String m2(boolean b,long l, String s) { return "";}
//  
//  public static transient short fo2 = 3;
  
}