Search in sources :

Example 1 with SetValuedMap

use of org.apache.commons.collections4.SetValuedMap in project methods-distance by sevntu-checkstyle.

the class MethodOrder method getMethodInvocationsNesting.

private static MultiValuedMap<MethodInvocation, MethodInvocation> getMethodInvocationsNesting(Map<ResolvedCall, MethodInvocation> callToInvocation) {
    final SetValuedMap<MethodInvocation, MethodInvocation> nestedInside = new HashSetValuedHashMap<>();
    callToInvocation.entrySet().stream().forEach(entry -> {
        final ResolvedCall resolvedCall = entry.getKey();
        final MethodInvocation methodInvocation = entry.getValue();
        callToInvocation.keySet().stream().filter(rc -> !rc.equals(resolvedCall)).filter(resolvedCall::isNestedInside).forEach(rc -> nestedInside.put(methodInvocation, callToInvocation.get(rc)));
    });
    return nestedInside;
}
Also used : ResolvedCall(com.github.sevntu.checkstyle.domain.ResolvedCall) HashSetValuedHashMap(org.apache.commons.collections4.multimap.HashSetValuedHashMap)

Aggregations

ResolvedCall (com.github.sevntu.checkstyle.domain.ResolvedCall)1 HashSetValuedHashMap (org.apache.commons.collections4.multimap.HashSetValuedHashMap)1