Commit e285ca89 authored by Nico Mack's avatar Nico Mack
Browse files

Minor fix in compareTo method making sure the method distinguishes

positionable of different classes
parent 3622935d
...@@ -225,7 +225,7 @@ public abstract class Marker implements Positionable { ...@@ -225,7 +225,7 @@ public abstract class Marker implements Positionable {
@Override @Override
public int compareTo(Positionable o) { public int compareTo(Positionable o) {
int comparison = 1; int comparison = 1;
if (o != null) { if ((o != null) && (o instanceof Marker)) {
comparison = this.getHandleId().compareTo(o.getHandleId()); comparison = this.getHandleId().compareTo(o.getHandleId());
} }
return comparison; return comparison;
......
...@@ -609,7 +609,7 @@ public class BaseWidget implements Positionable, Touchable { ...@@ -609,7 +609,7 @@ public class BaseWidget implements Positionable, Touchable {
@Override @Override
public int compareTo(Positionable o) { public int compareTo(Positionable o) {
int comparison = 1; int comparison = 1;
if (o != null) { if ((o != null) && (o instanceof BaseWidget)) {
comparison = this.getHandleId().compareTo(o.getHandleId()); comparison = this.getHandleId().compareTo(o.getHandleId());
} }
return comparison; return comparison;
......
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