Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
248b61d3
Commit
248b61d3
authored
May 22, 2014
by
Matija Obreza
Browse files
Fixed bug in #getCurrentCountry(iso3) loop
parent
4e137696
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/GeoServiceImpl.java
View file @
248b61d3
...
...
@@ -86,7 +86,7 @@ public class GeoServiceImpl implements GeoService {
Country
.
sort
(
countries
,
locale
);
return
countries
;
}
@Override
public
long
countActive
()
{
return
countryRepository
.
countByCurrent
(
true
);
...
...
@@ -172,16 +172,17 @@ public class GeoServiceImpl implements GeoService {
Country
country
=
getCountry
(
code3
);
if
(
country
!=
null
)
{
if
(
country
!=
null
&&
country
.
getReplacedBy
()
!=
null
)
{
// Loop detection
Set
<
Long
>
seenCountryId
=
new
HashSet
<
Long
>();
while
(!
seenCountryId
.
contains
(
country
.
getId
())
&&
country
.
getReplacedBy
()
!=
null
)
{
LOG
.
info
(
"Country "
+
country
.
getCode3
()
+
" replaced by "
+
country
.
getReplacedBy
());
// Update reference
country
=
country
.
getReplacedBy
();
// Put countryId to seen list
seenCountryId
.
add
(
country
.
getId
());
// Update reference
country
=
country
.
getReplacedBy
();
}
}
...
...
@@ -401,7 +402,7 @@ public class GeoServiceImpl implements GeoService {
return
itpgrfaRepository
.
save
(
itpgrfaStatus
);
}
@Override
public
String
filteredKml
(
String
jsonFilter
)
{
return
null
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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