Browse Source

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>
stable-3.4
Konrad Kügler 11 years ago committed by Matthias Sohn
parent
commit
e5f7fdcf4f
  1. 9
      org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
  2. 1
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
  3. 8
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotLane.java

9
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java

@ -83,14 +83,5 @@ class SwingCommitList extends PlotCommitList<SwingCommitList.SwingLane> {
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();
}
}
}

1
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java

@ -236,7 +236,6 @@ public class PlotCommitList<L extends PlotLane> extends
if (newPos == -1)
newPos = positionsAllocated++;
freePositions.add(Integer.valueOf(commit.lane.getPosition()));
activeLanes.remove(commit.lane);
commit.lane.position = newPos;
activeLanes.add(commit.lane);
}

8
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotLane.java

@ -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…
Cancel
Save