summaryrefslogtreecommitdiffstats
path: root/tests/java5
diff options
context:
space:
mode:
authoraclement <aclement>2005-07-26 08:25:05 +0000
committeraclement <aclement>2005-07-26 08:25:05 +0000
commitf792b5464b8944a6a97c4c24403f4a06c73fc606 (patch)
tree1a81d24a8cb8ec8810eba9e0f4851be683616922 /tests/java5
parentebd9ffbfda07b35b9014f01046db0f4801deaf03 (diff)
downloadaspectj-f792b5464b8944a6a97c4c24403f4a06c73fc606.tar.gz
aspectj-f792b5464b8944a6a97c4c24403f4a06c73fc606.zip
generics: testcase - static generic method ITD
Diffstat (limited to 'tests/java5')
-rw-r--r--tests/java5/generics/itds/StaticGenericMethodITD.aj23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/StaticGenericMethodITD.aj b/tests/java5/generics/itds/StaticGenericMethodITD.aj
new file mode 100644
index 000000000..af75f07dc
--- /dev/null
+++ b/tests/java5/generics/itds/StaticGenericMethodITD.aj
@@ -0,0 +1,23 @@
+/*
+ * Static ITD of a generic method
+ */
+import java.util.*;
+
+class MathUtils {
+}
+
+public class StaticGenericMethodITD {
+ public static void main(String[] argv) {
+ List<Integer> ints = new ArrayList<Integer>();
+ ints.add(10); ints.add(20); ints.add(30);
+ System.err.println("First="+MathUtils.first(ints));
+ if (!MathUtils.first(ints).equals(10))
+ throw new RuntimeException("First val!=10, it was "+
+ MathUtils.first(ints));
+ }
+}
+
+
+aspect X {
+ static <E> E MathUtils.first(List<E> elements) { return elements.get(0); }
+}