Commit edbccb7a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

comparison to integer should be done via equals

parent 05b8d0d6
Pipeline #43176 passed with stage
in 24 minutes and 48 seconds
......@@ -15,6 +15,8 @@ import org.springframework.security.core.Authentication;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;
import com.sun.istack.NotNull;
import lcsb.mapviewer.api.*;
import lcsb.mapviewer.model.cache.FileEntry;
import lcsb.mapviewer.model.map.layout.ProjectBackground;
......
......@@ -768,7 +768,7 @@ public class ProjectRestImpl extends BaseRestImpl {
public ProjectBackground getBackgroundById(String projectId, Integer backgroundId) throws ObjectNotFoundException {
List<ProjectBackground> backgrounds = getProjectByProjectId(projectId).getProjectBackgrounds();
for (ProjectBackground projectBackground : backgrounds) {
if (projectBackground.getId() == backgroundId) {
if (Objects.equals(projectBackground.getId(), backgroundId)) {
Hibernate.initialize(projectBackground.getProjectBackgroundImageLayer());
return projectBackground;
}
......@@ -796,7 +796,10 @@ public class ProjectRestImpl extends BaseRestImpl {
if (key.equalsIgnoreCase("description")) {
background.setDescription((String) value);
} else if (key.equalsIgnoreCase("id")) {
if (value != overlayId) {
if (!Objects.equals(value , overlayId)) {
logger.error("!!!!!!!!!!!!!!!!!");
logger.error(value);
logger.error(overlayId);
throw new QueryException("cannot change id");
}
} else if (key.equalsIgnoreCase("name")) {
......
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