Skip to content

Commit e5708c6

Browse files
committed
secureCodeBox#36 Give variable a name to reflect what it is
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent aee1810 commit e5708c6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/main/java/io/securecodebox/persistence/defectdojo/service/ImportScanService.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,19 @@ protected ImportScanResponse createFindings(ScanFile scanFile, String endpoint,
105105
new MappingJackson2HttpMessageConverter())
106106
);
107107

108-
MultiValueMap<String, Object> mvn = new LinkedMultiValueMap<>();
108+
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
109109

110-
mvn.add("lead", Long.toString(lead));
111-
mvn.add("scan_date", currentDate);
112-
mvn.add("scan_type", scanType.getTestType());
113-
mvn.add("close_old_findings", "true");
114-
mvn.add("skip_duplicates", "false");
115-
mvn.add("test_type", String.valueOf(testType));
110+
body.add("lead", Long.toString(lead));
111+
body.add("scan_date", currentDate);
112+
body.add("scan_type", scanType.getTestType());
113+
body.add("close_old_findings", "true");
114+
body.add("skip_duplicates", "false");
115+
body.add("test_type", String.valueOf(testType));
116116

117117
for (String theKey : options.keySet()) {
118-
mvn.remove(theKey);
118+
body.remove(theKey);
119119
}
120-
mvn.addAll(options);
120+
body.addAll(options);
121121

122122
try {
123123
ByteArrayResource contentsAsResource = new ByteArrayResource(scanFile.getContent().getBytes(StandardCharsets.UTF_8)) {
@@ -127,9 +127,9 @@ public String getFilename() {
127127
}
128128
};
129129

130-
mvn.add("file", contentsAsResource);
130+
body.add("file", contentsAsResource);
131131

132-
var payload = new HttpEntity<>(mvn, headers);
132+
var payload = new HttpEntity<>(body, headers);
133133

134134
return restTemplate.exchange(defectDojoUrl + "/api/v2/" + endpoint + "/", HttpMethod.POST, payload, ImportScanResponse.class).getBody();
135135
} catch (HttpClientErrorException e) {

0 commit comments

Comments
 (0)