| 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 |
|
| 22 |
1.1 2.2 |
|
| 26 |
1.1 2.2 |
|
| 31 |
1.1 |