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