StandardInvocationController.java

1
package com.github.dakusui.osynth.invocationcontrollers;
2
3
import com.github.dakusui.osynth.core.*;
4
5
import java.lang.reflect.Method;
6
import java.util.Map;
7
8
import static com.github.dakusui.osynth.core.utils.MethodUtils.createMethodHandlerFromFallbackObject;
9
import static com.github.dakusui.osynth.core.utils.MethodUtils.createMethodHandlerFromInterfaces;
10
11
public class StandardInvocationController extends InvocationController.Base implements InvocationController.WithCache {
12
  private final Map<Method, MethodHandler> cache = createCache();
13
14
  public StandardInvocationController(SynthesizedObject.Descriptor descriptor) {
15
    super(descriptor);
16
  }
17
18
  @Override
19
  public MethodHandler figuredOutMethodHandlerFor(Method invokedMethod) {
20
    MethodSignature invokedMethodSignature = MethodSignature.create(invokedMethod);
21 1 1. figuredOutMethodHandlerFor : replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::figuredOutMethodHandlerFor → KILLED
    return this.descriptor().methodHandlerEntries().stream()
22 2 1. lambda$figuredOutMethodHandlerFor$0 : replaced boolean return with false for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$0 → KILLED
2. lambda$figuredOutMethodHandlerFor$0 : replaced boolean return with true for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$0 → KILLED
        .filter(me -> me.matcher().test(invokedMethod))
23
        .map(MethodHandlerEntry::handler)
24
        .findFirst()
25
        .orElseGet(() -> createMethodHandlerFromInterfaces(descriptor().interfaces(), invokedMethodSignature)
26 2 1. lambda$figuredOutMethodHandlerFor$2 : replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$2 → KILLED
2. lambda$null$1 : replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$null$1 → KILLED
            .orElseGet(() -> createMethodHandlerFromFallbackObject(descriptor().fallbackObject(), invokedMethodSignature)));
27
  }
28
29
  @Override
30
  public Map<Method, MethodHandler> cache() {
31 1 1. cache : replaced return value with Collections.emptyMap for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::cache → KILLED
    return this.cache;
32
  }
33
}

Mutations

21

1.1
Location : figuredOutMethodHandlerFor
Killed by : com.github.dakusui.osynth.ut.core.SynthesizedObjectTest.descriptorSameReference(com.github.dakusui.osynth.ut.core.SynthesizedObjectTest)
replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::figuredOutMethodHandlerFor → KILLED

22

1.1
Location : lambda$figuredOutMethodHandlerFor$0
Killed by : com.github.dakusui.osynth.ut.core.SynthesizedObjectTest.descriptorSameReference(com.github.dakusui.osynth.ut.core.SynthesizedObjectTest)
replaced boolean return with false for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$0 → KILLED

2.2
Location : lambda$figuredOutMethodHandlerFor$0
Killed by : com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest.whenEqualsItself$thenTrue(com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest)
replaced boolean return with true for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$0 → KILLED

26

1.1
Location : lambda$figuredOutMethodHandlerFor$2
Killed by : com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest.givenNoExplicitInterface$whenSynthesizedWithoutInclusionFromFallbackInNonAutoMode$thenClassCastException(com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest)
replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$figuredOutMethodHandlerFor$2 → KILLED

2.2
Location : lambda$null$1
Killed by : com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest.givenTweakerWithInterfaceB$whenSynthesizeWithB$thenReturnValueFromB(com.github.dakusui.osynth.compat.ut.ObjectSynthesizerTest)
replaced return value with null for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::lambda$null$1 → KILLED

31

1.1
Location : cache
Killed by : com.github.dakusui.osynth.ut.core.SynthesizedObjectTest.descriptorSameReference(com.github.dakusui.osynth.ut.core.SynthesizedObjectTest)
replaced return value with Collections.emptyMap for com/github/dakusui/osynth/invocationcontrollers/StandardInvocationController::cache → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3