From 258f516abe545667f50dc74760672fafd94a7533 Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Thu, 28 Oct 2010 16:37:49 +0200 Subject: Fix FindBugs and Eclipse warnings in org.eclipse.jgit.ui Change-Id: Ie6b3ff7d470cc9b7044fd6288cbf86dcc58220eb --- .../src/org/eclipse/jgit/awtui/AWTPlotRenderer.java | 7 +++++-- .../src/org/eclipse/jgit/awtui/CommitGraphPane.java | 1 + .../src/org/eclipse/jgit/awtui/SwingCommitList.java | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit.ui/src/org') diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java index 4a5d4603ca..e699a72cfa 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java @@ -49,6 +49,7 @@ import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Polygon; +import java.io.Serializable; import org.eclipse.jgit.awtui.CommitGraphPane.GraphCellRender; import org.eclipse.jgit.awtui.SwingCommitList.SwingLane; @@ -57,11 +58,13 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.revplot.AbstractPlotRenderer; import org.eclipse.jgit.revplot.PlotCommit; -final class AWTPlotRenderer extends AbstractPlotRenderer { +final class AWTPlotRenderer extends AbstractPlotRenderer + implements Serializable { + private static final long serialVersionUID = 1L; final GraphCellRender cell; - Graphics2D g; + transient Graphics2D g; AWTPlotRenderer(final GraphCellRender c) { cell = c; diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java index 13d408f19f..9c9d1f4a5c 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java @@ -222,6 +222,7 @@ public class CommitGraphPane extends JTable { PlotCommit commit; + @SuppressWarnings("unchecked") public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java index b58547a9e1..d8660e5ed6 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java @@ -87,5 +87,10 @@ class SwingCommitList extends PlotCommitList { public boolean equals(Object o) { return super.equals(o) && color.equals(((SwingLane)o).color); } + + @Override + public int hashCode() { + return super.hashCode() ^ color.hashCode(); + } } } -- cgit v1.2.3