[josm-dev] [PATCH 01/26] Enhance OsmPrimitive a bit
Frederik Ramm
frederik at remote.org
Tue Apr 29 14:20:18 BST 2008
Hi,
> @Override public final boolean equals(Object obj) {
> - if (obj == null || getClass() != obj.getClass() || id == 0 ||
> ((OsmPrimitive)obj).id == 0)
> + if (obj == null || getClass() != obj.getClass())
> + return super.equals(obj);
> + if (id == 0 && ((OsmPrimitive)obj).id == 0)
> return super.equals(obj);
> return id == ((OsmPrimitive)obj).id;
> }
In a case where id == 0 but obj.id != 0, the old code would have
returned super.equals(obj), while your code returns false. I suspect
it doesn't matter much - but was that a deliberate change and if yes,
why?
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the josm-dev
mailing list