Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
edbccb7a
Commit
edbccb7a
authored
Jun 16, 2021
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectController.java
View file @
edbccb7a
...
...
@@ -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
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java
View file @
edbccb7a
...
...
@@ -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"
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment