CallableMultibit.java

1
package com.jsql.model.injection.strategy.blind;
2
3
import com.jsql.model.InjectionModel;
4
import com.jsql.model.injection.strategy.blind.patch.Diff;
5
import com.jsql.model.injection.strategy.blind.patch.DiffMatchPatch;
6
7
import java.util.HashSet;
8
import java.util.LinkedList;
9
import java.util.List;
10
11
public class CallableMultibit extends AbstractCallableBoolean<CallableMultibit> {
12
13
    private LinkedList<Diff> diffsWithReference = new LinkedList<>();
14
15
    private static final DiffMatchPatch DIFF_MATCH_PATCH = new DiffMatchPatch();
16
17
    private final InjectionMultibit injectionMultibit;
18
19
    private final String metadataInjectionProcess;
20
21
    public CallableMultibit(String sqlQuery, InjectionMultibit injectionMultibit, String metadataInjectionProcess) {
22
23
        this.injectionMultibit = injectionMultibit;
24
        this.metadataInjectionProcess = metadataInjectionProcess;
25
        this.booleanUrl = sqlQuery;
26
        this.isMultibit = true;
27
    }
28
29
    public CallableMultibit(
30
        String sqlQuery,
31
        int indexCharacter,
32
        int block,
33
        InjectionModel injectionModel,
34
        InjectionMultibit injectionMultibit,
35
        String metadataInjectionProcess
36
    ) {
37
38
        this(
39 2 1. <init> : Replaced integer multiplication with division → NO_COVERAGE
2. <init> : Replaced integer subtraction with addition → NO_COVERAGE
            injectionModel.getMediatorVendor().getVendor().instance().sqlMultibit(
40
                sqlQuery,
41
                indexCharacter,
42
                3 * block - 2
43
            ),
44
            injectionMultibit,
45
            metadataInjectionProcess
46
        );
47
        this.block = block;
48
        this.currentIndex = indexCharacter;
49
    }
50
51
    @Override
52
    public CallableMultibit call() {
53
54
        String result = this.injectionMultibit.callUrl(this.booleanUrl, this.metadataInjectionProcess, this);
55
56
        this.diffsWithReference = DIFF_MATCH_PATCH.diffMain(this.injectionMultibit.getSourceReference(), result, true);
57
58 1 1. call : removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE
        DIFF_MATCH_PATCH.diffCleanupEfficiency(this.diffsWithReference);
59
60
        this.diffsWithReference.removeAll(this.injectionMultibit.getDiffsCommonWithAllIds());
61
62 2 1. call : negated conditional → NO_COVERAGE
2. call : changed conditional boundary → NO_COVERAGE
        for (int i = 0; i < this.injectionMultibit.getDiffsById().size() ; i++) {
63 1 1. call : negated conditional → NO_COVERAGE
            if (new HashSet<>(this.injectionMultibit.getDiffsById().get(i)).containsAll(this.diffsWithReference)) {
64
                this.idPage = i;
65
            }
66
        }
67
68 1 1. call : replaced return value with null for com/jsql/model/injection/strategy/blind/CallableMultibit::call → NO_COVERAGE
        return this;
69
    }
70
71
    @Override
72
    public boolean isTrue() {
73 1 1. isTrue : replaced boolean return with true for com/jsql/model/injection/strategy/blind/CallableMultibit::isTrue → NO_COVERAGE
        return false;  // ignored
74
    }
75
76
    public List<Diff> getDiffsWithReference() {
77 1 1. getDiffsWithReference : replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/CallableMultibit::getDiffsWithReference → NO_COVERAGE
        return this.diffsWithReference;
78
    }
79
    public int getIdPage() {
80 1 1. getIdPage : replaced int return with 0 for com/jsql/model/injection/strategy/blind/CallableMultibit::getIdPage → NO_COVERAGE
        return this.idPage;
81
    }
82
}

Mutations

39

1.1
Location : <init>
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

2.2
Location : <init>
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

58

1.1
Location : call
Killed by : none
removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE

62

1.1
Location : call
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : call
Killed by : none
changed conditional boundary → NO_COVERAGE

63

1.1
Location : call
Killed by : none
negated conditional → NO_COVERAGE

68

1.1
Location : call
Killed by : none
replaced return value with null for com/jsql/model/injection/strategy/blind/CallableMultibit::call → NO_COVERAGE

73

1.1
Location : isTrue
Killed by : none
replaced boolean return with true for com/jsql/model/injection/strategy/blind/CallableMultibit::isTrue → NO_COVERAGE

77

1.1
Location : getDiffsWithReference
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/CallableMultibit::getDiffsWithReference → NO_COVERAGE

80

1.1
Location : getIdPage
Killed by : none
replaced int return with 0 for com/jsql/model/injection/strategy/blind/CallableMultibit::getIdPage → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1