smaller
This commit is contained in:
parent
67e1c5c736
commit
ac3ce7d214
@ -122,8 +122,13 @@ public class FiniteClosure implements IFiniteClosure {
|
|||||||
Set<TypeParams> permResult = new HashSet<>();
|
Set<TypeParams> permResult = new HashSet<>();
|
||||||
permuteParams(paramCandidates, 0, permResult, new Type[paramCandidates.size()]);
|
permuteParams(paramCandidates, 0, permResult, new Type[paramCandidates.size()]);
|
||||||
|
|
||||||
for (TypeParams newParams : permResult)
|
for (TypeParams newParams : permResult) {
|
||||||
result3.add(t.setTypeParams(newParams));
|
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:
|
* Test Case 15:
|
||||||
*
|
*
|
||||||
* MyMap<K> <* HashMap<K, List<K>>
|
* MyMap<K> <* TreeMap<K, List<K>>
|
||||||
*
|
*
|
||||||
* smaller(NavigableSet<? extends Integer, ? extends ArrayList<? extends Integer>>) =
|
* smaller(NavigableSet<? extends Integer, ? extends List<? extends Integer>>) =
|
||||||
* { NavigableSet<? extends Integer, ? extends ArrayList<? extends Integer>>,
|
* { Permutationen der List,
|
||||||
* NavigableSet<? extends Integer, ? extends ArrayList<Integer>>
|
* Permutationen der List in TreeSets,
|
||||||
* NavigableSet<? extends Integer, ArrayList<? extends Integer>>
|
* MyMap<Integer> und MyMap<? 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>> }
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user