PlotLane: Use identity hashCode and equals
Using the lane position and other data for equals/hashCode is not useful. Change-Id: I7af151d8a84544a77a486474c8ac71dd80090c66 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
This commit is contained in:
parent
8b65a4e6c6
commit
e5f7fdcf4f
|
@ -83,14 +83,5 @@ protected void recycleLane(final SwingLane lane) {
|
|||
|
||||
static class SwingLane extends PlotLane {
|
||||
Color color;
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o) && color.equals(((SwingLane)o).color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() ^ color.hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,6 @@ private void handleBlockedLanes(final int index,
|
|||
if (newPos == -1)
|
||||
newPos = positionsAllocated++;
|
||||
freePositions.add(Integer.valueOf(commit.lane.getPosition()));
|
||||
activeLanes.remove(commit.lane);
|
||||
commit.lane.position = newPos;
|
||||
activeLanes.add(commit.lane);
|
||||
}
|
||||
|
|
|
@ -63,12 +63,4 @@ public class PlotLane implements Serializable {
|
|||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public boolean equals(final Object o) {
|
||||
return o == this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue