Drop warnings about unchecked casts in a few stable select places

Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544
This commit is contained in:
Robin Rosenberg 2014-07-15 11:37:10 +02:00 committed by Matthias Sohn
parent 4c6857d1ec
commit 05896dabfc
7 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -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 @@ protected void paintCommit(final PlotCommit<TLane> commit, final int h) {
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 @@ protected void paintCommit(final PlotCommit<TLane> commit, final int h) {
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);

View File

@ -198,6 +198,7 @@ public final Ref getRef(final int nth) {
*
* @return the assigned lane for this commit.
*/
@SuppressWarnings("unchecked")
public final L getLane() {
return (L) lane;
}

View File

@ -115,6 +115,7 @@ public void source(final RevWalk w) {
* @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 @@ private static void addBlockedPosition(BitSet blockedPositions,
}
}
@SuppressWarnings("unchecked")
private void closeLane(PlotLane lane) {
if (activeLanes.remove(lane)) {
recycleLane((L) lane);
@ -395,6 +397,7 @@ private int getFreePosition(BitSet blockedPositions) {
/**
* @return a new Lane appropriate for this particular PlotList.
*/
@SuppressWarnings("unchecked")
protected L createLane() {
return (L) new PlotLane();
}

View File

@ -297,6 +297,7 @@ public boolean isPending() {
* @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 void fillTo(final int highMark) throws MissingObjectException,
* @throws MissingObjectException
* see {@link RevWalk#next()}
*/
@SuppressWarnings("unchecked")
public void fillTo(final RevCommit commitToLoad, int highMark)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {

View File

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

View File

@ -103,6 +103,7 @@ public 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$