File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
src/main/java/io/securecodebox/persistence/defectdojo/service Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 1313import java .util .ArrayList ;
1414import java .util .List ;
1515
16- public class UserProfileService extends GenericDefectDojoService <UserProfile > {
16+ public final class UserProfileService extends GenericDefectDojoService <UserProfile > {
1717
1818 public UserProfileService (Config config ) {
1919 super (config );
@@ -31,16 +31,15 @@ protected Class<UserProfile> getModelClass() {
3131
3232 @ Override
3333 protected PaginatedResult <UserProfile > deserializeList (String response ) throws JsonProcessingException {
34- // GenericDefectDojoService expects that the response from the defectdojo api is a list
35- // This endpoint returns a single object though, to not break the code this response gets converted to a defectdojo response
36- UserProfile userProfile = this .objectMapper .readValue (response , new TypeReference <>() {
34+ /* GenericDefectDojoService expects that the response from the defectdojo api is a list.
35+ * This endpoint returns a single object though, to not break the code this response
36+ * gets converted to a defectdojo response.
37+ */
38+ final var userProfile = this .objectMapper .readValue (response , new TypeReference <UserProfile >() {
3739 });
38- List <UserProfile > userProfileList = new ArrayList <>();
39- userProfileList .add (userProfile );
40-
41- PaginatedResult <UserProfile > fakeResult = new PaginatedResult <>();
42- fakeResult .setResults (userProfileList );
43- fakeResult .setCount (1 );
44- return fakeResult ;
40+ final var result = new PaginatedResult <UserProfile >();
41+ result .setResults (List .of (userProfile ));
42+ result .setCount (1 );
43+ return result ;
4544 }
4645}
You can’t perform that action at this time.
0 commit comments