Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
goulven authored and goulven committed Oct 26, 2024
1 parent e7b9c40 commit 5451df9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class EcoScoreRanking {
// Number of items in ther vertical when the position was computed
private long globalCount;
// The best item id in the whole vertical
private long globalBest;
private Long globalBest;
// The better item id in the whole vertical (item just after)
private long globalBetter;
private Long globalBetter;



Expand Down Expand Up @@ -51,19 +51,6 @@ public void setSpecializedCount(long specializedCount) {
this.specializedCount = specializedCount;
}


public long getGlobalBest() {
return globalBest;
}
public void setGlobalBest(long globalBest) {
this.globalBest = globalBest;
}
public long getGlobalBetter() {
return globalBetter;
}
public void setGlobalBetter(long globalBetter) {
this.globalBetter = globalBetter;
}
public String getSpecializedBest() {
return specializedBest;
}
Expand All @@ -76,6 +63,18 @@ public String getSpecializedBetter() {
public void setSpecializedBetter(String specializedBetter) {
this.specializedBetter = specializedBetter;
}
public Long getGlobalBest() {
return globalBest;
}
public void setGlobalBest(Long globalBest) {
this.globalBest = globalBest;
}
public Long getGlobalBetter() {
return globalBetter;
}
public void setGlobalBetter(Long globalBetter) {
this.globalBetter = globalBetter;
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private ModelAndView buildProductView(Long id, String vertical, final HttpServle
Long globalBestId = data.getRanking().getGlobalBest();
Long globalBetter = data.getRanking().getGlobalBetter();

if (null != globalBestId) {
if (null != globalBestId && globalBestId.longValue() !=0) {
Product best = null;
try {
best = productRepository.getById(globalBestId);
Expand All @@ -191,7 +191,7 @@ private ModelAndView buildProductView(Long id, String vertical, final HttpServle
mv.addObject("best", best);
}

if (null != globalBetter) {
if (null != globalBetter && globalBetter.longValue() != 0) {
Product better = null;
try {
better = productRepository.getById(globalBetter);
Expand Down

0 comments on commit 5451df9

Please sign in to comment.