summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2014-07-15 11:37:10 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-09-04 11:35:19 +0200
commit05896dabfc28b57d3c254b055be9e9bd9f1e32a0 (patch)
tree0d8e0853621e3f82dfe8c06dff85f73342ab3cd8 /org.eclipse.jgit/src/org/eclipse
parent4c6857d1ec508c8fef3ac7878ed363c57cbda1da (diff)
downloadjgit-05896dabfc28b57d3c254b055be9e9bd9f1e32a0.tar.gz
jgit-05896dabfc28b57d3c254b055be9e9bd9f1e32a0.zip
Drop warnings about unchecked casts in a few stable select places
Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java1
7 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
index c95689ccb7..d880d9b616 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
@@ -82,6 +82,7 @@ class GlobalBundleCache {
* @exception TranslationBundleLoadingException see {@link TranslationBundle#load(Locale)}
* @exception TranslationStringMissingException see {@link TranslationBundle#load(Locale)}
*/
+ @SuppressWarnings("unchecked")
static synchronized <T extends TranslationBundle> T lookupBundle(Locale locale, Class<T> type) {
try {
Map<Class, TranslationBundle> bundles = cachedBundles.get(locale);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
index 0fac3af9b9..6ba0dfed03 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
@@ -91,6 +91,7 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
* @param h
* total height (in pixels) of this cell.
*/
+ @SuppressWarnings("unchecked")
protected void paintCommit(final PlotCommit<TLane> commit, final int h) {
final int dotSize = computeDotSize(h);
final TLane myLane = commit.getLane();
@@ -114,7 +115,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
LINE_WIDTH);
for (int i = 0; i < commit.mergingLanes.length; i++) {
- @SuppressWarnings("unchecked")
final TLane pLane = (TLane) commit.mergingLanes[i];
final TColor pColor = laneColor(pLane);
final int cx = laneC(pLane);
@@ -138,7 +138,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
if (commit.getChildCount() > 0) {
for (int i = 0; i < commit.forkingOffLanes.length; i++) {
- @SuppressWarnings("unchecked")
final TLane childLane = (TLane) commit.forkingOffLanes[i];
final TColor cColor = laneColor(childLane);
final int cx = laneC(childLane);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
index dba68465c2..2e8aab885a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
@@ -198,6 +198,7 @@ public class PlotCommit<L extends PlotLane> extends RevCommit {
*
* @return the assigned lane for this commit.
*/
+ @SuppressWarnings("unchecked")
public final L getLane() {
return (L) lane;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
index 3444c8df1c..6102a81482 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
@@ -115,6 +115,7 @@ public class PlotCommitList<L extends PlotLane> extends
* @param result
* collection to add the passing lanes into.
*/
+ @SuppressWarnings("unchecked")
public void findPassingThrough(final PlotCommit<L> currCommit,
final Collection<L> result) {
for (final PlotLane p : currCommit.passingLanes)
@@ -343,6 +344,7 @@ public class PlotCommitList<L extends PlotLane> extends
}
}
+ @SuppressWarnings("unchecked")
private void closeLane(PlotLane lane) {
if (activeLanes.remove(lane)) {
recycleLane((L) lane);
@@ -395,6 +397,7 @@ public class PlotCommitList<L extends PlotLane> extends
/**
* @return a new Lane appropriate for this particular PlotList.
*/
+ @SuppressWarnings("unchecked")
protected L createLane() {
return (L) new PlotLane();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java
index 835e0ce224..64f99bbd28 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java
@@ -297,6 +297,7 @@ public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
* @throws MissingObjectException
* see {@link RevWalk#next()}
*/
+ @SuppressWarnings("unchecked")
public void fillTo(final int highMark) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
if (walker == null || size > highMark)
@@ -361,6 +362,7 @@ public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
* @throws MissingObjectException
* see {@link RevWalk#next()}
*/
+ @SuppressWarnings("unchecked")
public void fillTo(final RevCommit commitToLoad, int highMark)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
index a05cc9046f..5052a4dea5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
@@ -87,6 +87,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
size++;
}
+ @SuppressWarnings("unchecked")
public E set(int index, E element) {
Block s = contents;
while (index >> s.shift >= BLOCK_SIZE) {
@@ -106,6 +107,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
return (E) old;
}
+ @SuppressWarnings("unchecked")
public E get(int index) {
Block s = contents;
if (index >> s.shift >= 1024)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
index 89f0764a5e..03f7c72835 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
@@ -103,6 +103,7 @@ public class Daemon {
* address to listen for connections on. If null, any available
* port will be chosen on all network interfaces.
*/
+ @SuppressWarnings("unchecked")
public Daemon(final InetSocketAddress addr) {
myAddress = addr;
processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$