|
1
|
|
package net.bmahe.genetics4j.core.mutation; |
|
2
|
|
|
|
3
|
|
import java.util.List; |
|
4
|
|
import java.util.Objects; |
|
5
|
|
|
|
6
|
|
import net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext; |
|
7
|
|
import net.bmahe.genetics4j.core.spec.mutation.MutationPolicy; |
|
8
|
|
|
|
9
|
|
public class MutationPolicyHandlerResolver<T extends Comparable<T>> { |
|
10
|
|
|
|
11
|
|
private final AbstractEAExecutionContext<T> eaExecutionContext; |
|
12
|
|
private final List<MutationPolicyHandler<T>> mutationPolicyHandlers; |
|
13
|
|
|
|
14
|
|
public MutationPolicyHandlerResolver(final AbstractEAExecutionContext<T> _eaExecutionContext) { |
|
15
|
|
Objects.requireNonNull(_eaExecutionContext); |
|
16
|
|
|
|
17
|
1
1. <init> : Removed assignment to member variable eaExecutionContext → KILLED
|
this.eaExecutionContext = _eaExecutionContext; |
|
18
|
2
1. <init> : Removed assignment to member variable mutationPolicyHandlers → KILLED
2. <init> : removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::mutationPolicyHandlers → KILLED
|
mutationPolicyHandlers = eaExecutionContext.mutationPolicyHandlers(); |
|
19
|
|
} |
|
20
|
|
|
|
21
|
|
public boolean canHandle(final MutationPolicy mutationPolicy) { |
|
22
|
|
Objects.requireNonNull(mutationPolicy); |
|
23
|
|
|
|
24
|
7
1. lambda$canHandle$0 : replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$canHandle$0 → SURVIVED
2. canHandle : replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::canHandle → SURVIVED
3. lambda$canHandle$0 : replaced boolean return with false for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$canHandle$0 → KILLED
4. canHandle : replaced boolean return with false for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::canHandle → KILLED
5. canHandle : removed call to java/util/stream/Stream::anyMatch → KILLED
6. canHandle : removed call to java/util/List::stream → KILLED
7. lambda$canHandle$0 : removed call to net/bmahe/genetics4j/core/mutation/MutationPolicyHandler::canHandle → KILLED
|
return mutationPolicyHandlers.stream().anyMatch(sph -> sph.canHandle(this, mutationPolicy)); |
|
25
|
|
} |
|
26
|
|
|
|
27
|
|
public MutationPolicyHandler<T> resolve(final MutationPolicy mutationPolicy) { |
|
28
|
|
Objects.requireNonNull(mutationPolicy); |
|
29
|
|
|
|
30
|
2
1. resolve : removed call to java/util/List::stream → KILLED
2. resolve : replaced return value with null for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::resolve → KILLED
|
return mutationPolicyHandlers.stream() |
|
31
|
9
1. lambda$resolve$0 : Substituted 0 with 1 → KILLED
2. lambda$resolve$0 : removed conditional - replaced equality check with true → KILLED
3. resolve : removed call to java/util/stream/Stream::dropWhile → KILLED
4. lambda$resolve$0 : removed call to net/bmahe/genetics4j/core/mutation/MutationPolicyHandler::canHandle → KILLED
5. lambda$resolve$0 : replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$resolve$0 → KILLED
6. lambda$resolve$0 : removed conditional - replaced equality check with false → KILLED
7. resolve : replaced call to java/util/stream/Stream::dropWhile with receiver → KILLED
8. lambda$resolve$0 : negated conditional → KILLED
9. lambda$resolve$0 : Substituted 1 with 0 → KILLED
|
.dropWhile(sph -> sph.canHandle(this, mutationPolicy) == false) |
|
32
|
1
1. resolve : removed call to java/util/stream/Stream::findFirst → KILLED
|
.findFirst() |
|
33
|
1
1. resolve : removed call to java/util/Optional::orElseThrow → KILLED
|
.orElseThrow( |
|
34
|
3
1. lambda$resolve$1 : removed call to java/lang/String::valueOf → NO_COVERAGE
2. lambda$resolve$1 : removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
3. lambda$resolve$1 : replaced return value with null for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$resolve$1 → NO_COVERAGE
|
() -> new IllegalStateException( |
|
35
|
|
"Could not find suitable mutation policy handler for policy: " + mutationPolicy)); |
|
36
|
|
|
|
37
|
|
} |
|
38
|
|
} |
| | Mutations |
| 17 |
|
1.1 Location : <init> Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] Removed assignment to member variable eaExecutionContext → KILLED
|
| 18 |
|
1.1 Location : <init> Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] Removed assignment to member variable mutationPolicyHandlers → KILLED
2.2 Location : <init> Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::mutationPolicyHandlers → KILLED
|
| 24 |
|
1.1 Location : lambda$canHandle$0 Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] replaced boolean return with false for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$canHandle$0 → KILLED
2.2 Location : lambda$canHandle$0 Killed by : none replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$canHandle$0 → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()]
3.3 Location : canHandle Killed by : none replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::canHandle → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()]
4.4 Location : canHandle Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] replaced boolean return with false for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::canHandle → KILLED
5.5 Location : canHandle Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] removed call to java/util/stream/Stream::anyMatch → KILLED
6.6 Location : canHandle Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] removed call to java/util/List::stream → KILLED
7.7 Location : lambda$canHandle$0 Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] removed call to net/bmahe/genetics4j/core/mutation/MutationPolicyHandler::canHandle → KILLED
|
| 30 |
|
1.1 Location : resolve Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to java/util/List::stream → KILLED
2.2 Location : resolve Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] replaced return value with null for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::resolve → KILLED
|
| 31 |
|
1.1 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] Substituted 0 with 1 → KILLED
2.2 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed conditional - replaced equality check with true → KILLED
3.3 Location : resolve Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to java/util/stream/Stream::dropWhile → KILLED
4.4 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to net/bmahe/genetics4j/core/mutation/MutationPolicyHandler::canHandle → KILLED
5.5 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] replaced boolean return with true for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$resolve$0 → KILLED
6.6 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] removed conditional - replaced equality check with false → KILLED
7.7 Location : resolve Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] replaced call to java/util/stream/Stream::dropWhile with receiver → KILLED
8.8 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] negated conditional → KILLED
9.9 Location : lambda$resolve$0 Killed by : net.bmahe.genetics4j.core.mutation.SupersimpleTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.SupersimpleTest]/[method:simple()] Substituted 1 with 0 → KILLED
|
| 32 |
|
1.1 Location : resolve Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to java/util/stream/Stream::findFirst → KILLED
|
| 33 |
|
1.1 Location : resolve Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:virtualThreadFactory()] removed call to java/util/Optional::orElseThrow → KILLED
|
| 34 |
|
1.1 Location : lambda$resolve$1 Killed by : none removed call to java/lang/String::valueOf → NO_COVERAGE
2.2 Location : lambda$resolve$1 Killed by : none removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
3.3 Location : lambda$resolve$1 Killed by : none replaced return value with null for net/bmahe/genetics4j/core/mutation/MutationPolicyHandlerResolver::lambda$resolve$1 → NO_COVERAGE
|