diff options
author | acolyer <acolyer> | 2005-02-11 12:47:56 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-02-11 12:47:56 +0000 |
commit | 1381903ac81cdab2b79b6525096671aa5d62eaeb (patch) | |
tree | f00812eae5c1a626aa99ba954d0899c083a3bc8f /tests/java5/generics/GenericMethods.java | |
parent | 382b7330f47d14164896671a4bf3c7ec3acf069b (diff) | |
download | aspectj-1381903ac81cdab2b79b6525096671aa5d62eaeb.tar.gz aspectj-1381903ac81cdab2b79b6525096671aa5d62eaeb.zip |
move all java 5 tests out of code and back into .xml files now that we can compile them properly
Diffstat (limited to 'tests/java5/generics/GenericMethods.java')
-rw-r--r-- | tests/java5/generics/GenericMethods.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/java5/generics/GenericMethods.java b/tests/java5/generics/GenericMethods.java new file mode 100644 index 000000000..78ef49212 --- /dev/null +++ b/tests/java5/generics/GenericMethods.java @@ -0,0 +1,51 @@ +import java.util.*; +/* + * test case fodder for basic generic signature matching + */ +public class GenericMethods { + + public List<Integer> returningListOfInteger() { + return new LinkedList<Integer>(); + } + + public List<Object> returningListOfObject() { + return new LinkedList<Object>(); + } + + public List returningRawList() { return new ArrayList(); } + + public LinkedList<Integer> returningSubtypeOfListOfInteger() { + return new LinkedList<Integer>(); + } + + public void takesAMap(Map<Double,Short> aMap) {} + + public void takesAHashmap(HashMap<Double,Short> aMap) {} + + public static void staticTakesAMap(Map<Double,Short> aMap) {} + + public void collectionOfAnything(Collection<?> aCollection) {} + + public void collectionOfAnyNumber(Collection<? extends Number> aNumberCollection) {} + + public void collectionOfAnythingTakingADouble(Collection<? super Double> aDoubleHandlingCollection) {} + + // now some fun with statics + static <T> T findMax(List<T> ts) { return ts.get(0); } + + static <T extends Comparable<T>> T betterMax(Collection<T> collection) { + return null; + } + + static <T extends Comparable<? super T>> T evenBetterMax(Collection<T> coll) { + return null; + } + + static <T extends Object & Comparable<? super T>> T jdkMax(Collection<? extends T> coll) { + return null; + } + + static <T> void copy(List<T> dest, List<? extends T> src) {} + + static <T,S extends T> copyv2(List<T> dest, List<S> src) {} +}
\ No newline at end of file |