Browse Source

Drop warnings about unchecked casts in a few stable select places

Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544
stable-3.5
Robin Rosenberg 10 years ago committed by Matthias Sohn
parent
commit
05896dabfc
  1. 1
      org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
  2. 3
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
  3. 1
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
  4. 3
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
  5. 2
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java
  6. 2
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
  7. 1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java

1
org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java

@ -82,6 +82,7 @@ class GlobalBundleCache {
* @exception TranslationBundleLoadingException see {@link TranslationBundle#load(Locale)} * @exception TranslationBundleLoadingException see {@link TranslationBundle#load(Locale)}
* @exception TranslationStringMissingException 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) { static synchronized <T extends TranslationBundle> T lookupBundle(Locale locale, Class<T> type) {
try { try {
Map<Class, TranslationBundle> bundles = cachedBundles.get(locale); Map<Class, TranslationBundle> bundles = cachedBundles.get(locale);

3
org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java

@ -91,6 +91,7 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
* @param h * @param h
* total height (in pixels) of this cell. * total height (in pixels) of this cell.
*/ */
@SuppressWarnings("unchecked")
protected void paintCommit(final PlotCommit<TLane> commit, final int h) { protected void paintCommit(final PlotCommit<TLane> commit, final int h) {
final int dotSize = computeDotSize(h); final int dotSize = computeDotSize(h);
final TLane myLane = commit.getLane(); final TLane myLane = commit.getLane();
@ -114,7 +115,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
LINE_WIDTH); LINE_WIDTH);
for (int i = 0; i < commit.mergingLanes.length; i++) { for (int i = 0; i < commit.mergingLanes.length; i++) {
@SuppressWarnings("unchecked")
final TLane pLane = (TLane) commit.mergingLanes[i]; final TLane pLane = (TLane) commit.mergingLanes[i];
final TColor pColor = laneColor(pLane); final TColor pColor = laneColor(pLane);
final int cx = laneC(pLane); final int cx = laneC(pLane);
@ -138,7 +138,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
if (commit.getChildCount() > 0) { if (commit.getChildCount() > 0) {
for (int i = 0; i < commit.forkingOffLanes.length; i++) { for (int i = 0; i < commit.forkingOffLanes.length; i++) {
@SuppressWarnings("unchecked")
final TLane childLane = (TLane) commit.forkingOffLanes[i]; final TLane childLane = (TLane) commit.forkingOffLanes[i];
final TColor cColor = laneColor(childLane); final TColor cColor = laneColor(childLane);
final int cx = laneC(childLane); final int cx = laneC(childLane);

1
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. * @return the assigned lane for this commit.
*/ */
@SuppressWarnings("unchecked")
public final L getLane() { public final L getLane() {
return (L) lane; return (L) lane;
} }

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

@ -115,6 +115,7 @@ public class PlotCommitList<L extends PlotLane> extends
* @param result * @param result
* collection to add the passing lanes into. * collection to add the passing lanes into.
*/ */
@SuppressWarnings("unchecked")
public void findPassingThrough(final PlotCommit<L> currCommit, public void findPassingThrough(final PlotCommit<L> currCommit,
final Collection<L> result) { final Collection<L> result) {
for (final PlotLane p : currCommit.passingLanes) for (final PlotLane p : currCommit.passingLanes)
@ -343,6 +344,7 @@ public class PlotCommitList<L extends PlotLane> extends
} }
} }
@SuppressWarnings("unchecked")
private void closeLane(PlotLane lane) { private void closeLane(PlotLane lane) {
if (activeLanes.remove(lane)) { if (activeLanes.remove(lane)) {
recycleLane((L) lane); recycleLane((L) lane);
@ -395,6 +397,7 @@ public class PlotCommitList<L extends PlotLane> extends
/** /**
* @return a new Lane appropriate for this particular PlotList. * @return a new Lane appropriate for this particular PlotList.
*/ */
@SuppressWarnings("unchecked")
protected L createLane() { protected L createLane() {
return (L) new PlotLane(); return (L) new PlotLane();
} }

2
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 * @throws MissingObjectException
* see {@link RevWalk#next()} * see {@link RevWalk#next()}
*/ */
@SuppressWarnings("unchecked")
public void fillTo(final int highMark) throws MissingObjectException, public void fillTo(final int highMark) throws MissingObjectException,
IncorrectObjectTypeException, IOException { IncorrectObjectTypeException, IOException {
if (walker == null || size > highMark) if (walker == null || size > highMark)
@ -361,6 +362,7 @@ public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
* @throws MissingObjectException * @throws MissingObjectException
* see {@link RevWalk#next()} * see {@link RevWalk#next()}
*/ */
@SuppressWarnings("unchecked")
public void fillTo(final RevCommit commitToLoad, int highMark) public void fillTo(final RevCommit commitToLoad, int highMark)
throws MissingObjectException, IncorrectObjectTypeException, throws MissingObjectException, IncorrectObjectTypeException,
IOException { IOException {

2
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java

@ -87,6 +87,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
size++; size++;
} }
@SuppressWarnings("unchecked")
public E set(int index, E element) { public E set(int index, E element) {
Block s = contents; Block s = contents;
while (index >> s.shift >= BLOCK_SIZE) { while (index >> s.shift >= BLOCK_SIZE) {
@ -106,6 +107,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
return (E) old; return (E) old;
} }
@SuppressWarnings("unchecked")
public E get(int index) { public E get(int index) {
Block s = contents; Block s = contents;
if (index >> s.shift >= 1024) if (index >> s.shift >= 1024)

1
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 * address to listen for connections on. If null, any available
* port will be chosen on all network interfaces. * port will be chosen on all network interfaces.
*/ */
@SuppressWarnings("unchecked")
public Daemon(final InetSocketAddress addr) { public Daemon(final InetSocketAddress addr) {
myAddress = addr; myAddress = addr;
processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$ processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$

Loading…
Cancel
Save