Skip to content

Commit 62376ef

Browse files
committed
Remove code clutter
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent 0f7bf4a commit 62376ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,21 @@ public Optional<T> searchUnique(T searchObject) throws URISyntaxException, JsonP
159159
var objects = search(queryParams);
160160

161161
return objects.stream()
162-
.filter((object) -> object != null && object.equalsQueryString(queryParams))
162+
.filter(object -> object != null && object.equalsQueryString(queryParams))
163163
.findFirst();
164164
}
165165

166166
public Optional<T> searchUnique(Map<String, Object> queryParams) throws URISyntaxException, JsonProcessingException {
167167
var objects = search(queryParams);
168168

169169
return objects.stream()
170-
.filter((object) -> object.equalsQueryString(queryParams))
170+
.filter(object -> object.equalsQueryString(queryParams))
171171
.findFirst();
172172
}
173173

174174
public T create(T object) {
175175
var restTemplate = this.getRestTemplate();
176-
HttpEntity<T> payload = new HttpEntity<T>(object, getDefectDojoAuthorizationHeaders());
176+
HttpEntity<T> payload = new HttpEntity<>(object, getDefectDojoAuthorizationHeaders());
177177

178178
ResponseEntity<T> response = restTemplate.exchange(this.config.getUrl() + "/api/v2/" + getUrlPath() + "/", HttpMethod.POST, payload, getModelClass());
179179
return response.getBody();
@@ -188,7 +188,7 @@ public void delete(long id) {
188188

189189
public T update(T object, long objectId) {
190190
var restTemplate = this.getRestTemplate();
191-
HttpEntity<T> payload = new HttpEntity<T>(object, getDefectDojoAuthorizationHeaders());
191+
HttpEntity<T> payload = new HttpEntity<>(object, getDefectDojoAuthorizationHeaders());
192192

193193
ResponseEntity<T> response = restTemplate.exchange(this.config.getUrl() + "/api/v2/" + getUrlPath() + "/" + objectId + "/", HttpMethod.PUT, payload, getModelClass());
194194
return response.getBody();

0 commit comments

Comments
 (0)