aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs163/pr250493/Bridged.java
blob: 2e3e349e4ddbea98386b4dfb24eea228e9aa3cc3 (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
import java.lang.reflect.Method;
import java.util.*;

interface Super<T> {
	public T getterA();
}

public class Bridged implements Super<String> {
	public String getterA() {
		return "";
	}

	// Print BRIDGE status of all getter* methods
	public static void main(String[] argv) {
		Method[] ms = Bridged.class.getMethods();
		List results = new ArrayList(); 
		for (int i = 0; i < ms.length; i++) {
			if (ms[i].getName().startsWith("getter")) {
				results.add(ms[i].getName()+"()"+ms[i].getReturnType().getName()+ "  isBridged?"+((ms[i].getModifiers() & 0x0040) != 0));
			}
		}
		Collections.sort(results);
		for (Iterator iterator = results.iterator(); iterator.hasNext();) {
			String entry = (String) iterator.next();
			System.out.println(entry);
		}
	}
}

aspect X {
  public T Super<T>.getterB() { return null; }
}