forked from JavaTX/JavaCompilerCore
smaller
This commit is contained in:
parent
67e1c5c736
commit
ac3ce7d214
@ -122,8 +122,13 @@ public class FiniteClosure implements IFiniteClosure {
|
||||
Set<TypeParams> permResult = new HashSet<>();
|
||||
permuteParams(paramCandidates, 0, permResult, new Type[paramCandidates.size()]);
|
||||
|
||||
for (TypeParams newParams : permResult)
|
||||
result3.add(t.setTypeParams(newParams));
|
||||
for (TypeParams newParams : permResult) {
|
||||
Type tPrime = t.setTypeParams(newParams);
|
||||
if(tPrime.equals(t))
|
||||
result3.add(t);
|
||||
else
|
||||
result3.addAll(smaller(tPrime));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -375,22 +375,22 @@ public class FiniteClosureTest {
|
||||
/*
|
||||
* Test Case 15:
|
||||
*
|
||||
* MyMap<K> <* HashMap<K, List<K>>
|
||||
* MyMap<K> <* TreeMap<K, List<K>>
|
||||
*
|
||||
* smaller(NavigableSet<? extends Integer, ? extends ArrayList<? extends Integer>>) =
|
||||
* { NavigableSet<? extends Integer, ? extends ArrayList<? extends Integer>>,
|
||||
* NavigableSet<? extends Integer, ? extends ArrayList<Integer>>
|
||||
* NavigableSet<? extends Integer, ArrayList<? extends Integer>>
|
||||
* NavigableSet<? extends Integer, ArrayList<Integer>>
|
||||
* TreeSet<? extends Integer, ? extends ArrayList<? extends Integer>>,
|
||||
* TreeSet<? extends Integer, ? extends ArrayList<Integer>>
|
||||
* TreeSet<? extends Integer, ArrayList<? extends Integer>>
|
||||
* TreeSet<? extends Integer, ArrayList<Integer>> }
|
||||
* smaller(NavigableSet<? extends Integer, ? extends List<? extends Integer>>) =
|
||||
* { Permutationen der List,
|
||||
* Permutationen der List in TreeSets,
|
||||
* MyMap<Integer> und MyMap<? extends Integer>
|
||||
* }
|
||||
*/
|
||||
|
||||
Type navSet = tf.getSimpleType("NavigableSet", extInt, tf.getExtendsType(tf.getSimpleType("ArrayList", extInt)));
|
||||
Type navSet = tf.getSimpleType("NavigableMap", extInt, tf.getExtendsType(tf.getSimpleType("List", extInt)));
|
||||
|
||||
Assert.assertEquals(8, fc.smaller(navSet).size());
|
||||
actual = fc.smaller(navSet);
|
||||
|
||||
Assert.assertEquals(82, actual.size());
|
||||
Assert.assertTrue(actual.contains(myMapExtInt));
|
||||
Assert.assertTrue(actual.contains(myMapInt));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user