Merge remote-tracking branch 'origin/master'
commit
b307fe06a2
|
@ -56,6 +56,14 @@ public class TextBox extends Rectangle {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return this == o;
|
try {
|
||||||
|
TextBox t = (TextBox)o;
|
||||||
|
// duck typing equals check
|
||||||
|
// if it shows the same id, assume that it is equal; this is because ids should be unique
|
||||||
|
// also makes some corner cases easier
|
||||||
|
return this.id.equals(t.id);
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue