Commit 25ea2f43 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

java 8 compatibility issue

parent 24833bdf
package lcsb.mapviewer.api.taxonomy;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
......@@ -41,6 +42,9 @@ public class TaxonomyController extends BaseController {
if (name == null) {
throw new ObjectNotFoundException("Object not found: " + id);
}
return Map.of("name", name, "id", id);
Map<String, Object> result = new HashMap<>();
result.put("name", name);
result.put("id", id);
return result;
}
}
\ No newline at end of file
......@@ -435,7 +435,9 @@ public class UserController extends BaseController {
}
userService.createResetPasswordToken(user);
return Map.of("status", "OK");
Map<String, Object> result = new HashMap<>();
result.put("status", "OK");
return result;
}
@PostMapping(value = "/users:resetPassword")
......@@ -445,7 +447,9 @@ public class UserController extends BaseController {
throws IOException, QueryException {
try {
userService.resetPassword(token, passwordEncoder.encode(password));
return Map.of("status", "OK");
Map<String, Object> result = new HashMap<>();
result.put("status", "OK");
return result;
} catch (InvalidTokenException e) {
throw new ObjectNotFoundException("Invalid token", e);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment